diff options
author | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2021-06-09 13:15:38 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2021-06-09 13:15:38 +0000 |
commit | 29a607c45f0cd8e373df995589743d233075a1fe (patch) | |
tree | 3ff40e7aac766c94b04c3371fb50115644df978a /storage/src/tests/distributor/distributortest.cpp | |
parent | 3b5aba3a7223924498d651f8257170e35ee79825 (diff) |
Block ideal state ops when a pending cluster state is present
Since distributor stripes no longer have access to the top-level
pending message tracking info, it's no longer possible to infer if
a pending cluster state is happening by looking at the sent messages.
Instead, do this more generally (and efficiently) by looking at the
potential pending cluster state directly.
Rewire the `isBlocked` logic to take in an operation context instead
of just a `PendingMessageTracker`, giving it access to a lot more
relevant information.
Diffstat (limited to 'storage/src/tests/distributor/distributortest.cpp')
-rw-r--r-- | storage/src/tests/distributor/distributortest.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/storage/src/tests/distributor/distributortest.cpp b/storage/src/tests/distributor/distributortest.cpp index 3d1c6165946..9c3686d3614 100644 --- a/storage/src/tests/distributor/distributortest.cpp +++ b/storage/src/tests/distributor/distributortest.cpp @@ -222,7 +222,6 @@ struct DistributorTest : Test, DistributorTestUtil { } void configureMaxClusterClockSkew(int seconds); - void sendDownClusterStateCommand(); void replyToSingleRequestBucketInfoCommandWith1Bucket(); void sendDownDummyRemoveCommand(); void assertSingleBouncedRemoveReplyPresent(); @@ -795,12 +794,6 @@ auto make_dummy_get_command_for_bucket_1() { } -void DistributorTest::sendDownClusterStateCommand() { - lib::ClusterState newState("bits:1 storage:1 distributor:1"); - auto stateCmd = std::make_shared<api::SetSystemStateCommand>(newState); - _distributor->handleMessage(stateCmd); -} - void DistributorTest::replyToSingleRequestBucketInfoCommandWith1Bucket() { ASSERT_EQ(_bucketSpaces.size(), _sender.commands().size()); for (uint32_t i = 0; i < _sender.commands().size(); ++i) { @@ -847,7 +840,7 @@ TEST_F(DistributorTest, configured_safe_time_point_rejection_works_end_to_end) { getClock().setAbsoluteTimeInSeconds(1000); configureMaxClusterClockSkew(10); - sendDownClusterStateCommand(); + receive_set_system_state_command("bits:1 storage:1 distributor:1"); ASSERT_NO_FATAL_FAILURE(replyToSingleRequestBucketInfoCommandWith1Bucket()); // SetSystemStateCommand sent down chain at this point. sendDownDummyRemoveCommand(); |