The GitHub Actions job "Pull Requests" on 
pekko.git/fix-3697-coordinator-lease-loss-region has succeeded.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
66be68d4b1b9980e515f53e39b2127e0c5afa6e3 / 虎鸣 <[email protected]>
fix: keep the local ShardRegion alive when the coordinator singleton lease is 
lost

Motivation:
When the shard coordinator singleton's lease is lost, ClusterSingletonManager
sends ShardCoordinator.Internal.Terminate and re-acquires the lease, intending
to carry on. But terminate() unconditionally treated this as a node shutdown:
it gracefully shut down the local ShardRegion and deferred its own stop until
the region terminated. The node was still Up, yet its local region was gone
and never recreated, because ClusterSharding caches the region ref. A transient
lease-backend blip permanently disabled that shard type on that node.

Modification:
In ShardCoordinator.terminate(), only take the drain-local-region path when
this node is actually leaving the cluster or shutting down (CoordinatedShutdown
reason present, cluster terminated, or self member Leaving/Exiting/Down).
Otherwise stop only the coordinator; the local region stays alive and
re-registers with the restarted coordinator. Document the coordinator lease
behavior and add ClusterShardingCoordinatorLeaseLossSpec reproducing the
scenario from the issue.

Result:
A coordinator singleton lease loss restarts the coordinator without killing
the local ShardRegion; entities on the node keep being served.

Tests:
- sbt "cluster-sharding / Test / testOnly 
org.apache.pekko.cluster.sharding.ClusterShardingCoordinatorLeaseLossSpec": 
passed (848ms)
- Reverted the fix and re-ran: failed as expected, region dead after re-acquire 
(directional)
- sbt "cluster-sharding / Test / testOnly ...ClusterShardingInternalsSpec 
...HandOffStopperSpec ...DDataClusterShardingLeaseSpec": 8/8 passed

References:
Fixes #3697

Report URL: https://github.com/apache/pekko/actions/runs/40115884716

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to