Repository navigation
Conversation
|
Re-review summary Reviewed head
|
|
Independent re-review summary Reviewed the full PR #19507 diff against
|
|
Independent re-review summary Reviewed PR #19507 at
|
|
Self-review update — round 4 Reviewed PR head
|
|
Independent review summary — round 5 Reviewed the complete diff from merge base All newly added tests have already been run locally. No code changes were needed in this round; PR #19507 is marked ready for review after confirming that the source branch and PR head still match the reviewed SHA. |
| final Path marker = scope.resolve(PipeTsFileResource.MANUAL_INTERVENTION_MARKER_DIR); | ||
| try { | ||
| Files.move(marker, scope.resolve(DROPPED_RETENTION_DIR_NAME)); | ||
| try (final FileChannel channel = FileChannel.open(scope, StandardOpenOption.READ)) { |
There was a problem hiding this comment.
minor iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/PipeDataNodeHardlinkOrCopiedFileDirStartupCleaner.java:317 — Dropped-pipe marker rename is never fsynced on Windows
retireManualInterventionMarker makes the Files.move to .manual-intervention-dropped durable with FileChannel.open(scope, READ) on a directory, which always throws on Windows (the exact failure fixed for PipeTsFileResourceManager.forceDirectory in this PR). Trigger: pipe drop of a retained pipe dir while tryMoveDroppedPipeDir fails (a Windows-with-open-handles case this PR retries). Result: the IOException is swallowed into a WARN, the rename is never fsynced, and if it is lost on crash the .manual-intervention-required marker resurrects; since the pipe is already dropped, cleanPipeTsFileDir is never called again and the retained TsFile hardlinks leak permanently.
Fix: Reuse the Windows-aware helper (e.g. make PipeTsFileResourceManager.forceDirectory accessible as a static utility) instead of FileChannel.open(directory, READ); only catch the missing-marker case as ignorable.
There was a problem hiding this comment.
Fixed in c9301e9b915. The dropped-pipe cleaner now uses PipeTsFileResourceManager.forceDirectoryMetadata, including the Windows-aware directory flush. A missing marker is ignored only during the rename; directory-sync failures are logged.
| break; | ||
| } | ||
|
|
||
| if (skipOnFailedClose && retainTsFileAfterCloseFailure()) { |
There was a problem hiding this comment.
minor iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/PipeTsFileInsertionEvent.java:409 — Failed marker creation is retried with directory fsync every 100 ms
When a close failure is recorded and marker creation cannot succeed (blocked marker dir, filesystem without hardlinks, missing/unreadable pipe dir), retainTsFileAfterCloseFailure() returns false and the loop re-invokes it on every 100 ms poll iteration forever. Each attempt performs forceDirectory(pipeDir) plus the ancestor fsync chain while holding the isClosed monitor, so a single stuck pipe issues ~10 durable directory flushes per second indefinitely and blocks the TsFile close callback that synchronizes on the same monitor. Their own testFailedCloseWaitsWhenRetentionMarkerDirectoryIsBlocked exercises this repeating path.
Fix: Attempt retention once (or with a growing backoff/next-attempt timestamp) instead of on every poll iteration, and do the fsync work outside the synchronized (isClosed) block.
There was a problem hiding this comment.
Fixed in c9301e9b915. Retention retries now start at 1 second and back off exponentially to 60 seconds; marker creation and fsync run outside the isClosed monitor. Regression tests cover retry throttling and close-listener progress during a blocked sync.
Review Comment UpdatesHandled both actionable inline comments on reviewed head
Verification
Final local commit and confirmed source-branch/PR head: |
|
Self-review update — IT coverage Reviewed PR head Verification: Spotless passed; IT selection/shard coverage check passed; Final local commit and confirmed source-branch/PR head: |
Summary
Add the optional
source.skip-on-failed-closesource parameter, defaulting tofalse, for DataRegion TsFile events.When enabled, Pipe advances past a TsFile only after a close failure is recorded and its hardlink is retained with a verified, synced manual-intervention marker. The retained file survives node restart and is removed when the pipe is dropped. If marker creation or validation fails, Pipe continues waiting and does not advance progress. The default behavior remains to wait.
Example
With
source.skip-on-failed-close=false(the default), a failed TsFile close continues waiting. Withsource.skip-on-failed-close=true, the same file is skipped and its progress is reported only when the durable retention marker succeeds; if marker creation or sync fails, waiting continues and progress is not reported.Tests
The focused DataNode test run passed 110 tests, including default waiting, successful retained-file skip/progress, marker-failure waiting, restart retention, multi-directory restoration, and pipe-drop cleanup.