Commit bd42c7c
committed
multiregion: allow zone config extensions to remove read replicas
Previously, zone config extensions validated that num_replicas could
not be set lower than the total number of replicas required for the
database's survival goal (which includes both voters and non-voting
read replicas). This prevented users from removing read replicas to
reduce storage costs while maintaining the required number of voters
for the survival goal.
The survival goal only depends on the number of voting replicas
(num_voters), not the total number of replicas. Non-voting replicas
are used for follower reads and do not participate in Raft consensus
or affect availability guarantees.
This commit changes the validation in ExtendZoneConfigWithGlobal() and
ExtendZoneConfigWithRegionalIn() to check that num_replicas is not set
lower than num_voters instead of the total numReplicas. This allows
users to set num_replicas equal to num_voters, effectively removing
read replicas while maintaining the required voter count for their
survival goal.
For example, in a SURVIVE ZONE FAILURE database with 3 regions, users
can now reduce num_replicas from 5 (default: 3 voters + 2 read replicas)
to 3 (just the required voters), saving storage while maintaining zone
failure tolerance.
Also fixes a typo in the error message ("num_replica" -> "num_replicas").
Resolves: #105210
Release note (bug fix): Fixed a bug where zone config extensions
incorrectly prevented users from removing non-voting read replicas
from multi-region databases. Users can now set num_replicas equal to
num_voters to remove read replicas while maintaining the required
number of voting replicas for their database's survival goal. This
allows reducing storage costs without compromising availability
guarantees.1 parent 1a4ff79 commit bd42c7c
File tree
2 files changed
+109
-25
lines changed- pkg
- ccl/logictestccl/testdata/logic_test
- sql/catalog/multiregion
2 files changed
+109
-25
lines changedLines changed: 92 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | 190 | | |
194 | 191 | | |
195 | 192 | | |
196 | 193 | | |
197 | 194 | | |
198 | 195 | | |
199 | | - | |
200 | | - | |
201 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
202 | 199 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
207 | 204 | | |
208 | 205 | | |
209 | 206 | | |
| |||
215 | 212 | | |
216 | 213 | | |
217 | 214 | | |
218 | | - | |
| 215 | + | |
219 | 216 | | |
220 | 217 | | |
221 | 218 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | 219 | | |
226 | 220 | | |
227 | 221 | | |
| |||
242 | 236 | | |
243 | 237 | | |
244 | 238 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
253 | 247 | | |
254 | 248 | | |
255 | 249 | | |
| |||
0 commit comments