From f7399627037952e9c8f794f1cd7b1ddf7bd791f5 Mon Sep 17 00:00:00 2001 From: Firas Bouzazi Date: Sat, 25 Jul 2026 23:43:43 +0200 Subject: [PATCH] [test] Fix unstable testKvSnapshotLeaseAfterCoordinatorServerRestart 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 #3735 --- .../java/org/apache/fluss/client/admin/FlussAdminITCase.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fluss-client/src/test/java/org/apache/fluss/client/admin/FlussAdminITCase.java b/fluss-client/src/test/java/org/apache/fluss/client/admin/FlussAdminITCase.java index 150b84e567..1eb5c37c48 100644 --- a/fluss-client/src/test/java/org/apache/fluss/client/admin/FlussAdminITCase.java +++ b/fluss-client/src/test/java/org/apache/fluss/client/admin/FlussAdminITCase.java @@ -1175,7 +1175,6 @@ void testKvSnapshotLeaseAfterCoordinatorServerRestart() throws Exception { assertThat(zkClient.getKvSnapshotLeaseMetadata(lease.leaseId())).isPresent(); restartCoordinatorServer(zkClient); - FLUSS_CLUSTER_EXTENSION.waitUntilAllGatewayHasSameMetadata(); lease.dropLease().get(); assertThat(zkClient.getKvSnapshotLeaseMetadata(lease.leaseId())).isNotPresent(); @@ -1188,6 +1187,10 @@ private void restartCoordinatorServer(ZooKeeperClient zkClient) throws Exception Duration.ofMinutes(1), "Coordinator server node still exists in ZooKeeper"); FLUSS_CLUSTER_EXTENSION.startCoordinatorServer(); + // The retryable gateway proxy refreshes metadata from a tablet server and retries only + // once, so wait until the tablet servers have learned the new coordinator address before + // issuing the next lease request; the client itself still holds the stale address. + FLUSS_CLUSTER_EXTENSION.waitUntilAllGatewayHasSameMetadata(); } @Test