feat(shard-distributor): integrate dynamic config for spectator#7722
feat(shard-distributor): integrate dynamic config for spectator#7722jakobht merged 3 commits intocadence-workflow:masterfrom
Conversation
- Added Enabled function to spectator params that checks MatchingShardDistributionMode - Exported ModeKey constants in membership package for reuse - Spectator now responds to dynamic config changes between hash_ring and shard_distributor modes Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>
Updated test file to use the new exported ModeKey constants after they were changed from private modeKey in the main implementation. Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>
Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>
🔍 CI failure analysis for ad70169: Two CI test failures detected - both appear to be flaky infrastructure issues unrelated to the PR's shard distributor changes.Failure 1: Cassandra Integration Tests - Cassandra Session ClosureIssueThe These errors occur during test execution when Cassandra persistence operations are attempted, indicating the database session was prematurely closed or lost. Root CauseThis failure is not related to the PR changes. The PR modifies shard distributor spectator initialization and membership resolver constants. These changes do not affect:
The "session has been closed" error typically indicates:
Failure 2: Replication Simulation (activeactive_same_wfid)IssueThe Root CauseThis failure is also not related to the PR changes. The PR does not modify replication logic, workflow ID conflict detection, or active-active cluster coordination. The test failed on both retry attempts, indicating a race condition or timing issue in the replication simulation test infrastructure. DetailsThe PR's modified files are:
None of these changes interact with Cassandra persistence, replication logic, or the code paths exercised by these failing tests. Code Review ✅ Approved 1 resolved / 1 findingsPrevious finding (spurious discarded call) has been fixed. The remaining changes cleanly export ModeKey type/constants and wire up dynamic spectator enablement — looks good. ✅ 1 resolved✅ Bug: Spurious discarded call to matchingShardDistributionMode()
Rules ❌ No requirements metRepository Rules
1 rule not applicable. Show all rules by commenting Tip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
What changed?
Integrated dynamic config check for spectator enablement and exported ModeKey constants in membership package
Why?
The spectator client needs to respond to dynamic config changes for MatchingShardDistributionMode. Previously, ModeKey constants were private in the membership package, preventing external packages from checking the current mode. This change exports the ModeKey type and constants, and adds an Enabled function to spectator params that dynamically checks if the mode is not hash_ring. This allows the spectator to automatically enable/disable based on the dynamic config without requiring restarts.
How did you test it?
go test -v ./common/membership -run TestShardDistributorResolverPotential risks
Release notes
N/A - internal improvement to spectator configuration handling
Documentation Changes
N/A