luoluoyuyu commented on PR #19321: URL: https://github.com/apache/iotdb/pull/19321#issuecomment-6997388053
The direction is right and the change is low-risk, but it fixes the symptom rather than the root cause. Three concerns worth addressing before merge: 1. **Lifecycle ownership is still unresolved.** `DeletionResourceManager` is lazily created in a static map, decoupled from `DataRegion`, so cleanup has to guess whether it exists. `closeAndRemoveDAL` only patches this one call site; the other `getInstance()` call sites (`PipeInsertionDataNodeListener:157`, `PipeDataRegionAssigner:390`, `PipeHistoricalDataRegionTsFileAndDeletionSource:578/1430`) are still get-or-create. A late pipe task can therefore still recreate the manager, its directory and its persist thread after cleanup. Worse, the new `map.get()` + delete-directory sequence is not atomic: a concurrent `getInstance()` between the two steps gets its directory deleted underneath it, and its `FileChannel` keeps writing to an unlinked inode (silent loss of deletion records). The old `computeIfAbsent` at least made creation atomic. Please either bind creation/close to the DataRegion lifecycle, or add `getInstanceIfPresent` plus a per-region tombstone so post-cleanup creation fa ils. 2. **Shutdown still uses interrupt as control flow; only the log was hidden.** Gating the first `catch` on `isClosed` is fine, but the `poll()` catch at `PageCacheDeletionBuffer.java:407` still logs WARN unconditionally (the message constant is even `...TAKING_WALENTRY_FROM`, i.e. copy-pasted from WAL and never revisited). If `close()` reaches `shutdownNow()` after the 10s flush timeout, the interrupt can land in `poll()` and the warning is back. Prefer a sentinel/poison pill, or a bounded `poll()` that checks `isClosed`, so the thread exits naturally. 3. **Cleanup ordering is untouched.** `StorageEngine:898-899` deletes the DAL directory *before* `releaseReceiverResource(regionId)`, so pipe/receiver resources can still be active during cleanup. Please stop/release the region's pipe resources first, then close the manager, then delete the directory. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
