[test] Fix unstable testKvSnapshotLeaseAfterCoordinatorServerRestart - #3767
Open
firasbouzazi wants to merge 1 commit into
Open
[test] Fix unstable testKvSnapshotLeaseAfterCoordinatorServerRestart#3767firasbouzazi wants to merge 1 commit into
firasbouzazi wants to merge 1 commit into
Conversation
The retryable gateway proxy refreshes metadata from a tablet server and retries a failed RPC only once. After a coordinator restart, tablet servers learn the new coordinator address asynchronously via UpdateMetadataRequest, so a lease request issued before that propagation completes refreshes to the stale address and fails its single retry with a NetworkException. Wait until all gateways share the same metadata after every coordinator restart (previously only done before dropLease) so the retry always converges; the client still holds the stale cached address, keeping the retry path exercised. Fixes apache#3735
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FlussAdminITCase.testKvSnapshotLeaseAfterCoordinatorServerRestart(fixes issue [test] Unstable test FlussAdminITCase.testKvSnapshotLeaseAfterCoordinatorServerRestart #3735)RetryableGatewayClientProxyretries a failed lease RPC exactly once, after refreshing metadata from a tablet server. After a coordinator restart, tablet servers learn the new coordinator address asynchronously (viaUpdateMetadataRequestsent once the new coordinator's event processor initializes). If the client's refresh raced ahead of that propagation, it fetched the stale coordinator address, the single retry hit the dead port again, andNetworkException: Disconnected from node cs-0surfaced.waitUntilAllGatewayHasSameMetadata()into therestartCoordinatorServer()helper so every restart (previously only the third one, beforedropLease) waits for tablet servers to learn the new coordinator address before the next lease request. The test's intent is preserved: the client still holds the stale cached coordinator address, so the retry-with-metadata-refresh path is still exercised on every operation.Test Plan
FlussAdminITCase#testKvSnapshotLeaseAfterCoordinatorServerRestart6 consecutive times locally: 6/6 passed (previously failed intermittently in CI).🤖 AI-assisted changes - reviewed by human developer