You are viewing a plain text version of this content. The canonical link for it is here.
Posted to builds@fluss.apache.org by GitBox <gi...@apache.org> on 2026/09/28 10:56:57 UTC
[GH] (fluss/fix/coordinator-pending-leader-activation-metadata-race): Workflow run "Check License" failed!
The GitHub Actions job "Check License" on fluss.git/fix/coordinator-pending-leader-activation-metadata-race has failed.
Run started by GitHub user damokelis (triggered by damokelis).
Head commit for run:
68c98ddeac5c5e4f232b77a8e36e9e080d0d16f8 / moke-HU <25...@qq.com>
Withhold leader from UpdateMetadataRequest until NotifyLeaderAndIsr is acked
The coordinator maintains two independently-updated views of replica
state: TabletServerMetadataCache (pushed via UpdateMetadataRequest,
determines what leader info clients see) and ReplicaManager.allReplicas
(activated via NotifyLeaderAndIsrRequest, determines whether a tablet
server can actually serve fetchLog/putKv for a bucket). These are sent
as two separate RPCs with no atomicity guarantee between them.
Under normal conditions the window between "coordinator decided who
the leader is" and "the target tablet server has admitted the replica"
is milliseconds and rarely observable. For large tables, however, a
restarting tablet server can take minutes to complete local log
recovery before it processes NotifyLeaderAndIsrRequest, while
UpdateMetadataRequest can be broadcast well before that. A client that
picks up the new leader from metadata during this window sends
requests to a server whose ReplicaManager still treats the bucket as
NoneReplica, and is rejected with NotLeaderOrFollowerException /
LeaderNotAvailableException in a tight retry loop until the server
finally catches up (observed: single-digit minutes to over ten minutes
for a large 12-bucket table).
This wires the existing (previously read-only, health-API-only)
pendingLeaderActivationBuckets tracking into
addUpdateMetadataRequestForTabletServers: a bucket's leader is
withheld from UpdateMetadataRequest for as long as it is marked
pending, and the mark is only cleared once the corresponding
NotifyLeaderAndIsrRequest is acked by the target server (or the
replica goes offline via re-election). sendNotifyLeaderAndIsrRequest
already runs strictly before sendUpdateMetadataRequest in the same
batch, so the pending mark set for an activation round is always
visible to the accompanying metadata push.
One subtlety worth calling out: an earlier iteration of this change
also cleared the pending mark when the NotifyLeaderAndIsrRequest RPC
itself failed to send (e.g. target server not yet reachable during a
rolling restart), reasoning that this avoided a stale RED in the
health API. That turned out to reintroduce the exact race being fixed
here, just triggered by RPC failure instead of by slow log recovery:
clearing the mark let the leader be advertised to clients while the
target server's ReplicaManager had never actually admitted the
replica. The fix keeps the mark untouched on send failure; it is only
cleared by a real ack, or by onReplicaBecomeOffline during
heartbeat-timeout-triggered re-election (this offline-cleanup path is
also new here, since a bucket whose NotifyLeaderAndIsrRequest comes
back with a per-bucket error never reaches the ack path and would
otherwise be stuck pending forever).
Also fixes a plain Map.put overwrite in
addUpdateMetadataRequestForTabletServers (case3/4/10/11) that silently
discards already-queued non-empty bucket data for the same table
within one UpdateMetadataRequest batch, by logging when it happens
instead of leaving it silent.
Tested: mvn -pl fluss-server -am test
(org.apache.fluss.server.coordinator.**), 352/353 passing; the sole
unrelated failure (CoordinatorServerITCase#testRunServerUsingProcess)
reproduces identically on an unmodified checkout and is a local
environment issue with spawning a separate JVM process, not a
regression from this change.
Reproduced and verified against a real cluster: rolling-restarted
three tablet servers hosting a large table (including one requiring
~11 minutes of local log recovery), with a tiering client continuously
reading from the affected buckets throughout. Before this fix,
NotLeaderOrFollowerException/LeaderNotAvailableException recurred for
minutes after all tablet servers reported Ready. After this fix, the
client's cumulative error count did not increase at all across the
full rolling-restart window plus an additional 10-minute observation
period.
Report URL: https://github.com/apache/fluss/actions/runs/33248789822
With regards,
GitHub Actions via GitBox