Hello Yida Wu, Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

    https://gerrit.cloudera.org/25154

to look at the new patch set (#11).

Change subject: IMPALA-15597: Keep the active catalogd when a statestored 
restarts
......................................................................

IMPALA-15597: Keep the active catalogd when a statestored restarts

With statestored and catalogd HA, each statestored designates the active
catalogd from the registrations it receives. A restarted statestored
does not know which catalogd is active, so it designates the first
catalogd that registers, or the one with the higher priority if both
register within --catalogd_ha_preemption_wait_period_ms. Once it becomes
active, it sends UpdateCatalogd with its own choice and the active
catalogd switches, although the active catalogd was healthy. The new
active catalogd may reset its metadata, and DDLs in flight meet a
catalogd failover.

This patch makes the active catalogd register with force_catalogd_active
when it registers with a new statestored instance (a new statestore ID
in the GetProtocolVersion response), unless it follows no statestored as
active or the one it follows is unreachable, in which case it may have
been demoted without knowing it. A re-registration with the same
statestored instance, for example after a pause or a network partition,
never claims the role. The hidden flag
--catalogd_ha_keep_active_on_reregistration (default true) turns this
off.

If the preemption window expires before the active catalogd registers,
the statestored designates the other catalogd without knowledge of the
active one, and a claim that arrives late must not flip that designation
back: the statestored tracks that the assignment was made by the window
expiry and keeps it, and the late claimer becomes the standby. Claims
within the window and the operator force flag on a live statestored are
unaffected.

Testing:
 - Added test_active_catalogd_kept_after_statestored_restart. It failed
   with --catalogd_ha_keep_active_on_reregistration=false (the active
   catalogd switched) and passed 4 times with the fix.
 - Added test_late_claim_ignored_after_preemption_window (by the review
   of Yida Wu). It passed 3 times with the fix.
 - Ran test_statestored_ha.py and test_catalogd_ha.py with the core
   exploration strategy, and all tests passed.

Change-Id: Ifb71b578950086ec38e7bf1102c73024749efb85
Assisted-by: Claude Opus 5.5 (Claude Code)
---
M be/src/catalog/catalog-server.cc
M be/src/statestore/statestore-catalogd-mgr.cc
M be/src/statestore/statestore-catalogd-mgr.h
M be/src/statestore/statestore-subscriber-catalog.cc
M be/src/statestore/statestore-subscriber-catalog.h
M be/src/statestore/statestore-subscriber.cc
M be/src/statestore/statestore-subscriber.h
M tests/custom_cluster/test_catalogd_ha.py
M tests/custom_cluster/test_statestored_ha.py
9 files changed, 185 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/54/25154/11
--
To view, visit https://gerrit.cloudera.org/25154
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ifb71b578950086ec38e7bf1102c73024749efb85
Gerrit-Change-Number: 25154
Gerrit-PatchSet: 11
Gerrit-Owner: Petr Fedchenkov <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>

Reply via email to