diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2020-11-03 15:15:20 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2020-11-03 15:59:45 +0100 |
commit | 288daaf3cee2deac1a40fc996450856ac4322396 (patch) | |
tree | abc7d4de2f89cefd2ae143f25dd9003f1531f8b3 /storage/src/tests/distributor/statecheckerstest.cpp | |
parent | b5cd73513c0a8c701829edc572de5095897c818b (diff) |
Remove diskstate from vdslib.
Diffstat (limited to 'storage/src/tests/distributor/statecheckerstest.cpp')
-rw-r--r-- | storage/src/tests/distributor/statecheckerstest.cpp | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/storage/src/tests/distributor/statecheckerstest.cpp b/storage/src/tests/distributor/statecheckerstest.cpp index fa7afd39cf3..cbe1c93a4ba 100644 --- a/storage/src/tests/distributor/statecheckerstest.cpp +++ b/storage/src/tests/distributor/statecheckerstest.cpp @@ -503,80 +503,6 @@ StateCheckersTest::enableInconsistentJoinInConfig(bool enabled) getConfig().configure(config); } -TEST_F(StateCheckersTest, allow_inconsistent_join_in_differing_sibling_ideal_state) { - // Normally, bucket siblings have an ideal state on the same node in order - // to enable joining these back together. However, the ideal disks assigned - // may differ and it's sufficient for a sibling bucket's ideal disk to be - // down on the node of its other sibling for it to be assigned a different - // node. In this case, there's no other way to get buckets joined back - // together than if we allow bucket replicas to get temporarily out of sync - // by _forcing_ a join across all replicas no matter their placement. - // This will trigger a merge to reconcile and move the new bucket copies to - // their ideal location. - setupDistributor(2, 3, "distributor:1 storage:3 .0.d:20 .0.d.14.s:d .2.d:20"); - document::BucketId sibling1(33, 0x000000001); // ideal disk 14 on node 0 - document::BucketId sibling2(33, 0x100000001); // ideal disk 1 on node 0 - - // Full node sequence sorted by score for sibling(1|2) is [0, 2, 1]. - // Node 0 cannot be used, so use 1 instead. - assertCurrentIdealState(sibling1, {2, 1}); - assertCurrentIdealState(sibling2, {0, 2}); - - insertBucketInfo(sibling1, 2, 0x1, 2, 3); - insertBucketInfo(sibling1, 1, 0x1, 2, 3); - insertBucketInfo(sibling2, 0, 0x1, 2, 3); - insertBucketInfo(sibling2, 2, 0x1, 2, 3); - - enableInconsistentJoinInConfig(true); - - EXPECT_EQ("BucketId(0x8000000000000001): " - "[Joining buckets BucketId(0x8400000000000001) and " - "BucketId(0x8400000100000001) because their size " - "(6 bytes, 4 docs) is less than the configured limit " - "of (100, 10)", - testJoin(10, 100, 16, sibling1)); -} - -TEST_F(StateCheckersTest, do_not_allow_inconsistent_join_when_not_in_ideal_state) { - setupDistributor(2, 4, "distributor:1 storage:4 .0.d:20 .0.d.14.s:d .2.d:20 .3.d:20"); - document::BucketId sibling1(33, 0x000000001); - document::BucketId sibling2(33, 0x100000001); - - assertCurrentIdealState(sibling1, {3, 2}); - assertCurrentIdealState(sibling2, {3, 0}); - - insertBucketInfo(sibling1, 3, 0x1, 2, 3); - insertBucketInfo(sibling1, 2, 0x1, 2, 3); - insertBucketInfo(sibling2, 3, 0x1, 2, 3); - insertBucketInfo(sibling2, 1, 0x1, 2, 3); // not in ideal state - - enableInconsistentJoinInConfig(true); - - EXPECT_EQ("NO OPERATIONS GENERATED", - testJoin(10, 100, 16, sibling1)); -} - -TEST_F(StateCheckersTest, do_not_allow_inconsistent_join_when_config_disabled) { - setupDistributor(2, 3, "distributor:1 storage:3 .0.d:20 .0.d.14.s:d .2.d:20"); - document::BucketId sibling1(33, 0x000000001); // ideal disk 14 on node 0 - document::BucketId sibling2(33, 0x100000001); // ideal disk 1 on node 0 - - // Full node sequence sorted by score for sibling(1|2) is [0, 2, 1]. - // Node 0 cannot be used, so use 1 instead. - assertCurrentIdealState(sibling1, {2, 1}); - assertCurrentIdealState(sibling2, {0, 2}); - - insertBucketInfo(sibling1, 2, 0x1, 2, 3); - insertBucketInfo(sibling1, 1, 0x1, 2, 3); - insertBucketInfo(sibling2, 0, 0x1, 2, 3); - insertBucketInfo(sibling2, 2, 0x1, 2, 3); - - enableInconsistentJoinInConfig(false); - - EXPECT_EQ("NO OPERATIONS GENERATED", - testJoin(10, 100, 16, sibling1)); -} - TEST_F(StateCheckersTest, no_join_when_invalid_copy_exists) { setupDistributor(3, 10, "distributor:1 storage:3"); |