Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/25151 )
Change subject: IMPALA-13399: Don't take the stub lock in subscriber RPC handlers ...................................................................... IMPALA-13399: Don't take the stub lock in subscriber RPC handlers With statestored HA, the standby statestored asks every subscriber in its heartbeats for the state of the connection with the active statestored. StatestoreSubscriber::Heartbeat() answers with GetStatestoreConnState() of the other StatestoreStub, which takes that stub's lock_. RecoveryModeChecker() holds this lock for its whole re-registration loop. So while the active statestored is down and the subscribers try to re-register with it, the heartbeats of the standby statestored time out, and it unregisters every subscriber, catalogds included. When it takes over, it designates the catalogd that re-registers first, which can switch the active catalogd. It also keeps the standby statestored from learning that the subscribers lost the active one, which delays the takeover; which matches the heartbeat timeouts the statestored HA tests saw. GetStatestoreConnState() and IncCountForUpdateStatestoredRoleRPC() no longer take lock_. The failure detector has its own lock, and the counter is atomic. The stale "Not thread safe" comments of the failure detectors are fixed. Testing: - Added test_standby_heartbeats_during_subscriber_recovery. It keeps the standby statestored from taking over for 90 s after the active one is killed. Without the fix the standby statestored unregistered the subscribers; with the fix it passed. - Ran test_statestored_ha.py and test_catalogd_ha.py with the core exploration strategy, and all tests passed. Change-Id: I4dfcf768b2b5ebde9e37bd0950e90de383ad8681 Assisted-by: Claude Opus 5.5 (Claude Code) Reviewed-on: http://gerrit.cloudera.org:8080/25151 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- M be/src/statestore/failure-detector.h M be/src/statestore/statestore-subscriber.cc M tests/custom_cluster/test_statestored_ha.py 3 files changed, 40 insertions(+), 4 deletions(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/25151 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4dfcf768b2b5ebde9e37bd0950e90de383ad8681 Gerrit-Change-Number: 25151 Gerrit-PatchSet: 5 Gerrit-Owner: Petr Fedchenkov <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Peter Rozsa <[email protected]> Gerrit-Reviewer: Petr Fedchenkov <[email protected]> Gerrit-Reviewer: Yida Wu <[email protected]>
