frotmo commented on PR #11619: URL: https://github.com/apache/rocketmq/pull/11619#issuecomment-7179953239
Thanks @JiangSOBD for putting this together — it looks like we started on the same fix for #11603 at almost the same time (#11617), and the store-side guard is nearly identical in both patches. The same P1 applies to both: the refusal only lasts for a single `doTruncate` call, so a later handshake — same-epoch writes past the local `confirmOffset`, or a slave restart — can end up accepting a rewritten history. Since both PRs also add the same `AutoSwitchHAClientTest.java` and touch the same lines, they can't land independently anyway. So I'd like to propose that we consolidate into a single PR, so the reviewer doesn't have to iterate on two nearly identical patches. My suggestion would be to use this PR (#11619) as the base: - Your plan for the P1 — persist a fail-closed marker, keep rejecting across reconnects and restarts, add a one-shot recovery authorization tied to the expected master history and truncation offset, and cover the handshake path with regression tests — closely matches what the review is asking for. Your tests also model the post-truncation max offset and assert the return value and the READY/TRANSFER state, which is stronger than what #11617 has. - The one piece missing here is the controlled recovery path requested in point 2 of the review on this PR. #11617 carries a default-off `enableTruncateBelowConfirmOffset` flag; I'd be glad to port it over, and to implement it as the one-shot authorization you proposed (bound to the expected history/offset, withdrawn after the authorized truncation) rather than a plain boolean. If that direction works for you, I'd be glad to take the override plus the operator documentation (which replica to operate on, what data is relinquished, how the authorization is withdrawn), and to re-run the two-store end-to-end scenario on the consolidated branch — including the original 3280 -> 1580 reproduction — so you can stay focused on the latch and the handshake-path tests. But please feel free to repartition; I'm happy to pick up whatever is most useful. I'll close #11617 once we've aligned. Of course, if you see the consolidation differently, I'm happy to adjust — the main thing I'd like to avoid is two parallel patches for the same issue. Thanks also to @ShannonDing — the finding is common to the approach rather than specific to either implementation, which is what made the consolidation obvious. Just a heads-up so you don't need to review two iterations of essentially the same patch; we'll come back with a single branch and the test results. -- 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]
