You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Petr Fedchenkov (Code Review)" <ge...@cloudera.org> on 2026/10/20 12:30:27 UTC
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Petr Fedchenkov has uploaded this change for review. ( http://gerrit.cloudera.org:8080/25152
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.
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.
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, 108 insertions(+), 9 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/52/25152/1
--
To view, visit http://gerrit.cloudera.org:8080/25152
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 1
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Petr Fedchenkov (Code Review)" <ge...@cloudera.org>.
Petr Fedchenkov has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 8:
Done in patch set 8 — both abort tests now set --minidump_path={minidumps} with tmp_dir_placeholders=["minidumps"], same as test_workload_mgmt_init. Thanks for tracking down the console output.
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 8
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 06 Nov 2026 07:51:28 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 6:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/24832/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 6
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Wed, 04 Nov 2026 06:41:45 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 2:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/24607/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
To view, visit http://gerrit.cloudera.org:8080/25152
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 2
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Tue, 20 Oct 2026 13:15:56 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 7: Code-Review+2
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 7
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 06 Nov 2026 00:02:19 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 6: Code-Review+1
Thanks Petr, it looks good to me.
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 6
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Wed, 04 Nov 2026 12:01:21 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 5:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/24810/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 5
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 03 Nov 2026 09:37:13 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Wenzhe Zhou (Code Review)" <ge...@cloudera.org>.
Wenzhe Zhou has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 6: Code-Review+2
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 6
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 05 Nov 2026 22:42:39 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Petr Fedchenkov (Code Review)" <ge...@cloudera.org>.
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 (#6).
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, 150 insertions(+), 9 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/52/25152/6
--
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: 6
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 7:
The gerrit-verify-dryrun failed due to the new added test test_same_statestored_address_twice crashes in https://jenkins.impala.io/job/ubuntu-20.04-from-scratch/10913/testReport/junit/generate_junitxml/finalize/minidumpsv2/.
Could you please make some change to these two test cases to have the --minidump_path set like below? Looks like Jenkins would look for the minudumps in the current path and would consider it as a failure.
https://github.com/apache/impala/blob/master/tests/custom_cluster/test_workload_mgmt_init.py#L560-L578
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 7
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 06 Nov 2026 07:29:44 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Petr Fedchenkov (Code Review)" <ge...@cloudera.org>.
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 (#5).
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.
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.
- Verified that a subscriber whose statestored addresses point to the
same statestored aborts at startup.
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, 128 insertions(+), 9 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/52/25152/5
--
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: 5
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Petr Fedchenkov (Code Review)" <ge...@cloudera.org>.
Petr Fedchenkov has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 6:
Thanks Yida! Patch set 6 addresses the three comments: the skipped-statestored
message is now LOG(INFO) like the matching site at the end of
UpdateStatestoredRole(), the same-statestored registration check follows
--statestore_subscriber_ha_role_checks like the other role checks (the
identical-address check in the constructor stays unconditional), and your two
abort tests are added verbatim. The new tests passed three runs, and
test_subscriber_started_while_first_statestored_down plus the other HA tests of
test_statestored_ha.py still pass.
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 6
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Wed, 04 Nov 2026 06:13:53 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 7: Verified-1
Build failed: https://jenkins.impala.io/job/gerrit-verify-dryrun/14407/
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 7
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 06 Nov 2026 04:54:32 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Petr Fedchenkov (Code Review)" <ge...@cloudera.org>.
Petr Fedchenkov has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 7:
gerrit-verify-dryrun
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 7
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 06 Nov 2026 05:41:52 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 9: Verified+1
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 9
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 06 Nov 2026 13:05:31 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 8:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/24865/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 8
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 06 Nov 2026 08:16:47 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 1:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/24602/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
To view, visit http://gerrit.cloudera.org:8080/25152
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 1
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Tue, 20 Oct 2026 12:56:34 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has submitted this change and it was merged. ( https://gerrit.cloudera.org/25152 )
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)
Reviewed-on: https://gerrit.cloudera.org/25152
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Yida Wu <wy...@gmail.com>
---
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(-)
Approvals:
Impala Public Jenkins: Verified
Yida Wu: Looks good to me, approved
--
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: merged
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 10
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 9: Code-Review+2
Carry +2
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 9
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 06 Nov 2026 13:08:10 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 4:
(1 comment)
https://gerrit.cloudera.org/#/c/25152/4/be/src/statestore/statestore-subscriber.cc
File be/src/statestore/statestore-subscriber.cc:
https://gerrit.cloudera.org/#/c/25152/4/be/src/statestore/statestore-subscriber.cc@959
PS4, Line 959: // The two stubs never hold the same non-zero statestore id.
I think the two stubs can hold the same statestore id with some misconfiguration. For example:
bin/start-impala-cluster.py --enable_statestored_ha --per_impalad_args="-state_store_2_port=24000"
Impalad then has localhost:24000 for both statestored addresses, so both stubs get statestored 0's ID, because 24000 is the port of statestored 0.
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 4
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 03 Nov 2026 07:35:55 +0000
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 7:
Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/14407/ DRY_RUN=false
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 7
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 06 Nov 2026 00:02:20 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 5: Code-Review+1
(3 comments)
https://gerrit.cloudera.org/#/c/25152/5/be/src/statestore/statestore-subscriber.cc
File be/src/statestore/statestore-subscriber.cc:
https://gerrit.cloudera.org/#/c/25152/5/be/src/statestore/statestore-subscriber.cc@521
PS5, Line 521: VLOG(1)
It seems should be fine using LOG(INFO) like other logs around?
https://gerrit.cloudera.org/#/c/25152/5/be/src/statestore/statestore-subscriber.cc@763
PS5, Line 763: if (status.ok() && response.__isset.statestore_id) {
Would it be better to check with HaRoleChecks() for this too?
https://gerrit.cloudera.org/#/c/25152/5/tests/custom_cluster/test_statestored_ha.py
File tests/custom_cluster/test_statestored_ha.py:
https://gerrit.cloudera.org/#/c/25152/5/tests/custom_cluster/test_statestored_ha.py@972
PS5, Line 972:
How about adding these two tests for abort cases with same address?
@pytest.mark.execute_serially
@CustomClusterTestSuite.with_args(
statestored_args="--use_network_address_as_statestore_priority=true",
start_args="--enable_statestored_ha --per_impalad_args=-state_store_2_port=24000",
expect_startup_fail=True)
def test_same_statestored_address_twice(self):
"""Both statestored addresses of an impalad are localhost:24000, the address of
statestoreds[0]. The impalad aborts at startup."""
self.assert_impalad_log_contains("FATAL",
"Both configured statestored addresses are localhost:24000")
@pytest.mark.execute_serially
@CustomClusterTestSuite.with_args(
statestored_args="--use_network_address_as_statestore_priority=true",
impalad_args="--state_store_2_host=127.0.0.1",
start_args="--enable_statestored_ha --per_impalad_args=-state_store_2_port=24000",
expect_startup_fail=True)
def test_same_statestored_through_alias(self):
"""The statestored addresses of an impalad are localhost:24000 and 127.0.0.1:24000,
two addresses of statestoreds[0]. The impalad aborts when it registers."""
self.assert_impalad_log_contains("FATAL", "Registered with the same statestored")
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 5
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 03 Nov 2026 23:48:18 +0000
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 4:
(1 comment)
https://gerrit.cloudera.org/#/c/25152/4/tests/custom_cluster/test_statestored_ha.py
File tests/custom_cluster/test_statestored_ha.py:
https://gerrit.cloudera.org/#/c/25152/4/tests/custom_cluster/test_statestored_ha.py@967
PS4, Line 967: sleep(5)
How about we replace the sleep with a real signal:
self.assert_log_contains(impalad_log, "INFO",
"Reconnected to statestore. Exiting recovery mode", expected_count=1,
timeout_s=30)
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 4
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 03 Nov 2026 08:45:03 +0000
Gerrit-HasComments: Yes
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Petr Fedchenkov (Code Review)" <ge...@cloudera.org>.
Petr Fedchenkov has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 5:
Thanks Yida, you are right. With that flag combination both stubs register with
statestored 0 and get the same statestore id, and both registration responses report
the same statestored as active, which trips the DCHECK in Start() in a debug build
(in a release build IsStubFor() then matches neither stub and the first registration
starves in recovery loops).
Patch set 5 rejects the misconfiguration: the subscriber aborts at construction when
the two statestored addresses are identical, and a registration response that carries
a statestore id already held by the other stub aborts the subscriber, which also
covers addresses that differ but lead to the same statestored, like localhost and
127.0.0.1. I verified both aborts with your example and with aliased hostnames; the
HA tests of test_statestored_ha.py still pass.
The sleep in test_subscriber_started_while_first_statestored_down is replaced with
the log wait you suggested.
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 5
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 03 Nov 2026 09:13:32 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 9:
Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/14409/ DRY_RUN=false
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 9
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 06 Nov 2026 08:23:10 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Petr Fedchenkov (Code Review)" <ge...@cloudera.org>.
Petr Fedchenkov has posted comments on this change. ( https://gerrit.cloudera.org/25152 )
Change subject: IMPALA-15596: Match a statestored ID exactly before the wildcard
......................................................................
Patch Set 7:
Thanks for the +2! The dryrun failed, but three unrelated changes failed the same job in the same window, so this looks like Jenkins-side trouble, not the patch (the rebase itself is clean). Could you check the 14407 console and re-run the precommit when convenient?
--
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: comment
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 7
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 06 Nov 2026 06:21:44 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Petr Fedchenkov (Code Review)" <ge...@cloudera.org>.
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 <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
[Impala-ASF-CR] IMPALA-15596: Match a statestored ID exactly before the wildcard
Posted by "Petr Fedchenkov (Code Review)" <ge...@cloudera.org>.
Hello Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/25152
to look at the new patch set (#2).
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.
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.
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, 108 insertions(+), 9 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/52/25152/2
--
To view, visit http://gerrit.cloudera.org:8080/25152
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ieeacdaccd4ab58c37337f8413cbd4e27637c743e
Gerrit-Change-Number: 25152
Gerrit-PatchSet: 2
Gerrit-Owner: Petr Fedchenkov <gi...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>