From 29a607c45f0cd8e373df995589743d233075a1fe Mon Sep 17 00:00:00 2001 From: Tor Brede Vekterli Date: Wed, 9 Jun 2021 13:15:38 +0000 Subject: 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. --- storage/src/tests/distributor/distributortest.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'storage/src/tests/distributor/distributortest.cpp') 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(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(); -- cgit v1.2.3