xmg333 commented on PR #18463: URL: https://github.com/apache/dolphinscheduler/pull/18463#issuecomment-6313827276
Thanks for the review — both points are addressed in `ead58cd654`. **1. File replacement across chunks**: the chunk request now carries the identity pinned from the first chunk (length + mtime + inode key), and the worker re-checks it before every read using one atomic `Files.readAttributes` stat. Shrink → `LOG_TRUNCATED` (rotation semantics, unchanged); different inode or backwards mtime → new `LOG_FILE_REPLACED`, and the API fails the download explicitly instead of publishing an A-prefix + B-suffix "success". Appends (mtime forward) still pass. Old workers/clients are unaffected — 0/null means "not pinned" and the fields are ignored by old peers. We chose identity pinning over a worker-side byte snapshot: it keeps the "incomplete download must fail" contract without doubling worker storage. Honest limitation, noted in code: a replacement landing between the stat and the read can still slip through — fully closing that needs an inode-pinned open handle, a much bigger change; the window is now micro-sized, not chunk-sized. Tests: `LogServiceImplTest#sameSizeReplacedFileRejected…` (real inode, equal-length replacement, back-dated mtime), `LogStreamingIntegrationTest#streamWholeLog_sameSizeFileReplacedMidDownload_failsExplicitly` (real Netty wire, swap after the first 8 MiB, asserts explicit failure and exactly 8 MiB written), plus append-still-accepted and mid-stream cases in `LogClientDelegateTest`. **2. Legacy missing-method wire shape**: `"Cannot find the ServerMethodInvoker of …"` is now the shared constant `StandardRpcResponse.METHOD_NOT_FOUND_MESSAGE_PREFIX`, and `isMethodNotFound()` matches either the typed flag (new peers) or that prefix (old peers that never send the flag), so a rolling-upgrade worker is classified correctly and falls back to remote storage. `SyncClientMethodInvokerTest#legacyWireResponseWithoutFlagField_isStillRecognizedAsMethodNotFound` feeds it the raw JSON an old server actually sends. Also in the same commit: restored the page-query clamp that was accidentally dropped along the way, so `limit=Integer.MAX_VALUE` can't pull the whole log into memory as a list either. -- 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]
