Commit 05a2412
authored
feat(shard-distributor): integrate dynamic config for spectator (#7722)
**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?**
- Unit tests: `go test -v ./common/membership -run
TestShardDistributorResolver`
- All tests pass with the exported constants
**Potential risks**
- API change: Exported previously private ModeKey type and constants
(ModeKeyHashRing, ModeKeyShardDistributor,
ModeKeyHashRingShadowShardDistributor,
ModeKeyShardDistributorShadowHashRing). This is backwards compatible as
it only adds public visibility without breaking existing code.
- Behavior change: Spectator now dynamically responds to config changes
rather than using a static configuration
**Release notes**
N/A - internal improvement to spectator configuration handling
**Documentation Changes**
N/A
---------
Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>1 parent 078daf9 commit 05a2412
File tree
3 files changed
+25
-16
lines changed- cmd/server/cadence
- common/membership
3 files changed
+25
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
187 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
90 | | - | |
91 | | - | |
| 94 | + | |
| 95 | + | |
92 | 96 | | |
93 | | - | |
| 97 | + | |
94 | 98 | | |
95 | | - | |
| 99 | + | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| |||
108 | 112 | | |
109 | 113 | | |
110 | 114 | | |
111 | | - | |
| 115 | + | |
112 | 116 | | |
113 | 117 | | |
114 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
0 commit comments