Skip to content

[Fix] Guard stopped Pipe polling and retain LOAD payloads until replicated - #18913

Merged
jt2594838 merged 2 commits into
apache:masterfrom
Caideyipi:fix/pipe-confignode-stop-poll-race
Oct 20, 2026
Merged

jt2594838 merged 2 commits into
apache:masterfrom
Caideyipi:fix/pipe-confignode-stop-poll-race

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Two races can break Pipe lifecycle integration tests:

  • When STOP PIPE finishes while a ConfigNode task is blocked in source.supply(), the task can still transfer events created afterward. IoTDBPipeLifeCycleIT.testLifeCycleWithHistoryDisabled can then see root.ln0 on the receiver while the Pipe is stopped. Check the stop flag before polling and again after the source returns. Keep a fetched event in lastEvent so restarting the Pipe transfers and commits it once; release it without committing if the task was dropped during polling.
  • When a LOAD finishes before IoTConsensus V1 reports its first safe-deletion watermark, the default Long.MIN_VALUE was treated as permission to delete staged payloads. A lagging replica then receives WAL references whose payloads are gone, which can leave the receiver missing rows after cluster restart in IoTDBPipeLifeCycleIT.testLifeCycleWithClusterRestart. Keep the staged bytes until a real watermark reaches the terminal command, in both task retention and the cleaner. IoTConsensus V2 and protocols without a V1 WAL continue to release immediately.

Add deterministic regression coverage for stop/restart/drop during polling, LOAD payload readability through WAL references before the first watermark, recovery of finished LOAD tasks, and cleanup after replication is confirmed.

Validation

  • The two ConfigNode stop regression tests fail against the original implementation.
  • PipeConfigNodeSubtaskTest and PipeConfigNodeSubtaskExecutorTest: 8 tests passed.
  • IoTDBPipeLifeCycleIT#testLifeCycleWithHistoryDisabled: previously passed with two ScalableSingleNodeMode clusters using the rebuilt ConfigNode jar.
  • ConfigNode main and test sources previously compiled in both English and Chinese locales.
  • LoadTsFileManagerTest and LoadTsFileCleanerTest: 34 tests passed, covering the default watermark, recovery, WAL payload expansion, and V2 immediate cleanup.
  • Spotless, DataNode Checkstyle, and git diff --check passed.
  • IoTDBPipeLifeCycleIT#testLifeCycleWithClusterRestart has not been rerun locally after the LOAD retention fix.

@Caideyipi Caideyipi mentioned this pull request Oct 19, 2026
Treat the default IoTConsensus V1 WAL watermark as unconfirmed replication in both retention and the staged-directory cleaner. Keep immediate release for V2 and protocols without a V1 WAL. Cover commit payload readability, terminal task recovery, and cleanup before the first watermark.
@Caideyipi Caideyipi changed the title [Fix] Pause ConfigNode Pipe events polled after stop [Fix] Guard stopped Pipe polling and retain LOAD payloads until replicated Oct 20, 2026
@jt2594838
jt2594838 merged commit 4943c73 into apache:master Oct 20, 2026
37 of 39 checks passed
jt2594838 pushed a commit that referenced this pull request Oct 20, 2026
…8922)

Partially backport 4943c73.

Check the stop flag before and after polling, retain fetched events for
restart, and release events returned after the task is dropped. Adapt the
regression tests to the 1.3 extractor and outputPipeConnector fields.

The LOAD retention changes do not apply because 1.3 sends LOAD payloads
and terminal commands directly to all replicas instead of replicating
staged-payload references through the WAL.
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.

2 participants