Hello Yida Wu, Wenzhe Zhou, Michael Smith, Impala Public Jenkins,

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

    https://gerrit.cloudera.org/25152

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

Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................

IMPALA-15596: Match a statestored ID exactly before the wildcard

With statestored HA, a StatestoreStub that has not registered yet has a
zero statestore ID, and IsMatchingStatestoreId() treats a zero ID as a
match for any statestored. If a subscriber starts while its first
configured statestored is down, the unregistered stub of that
statestored takes the heartbeats and UpdateStatestoredRole RPCs of the
other one. The registered stub then misses its heartbeats, enters
recovery mode every subscriber timeout, and every recovery swaps the
active and standby statestoreds of the subscriber. While the subscriber
follows the standby statestored, it gets no topic or catalogd updates.

This patch applies the zero-ID wildcard only while a RegisterSubscriber
RPC of the stub is in flight, when an RPC can arrive before the
registration response. An exact ID match on the other stub wins over the
wildcard (IsStubFor()). The hidden flag
--statestore_subscriber_ha_role_checks (default true) turns the check
off. Without statestored HA nothing changes.

IsStubFor() also relies on the two stubs never holding the same non-zero
statestore ID, which holds for two different statestoreds but not for a
misconfiguration that points both statestored addresses to the same
statestored, e.g. a state_store_2 port that points to the first
statestored. Both registration responses then report the same
statestored as active, and IsStubFor() no longer matches either stub.
The subscriber now rejects this configuration: identical statestored
addresses abort at construction, and a registration response with a
statestore ID already held by the other stub aborts the subscriber,
which also covers different addresses that lead to the same statestored.
The registration check follows --statestore_subscriber_ha_role_checks
like the other role checks.

Testing:
 - Added test_subscriber_started_while_first_statestored_down. It
   failed with --statestore_subscriber_ha_role_checks=false (3 role
   swaps in 10 s) and passed 4 times with the fix.
 - Ran test_statestored_ha.py and test_catalogd_ha.py with the core
   exploration strategy, and all tests passed.
 - Added test_same_statestored_address_twice and
   test_same_statestored_through_alias (by Yida Wu). They abort the
   impalad at startup and at registration respectively.

Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Assisted-by: Claude Opus 5.5 (Claude Code)
---
M be/src/statestore/statestore-subscriber.cc
M be/src/statestore/statestore-subscriber.h
M tests/custom_cluster/test_statestored_ha.py
3 files changed, 154 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/52/25152/8
--
To view, visit https://gerrit.cloudera.org/25152
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 8
Gerrit-Owner: Petr Fedchenkov <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Petr Fedchenkov <[email protected]>
Gerrit-Reviewer: Wenzhe Zhou <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>

Reply via email to