Skip to content

Use smaller default datagrams for strictly unidirectional air-gap UDP - #19083

Open
Caideyipi wants to merge 1 commit into
masterfrom
codex/udp-loss-tuning-apache
Open

Caideyipi wants to merge 1 commit into
masterfrom
codex/udp-loss-tuning-apache

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Strictly unidirectional air-gap UDP currently defaults to 60 KiB datagrams, which require IP fragmentation on common 1500-byte MTU links. Default this mode to 1400-byte datagrams while preserving explicit packet-size overrides, the 60 KiB acknowledged-UDP default, and the 5 ms send interval. Smaller datagrams at the unchanged interval also lower the per-sender throughput ceiling.

Warn at receiver startup when the operating system provides less socket receive-buffer capacity than requested, with matching English and Chinese messages. Close the UDP socket if startup fails with an IOException. Socket tests cover the strict default, both packet-size aliases, and the existing ACK requirement with an unsliced 2500-byte request.

Follows #19063. Strictly unidirectional UDP still cannot confirm delivery or receiver write success.

Validation

  • Spotless passed for the affected modules.
  • Clean English DataNode dependency-closure build and selected unit tests passed: 34 tests, 0 failures, 0 errors, 0 skipped.
  • Clean Chinese dependency-closure test compilation passed with with-zh-locale.
  • All newly added tests were run locally. The fresh English and Chinese runs executed every build goal without build-cache loads.
  • Validation covers DataNode and its 28-module dependency closure. Full repository builds, distribution packaging, integration suites, sustained saturation, and packet-loss injection were not run.

Field parameter comparison

A prior two-node field trial used MTU 1500 on both hosts with reverse traffic blocked. The runs used existing installed binaries with explicit transport parameters; the candidate binary from this PR was not deployed. Each scenario transferred 560,000 points across 200 series and compared all 200 per-series counts and 200 deterministic sums.

UDP packet size Send interval Sender tasks Batch size Count/sum checks Receiver ΔIp.ReasmReqds Receiver ΔIp.ReasmOKs
61,440 bytes 5 ms 5 1 MiB All matched 3,453 131
1,400 bytes 5 ms 5 1 MiB All matched 0 0
1,400 bytes 1 ms 1 16 KiB All matched 0 0

All three runs had zero new UDP receive-buffer errors and zero receiver warnings/errors. Counts and sums are aggregate integrity checks, not point-by-point value comparisons.

The first two rows changed only packet size while retaining the 5 ms pacing, task count, and batch size. The observed IP reassembly counter increments fell to zero with 1400-byte datagrams, supporting the smaller default on this path. The third row also changed pacing, concurrency, and batching, so it does not isolate the packet-size change.

The receiver's operating-system receive-buffer limit was only 212,992 bytes (208 KiB), despite the application's 32 MiB socket request. This provides an operational reason for the new startup diagnostic. The diagnostic itself was not exercised using the candidate binary in this field trial.

No scenario reproduced point loss, so these results establish the observed removal of IP fragmentation rather than a measured reduction in point-loss probability. Recorded elapsed times include manual orchestration and are not a controlled throughput comparison. Sustained saturation and packet-loss injection were not performed.

This PR has:

  • been independently self-reviewed.
  • added unit tests or modified existing tests to cover the changed behavior.

Key changed classes: IoTDBAirGapSink, PipeSinkConstant, IoTDBAirGapReceiverAgent, and IoTDBDataRegionAirGapSinkTest.

Default strictly unidirectional UDP packets to 1400 bytes while preserving explicit overrides and the acknowledged transport default. Warn when the operating system caps the receiver socket buffer, and cover defaults and overrides with socket tests.
@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.11%. Comparing base (999721f) to head (69af183).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
...iver/protocol/airgap/IoTDBAirGapReceiverAgent.java 0.00% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             master   #19083     +/-   ##
===========================================
  Coverage     48.11%   48.11%             
- Complexity      621      625      +4     
===========================================
  Files          5572     5572             
  Lines        410286   411498   +1212     
  Branches      54129    54169     +40     
===========================================
+ Hits         197408   197996    +588     
- Misses       212878   213502    +624     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant