Commit 44a8a09
fix(testcontainers): wait for vshard storages to complete handshake before declaring cluster ready
VshardClusterConfigurator#configure() previously declared the cluster
ready after three checks: router is up, vshard.router.bootstrap() returns
cleanly, and crud._VERSION is reachable on the router. None of these
verifies that individual storages have completed the vshard handshake
during the initial rebalance; the router can answer 'bootstrap ok' while
some storages are still in the VHANDSHAKE_NOT_COMPLETE (code 40) state,
and a CRUD request that targets such a storage fails immediately.
Observed in tests-crud-integration (3.5.0):
TarantoolTemplateViaJavaConfigTest.testKVTemplateDeleteEntities
-> CrudException: Failed to truncate for storage-002
VHANDSHAKE_NOT_COMPLETE, 'Handshake with storage-002-a have not
been completed yet'
Add a fourth readiness step: waitUntilVshardStoragesAreReady polls
vshard.router.info() until every replica in every replicaset is in
status='available' and there are no unreachable buckets, with a 120s
budget. This guarantees that any subsequent CRUD request hits a fully
handshaked storage.
Verified locally on 3.5.0:
- TarantoolCrudClientTest: 347/347 PASS (was failing with
VHANDSHAKE_NOT_COMPLETE in CI)
- TarantoolTemplateViaJavaConfigTest (spring-data27, the originally
failing test): 35/35 PASS
This is a testcontainers/infra change; it is added to the same PR as
the pooling fixups because both were investigated together after the
box-integration deadlocks were resolved.1 parent c76d799 commit 44a8a09
2 files changed
Lines changed: 55 additions & 0 deletions
File tree
- testcontainers/src/main/java/org/testcontainers/containers/cluster/vshard
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
| |||
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
| 95 | + | |
85 | 96 | | |
86 | 97 | | |
87 | 98 | | |
| |||
557 | 568 | | |
558 | 569 | | |
559 | 570 | | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
560 | 588 | | |
561 | 589 | | |
562 | 590 | | |
| |||
629 | 657 | | |
630 | 658 | | |
631 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
632 | 685 | | |
633 | 686 | | |
634 | 687 | | |
| |||
0 commit comments