luoluoyuyu commented on PR #19258:
URL: https://github.com/apache/iotdb/pull/19258#issuecomment-6849594469

   All points from this self-review are addressed in `cdf92a2`, and the 
description is rewritten around the actual fixes (per-TsFile resolution and the 
flattened names are no longer presented as a behaviour change; the two-disk 
table is gone).
   
   **P1 - `%s` with SLF4J**: the constant is now 
`LOG_FAILED_TO_CREATE_THE_HARDLINK_OF_THE_FILE_ARG_TO_ARG_FALLING_BACK_TO_COPYING_THE_FILE_89FED96B`
 with `{}` in both locales, and the arguments are passed as `(sourceFile, 
hardlinkOrCopiedFile)` so the sentence reads in the right direction.
   
   **P1 - non-atomic copy**: `copyFileAtomically()` writes 
`<target>.unfinished`, renames it with `ATOMIC_MOVE | REPLACE_EXISTING` 
(falling back to `REPLACE_EXISTING` where atomic moves are unsupported) and 
deletes the temporary file when the copy fails. `REPLACE_EXISTING` is kept so 
that a truncated pipe file left by a previous crash is healed instead of 
failing the pin - covered by `testTruncatedLeftoverPipeFileIsReplaced()`.
   
   **P2 - canonical paths**: `getPipeTsFileDir()` canonicalizes the pipe base 
directory, so every branch of the resolution returns a canonical path and the 
same-scope check no longer compares a canonical parent with a non-canonical 
directory. `testPipeDirOutsideDataDirsIsCanonical()` covers the anchor branch.
   
   **P2 - copy cost / observability**: the (fixed) warning is the 
operator-visible signal for now; the counter next to the pipe resource metrics 
and the `FileStore`-based per-mount resolution stay follow-ups, the latter 
because the pipe directory layout is `<dataDir>/pipe/tsfile` by design and 
moving it onto the file's own mount point would change the cleanup and 
compatibility story.
   
   **P3 - startup cleaner**: `collectInterruptedStalePipeDirs()` now takes the 
expected name (`<pipe base dir>` at the data-directory level, `<tsfile dir>` 
below the pipe directory) and matches `name.startsWith(expected + 
".startup-cleaning-")` instead of `contains`.
   
   **P3 - test coverage**:
   - `testUnclosedTsFileIsNotCopiedWhenHardlinkFails()` derives the blocked 
directory from `getHardlinkOrCopiedFileInPipeDir()` instead of hardcoding 
`<ROOT>/pipe/tsfile`.
   - `PipeTsFileDirPathResolver.setInstanceForTest(Supplier<String[]>)` / 
`reset()` added, used by `testPinTsFileUnderConfiguredDataDirKeepsItsOwnDisk()` 
(data-directory prefix branch, TsFile stays on its own disk) and 
`testCleanPipeTsFileDirCleansEveryDataDir()` (one pipe spanning two data 
directories).
   - `testPinSucceedsOnRetryAfterTheHardlinkFailed()`: the pin fails with the 
pipe directory blocked, leaves nothing behind, and succeeds with the complete 
content after the block is removed.
   
   Local: `spotless:apply` clean, `en`/`zh` compile, 20 unit tests pass (7 
mapping + 13 manager). CI is running on `cdf92a2`.
   
   Still open, as listed above: the multi-disk manual run (I will do it before 
merge) and the metric counter.
   


-- 
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]

Reply via email to