Commit 11b3aa4
committed
fix(dynamodb): address 3-axis review of the GlobalTable auto-scaling fix
Blocker: step 6b confined itself to the two never-registered dimensions
via a STATIC filter, handing table-level write and cross-region read
back to their existing diff gates. Those gates are exactly the ones
the backfill argument says never fire on a pre-fix table (an unchanged
replica is not even visited by diffReplicas), so the static filter
permanently excluded two dimensions from the fix it was part of. 6b now
covers all four; double-application is avoided with a DYNAMIC skip-set
of what earlier steps applied during THIS update, so a dimension whose
gate declined is still backfilled.
Cost: re-asserting every target on every deploy is
2 x (1 + N_gsi x (1 + N_replica)) serial calls -- over a hundred round
trips on a 20-GSI, 3-replica table. Presence is now probed with one
batched DescribeScalableTargets per region and an already-present,
unchanged target is skipped. A failed probe means presence is unknown
and everything is upserted, which is the correct direction to fail.
Silent gap under load: every error in this path is swallowed into a
WARN, so an un-retried ThrottlingException would leave a target
unregistered without a trace -- the same never-registered gap, recreated
by the burst this change introduces. RegisterScalableTarget and
PutScalingPolicy now carry a throttle-only retry.
Create-side leak: the partial-create cleanup deletes the table directly
rather than routing through delete(), so a target registered before a
LATER wiring step failed was orphaned with no table left to name it.
Registration is now the last wiring step and is wrapped so a
best-effort concern can never destroy a successfully created table.
Cross-region teardown leak: index names came from the replica's own
GlobalSecondaryIndexes, which AWS may omit for a replica that inherits
throughput (ProvisionedThroughputOverride is documented "if not
described, uses the source table's"). Index names are identical across
replicas, so the table's list is the correct source.
Index readiness: a GSI added by the same deploy leaves the TABLE ACTIVE
while the index is still CREATING, and application-autoscaling rejects
a target whose resource is not ready. Step 6b waits for index
readiness first -- best-effort, since a miss self-heals on the next
deploy but a throw would fail a deploy whose resources are correct.
Also: dropped a dangling duplicate JSDoc block and corrected two
comments that still claimed SeedCapacity-before-MinCapacity.
Tests: +6. The identical-on-both-sides roundtrip test encoded the OLD
contract (unchanged template means no calls) and is replaced by two
tests pinning the new one -- no-op when registered, BACKFILL when not.
New coverage for the create-side ordering, the create-side guard, the
cross-region index teardown, ObjectNotFound suppression, and the
table-level seed context (which no fixture in the tree pinned).
Integ: the fixture GSI's read capacity becomes autoscaled so the fourth
dimension gets real-AWS coverage (minCapacity 7 keeps step 4b's
existing assertion intact), the table-level write gains a seedCapacity
differing from its min so #1435 is discriminating at table level too,
and step 16a2 asserts all four dimensions are deregistered rather than
just the index write one.1 parent 3d42ff0 commit 11b3aa4
7 files changed
Lines changed: 619 additions & 135 deletions
File tree
- docs
- src/provisioning/providers
- tests
- integration/dynamodb-globaltable
- lib
- unit/provisioning
Large diffs are not rendered by default.
Lines changed: 337 additions & 99 deletions
Large diffs are not rendered by default.
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
| 177 | + | |
171 | 178 | | |
172 | 179 | | |
173 | 180 | | |
| |||
176 | 183 | | |
177 | 184 | | |
178 | 185 | | |
179 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
180 | 198 | | |
181 | 199 | | |
182 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
289 | 315 | | |
290 | 316 | | |
291 | 317 | | |
| |||
587 | 613 | | |
588 | 614 | | |
589 | 615 | | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
601 | 637 | | |
602 | 638 | | |
603 | 639 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
263 | 292 | | |
264 | 293 | | |
265 | 294 | | |
| |||
Lines changed: 117 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
3 | 8 | | |
4 | 9 | | |
5 | 10 | | |
| |||
327 | 332 | | |
328 | 333 | | |
329 | 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 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
330 | 393 | | |
331 | 394 | | |
332 | 395 | | |
| |||
481 | 544 | | |
482 | 545 | | |
483 | 546 | | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
484 | 600 | | |
485 | 601 | | |
486 | 602 | | |
| |||
0 commit comments