diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-10-26 11:40:05 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-10-26 12:31:55 +0000 |
commit | 4184bb24b0e5cead726f204457d34103ee6d3234 (patch) | |
tree | bc86eab3c84b149d176c3cfffb779960fae5848b | |
parent | a4a89613e7e3c919eadb646c3e7f15ba4b28722c (diff) |
Use document::Bucket in ideal state operation.
13 files changed, 77 insertions, 54 deletions
diff --git a/storage/src/tests/distributor/bucketstateoperationtest.cpp b/storage/src/tests/distributor/bucketstateoperationtest.cpp index 32fbea1be7d..216a051be15 100644 --- a/storage/src/tests/distributor/bucketstateoperationtest.cpp +++ b/storage/src/tests/distributor/bucketstateoperationtest.cpp @@ -4,6 +4,9 @@ #include <tests/distributor/distributortestutil.h> #include <vespa/storage/distributor/operations/idealstate/setbucketstateoperation.h> #include <vespa/storage/distributor/distributor.h> +#include <vespa/document/test/make_document_bucket.h> + +using document::test::makeDocumentBucket; namespace storage { @@ -59,7 +62,7 @@ BucketStateOperationTest::testActivateSingleNode() document::BucketId bid(16, 1); insertBucketInfo(bid, 0, 0xabc, 10, 1100, true, false); - BucketAndNodes bucketAndNodes(bid, toVector<uint16_t>(0)); + BucketAndNodes bucketAndNodes(makeDocumentBucket(bid), toVector<uint16_t>(0)); std::vector<uint16_t> active; active.push_back(0); SetBucketStateOperation op("storage", bucketAndNodes, active); @@ -100,7 +103,7 @@ BucketStateOperationTest::testActivateAndDeactivateNodes() insertBucketInfo(bid, 0, 0xabc, 10, 1100, false, true); insertBucketInfo(bid, 1, 0xdef, 15, 1500, false, false); - BucketAndNodes bucketAndNodes(bid, toVector<uint16_t>(0, 1)); + BucketAndNodes bucketAndNodes(makeDocumentBucket(bid), toVector<uint16_t>(0, 1)); std::vector<uint16_t> active; active.push_back(1); SetBucketStateOperation op("storage", bucketAndNodes, active); @@ -165,7 +168,7 @@ BucketStateOperationTest::testDoNotDeactivateIfActivateFails() insertBucketInfo(bid, 0, 0xabc, 10, 1100, false, true); insertBucketInfo(bid, 1, 0xdef, 15, 1500, false, false); - BucketAndNodes bucketAndNodes(bid, toVector<uint16_t>(0, 1)); + BucketAndNodes bucketAndNodes(makeDocumentBucket(bid), toVector<uint16_t>(0, 1)); std::vector<uint16_t> active; active.push_back(1); SetBucketStateOperation op("storage", bucketAndNodes, active); @@ -214,7 +217,7 @@ BucketStateOperationTest::testBucketDbNotUpdatedOnFailure() document::BucketId bid(16, 1); insertBucketInfo(bid, 0, 0xabc, 10, 1100, true, false); - BucketAndNodes bucketAndNodes(bid, toVector<uint16_t>(0)); + BucketAndNodes bucketAndNodes(makeDocumentBucket(bid), toVector<uint16_t>(0)); std::vector<uint16_t> active; active.push_back(0); SetBucketStateOperation op("storage", bucketAndNodes, active); diff --git a/storage/src/tests/distributor/garbagecollectiontest.cpp b/storage/src/tests/distributor/garbagecollectiontest.cpp index 7a0ba75a988..f65fa4b0cd3 100644 --- a/storage/src/tests/distributor/garbagecollectiontest.cpp +++ b/storage/src/tests/distributor/garbagecollectiontest.cpp @@ -6,6 +6,9 @@ #include <vespa/storage/distributor/idealstatemanager.h> #include <tests/distributor/distributortestutil.h> #include <vespa/storage/distributor/distributor.h> +#include <vespa/document/test/make_document_bucket.h> + +using document::test::makeDocumentBucket; namespace storage { namespace distributor { @@ -39,7 +42,7 @@ GarbageCollectionOperationTest::testSimple() getConfig().setGarbageCollection("music.date < 34", 3600); GarbageCollectionOperation op("storage", - BucketAndNodes(document::BucketId(16, 1), + BucketAndNodes(makeDocumentBucket(document::BucketId(16, 1)), toVector<uint16_t>(0, 1))); op.setIdealStateManager(&getIdealStateManager()); diff --git a/storage/src/tests/distributor/idealstatemanagertest.cpp b/storage/src/tests/distributor/idealstatemanagertest.cpp index d4d7a00a2df..4f9d8bdf4d4 100644 --- a/storage/src/tests/distributor/idealstatemanagertest.cpp +++ b/storage/src/tests/distributor/idealstatemanagertest.cpp @@ -143,9 +143,9 @@ IdealStateManagerTest::testClearActiveOnNodeDown() } CPPUNIT_ASSERT_EQUAL( - std::string("setbucketstate to [0] BucketId(0x4000000000000001) (pri 100)\n" - "setbucketstate to [0] BucketId(0x4000000000000002) (pri 100)\n" - "setbucketstate to [0] BucketId(0x4000000000000003) (pri 100)\n"), + std::string("setbucketstate to [0] Bucket(BucketSpace(0x0000000000000000), BucketId(0x4000000000000001)) (pri 100)\n" + "setbucketstate to [0] Bucket(BucketSpace(0x0000000000000000), BucketId(0x4000000000000002)) (pri 100)\n" + "setbucketstate to [0] Bucket(BucketSpace(0x0000000000000000), BucketId(0x4000000000000003)) (pri 100)\n"), _distributor->getActiveIdealStateOperations()); setSystemState(lib::ClusterState("distributor:1 storage:3 .0.s:d")); @@ -169,19 +169,19 @@ IdealStateManagerTest::testRecheckWhenActive() tick(); CPPUNIT_ASSERT_EQUAL( - std::string("setbucketstate to [0] BucketId(0x4000000000000001) (pri 100)\n"), + std::string("setbucketstate to [0] Bucket(BucketSpace(0x0000000000000000), BucketId(0x4000000000000001)) (pri 100)\n"), _distributor->getActiveIdealStateOperations()); tick(); CPPUNIT_ASSERT_EQUAL( - std::string("setbucketstate to [0] BucketId(0x4000000000000001) (pri 100)\n"), + std::string("setbucketstate to [0] Bucket(BucketSpace(0x0000000000000000), BucketId(0x4000000000000001)) (pri 100)\n"), _distributor->getActiveIdealStateOperations()); tick(); CPPUNIT_ASSERT_EQUAL( - std::string("setbucketstate to [0] BucketId(0x4000000000000001) (pri 100)\n"), + std::string("setbucketstate to [0] Bucket(BucketSpace(0x0000000000000000), BucketId(0x4000000000000001)) (pri 100)\n"), _distributor->getActiveIdealStateOperations()); } @@ -208,14 +208,14 @@ IdealStateManagerTest::testBlockIdealStateOpsOnFullRequestBucketInfo() { RemoveBucketOperation op("storage", - BucketAndNodes(bid, toVector<uint16_t>(3, 4))); + BucketAndNodes(makeDocumentBucket(bid), toVector<uint16_t>(3, 4))); CPPUNIT_ASSERT(op.isBlocked(tracker)); } { // Don't trigger on requests to other nodes. RemoveBucketOperation op("storage", - BucketAndNodes(bid, toVector<uint16_t>(3, 5))); + BucketAndNodes(makeDocumentBucket(bid), toVector<uint16_t>(3, 5))); CPPUNIT_ASSERT(!op.isBlocked(tracker)); } @@ -230,7 +230,7 @@ IdealStateManagerTest::testBlockIdealStateOpsOnFullRequestBucketInfo() { RemoveBucketOperation op("storage", - BucketAndNodes(bid, toVector<uint16_t>(7))); + BucketAndNodes(makeDocumentBucket(bid), toVector<uint16_t>(7))); CPPUNIT_ASSERT(!op.isBlocked(tracker)); } } @@ -251,7 +251,7 @@ IdealStateManagerTest::testBlockCheckForAllOperationsToSpecificBucket() } { RemoveBucketOperation op("storage", - BucketAndNodes(bid, toVector<uint16_t>(7))); + BucketAndNodes(makeDocumentBucket(bid), toVector<uint16_t>(7))); // Not blocked for exact node match. CPPUNIT_ASSERT(!op.checkBlock(bid, tracker)); // But blocked for bucket match! diff --git a/storage/src/tests/distributor/joinbuckettest.cpp b/storage/src/tests/distributor/joinbuckettest.cpp index 8b9a929d429..e0275214c34 100644 --- a/storage/src/tests/distributor/joinbuckettest.cpp +++ b/storage/src/tests/distributor/joinbuckettest.cpp @@ -4,6 +4,9 @@ #include <vespa/storage/distributor/operations/idealstate/joinoperation.h> #include <vespa/storage/distributor/distributor.h> #include <tests/distributor/distributortestutil.h> +#include <vespa/document/test/make_document_bucket.h> + +using document::test::makeDocumentBucket; namespace storage { namespace distributor { @@ -48,7 +51,7 @@ JoinOperationTest::testSimple() _distributor->enableClusterState(lib::ClusterState("distributor:1 storage:1")); JoinOperation op("storage", - BucketAndNodes(document::BucketId(32, 0), + BucketAndNodes(makeDocumentBucket(document::BucketId(32, 0)), toVector<uint16_t>(0)), toVector(document::BucketId(33, 1), document::BucketId(33, 0x100000001))); @@ -109,7 +112,7 @@ JoinOperationTest::sendSparseJoinsToNodesWithoutBothSourceBuckets() lib::ClusterState("distributor:1 storage:2")); JoinOperation op("storage", - BucketAndNodes(document::BucketId(32, 0), + BucketAndNodes(makeDocumentBucket(document::BucketId(32, 0)), toVector<uint16_t>(0, 1)), toVector(document::BucketId(33, 1), document::BucketId(33, 0x100000001))); diff --git a/storage/src/tests/distributor/mergeoperationtest.cpp b/storage/src/tests/distributor/mergeoperationtest.cpp index f1db60a5ef4..7ca58ba54f3 100644 --- a/storage/src/tests/distributor/mergeoperationtest.cpp +++ b/storage/src/tests/distributor/mergeoperationtest.cpp @@ -72,7 +72,7 @@ MergeOperationTest::testSimple() _distributor->enableClusterState(lib::ClusterState("distributor:1 storage:3")); - MergeOperation op(BucketAndNodes(document::BucketId(16, 1), + MergeOperation op(BucketAndNodes(makeDocumentBucket(document::BucketId(16, 1)), toVector<uint16_t>(0, 1, 2))); op.setIdealStateManager(&getIdealStateManager()); op.start(_sender, framework::MilliSecTime(0)); @@ -105,7 +105,7 @@ MergeOperationTest::testFailIfSourceOnlyCopiesChanged() _distributor->enableClusterState(lib::ClusterState("distributor:1 storage:3")); - MergeOperation op(BucketAndNodes(document::BucketId(16, 1), + MergeOperation op(BucketAndNodes(makeDocumentBucket(document::BucketId(16, 1)), toVector<uint16_t>(0, 1, 2))); op.setIdealStateManager(&getIdealStateManager()); op.start(_sender, framework::MilliSecTime(0)); @@ -307,7 +307,7 @@ MergeOperationTest::doNotRemoveCopiesWithPendingMessages() { "1=20/1/1," "2=10/1/1/t"); - MergeOperation op(BucketAndNodes(bucket, + MergeOperation op(BucketAndNodes(makeDocumentBucket(bucket), toVector<uint16_t>(0, 1, 2))); op.setIdealStateManager(&getIdealStateManager()); op.start(_sender, framework::MilliSecTime(0)); @@ -369,7 +369,7 @@ MergeOperationTest::allow_deleting_active_source_only_replica() _distributor->enableClusterState( lib::ClusterState("distributor:1 storage:3")); - MergeOperation op(BucketAndNodes(document::BucketId(16, 1), + MergeOperation op(BucketAndNodes(makeDocumentBucket(document::BucketId(16, 1)), toVector<uint16_t>(0, 1, 2))); op.setIdealStateManager(&getIdealStateManager()); op.start(_sender, framework::MilliSecTime(0)); @@ -486,7 +486,7 @@ void MergeOperationTest::merge_operation_is_blocked_by_any_busy_target_node() { getClock().setAbsoluteTimeInSeconds(10); addNodesToBucketDB(document::BucketId(16, 1), "0=10/1/1/t,1=20/1/1,2=10/1/1/t"); _distributor->enableClusterState(lib::ClusterState("distributor:1 storage:3")); - MergeOperation op(BucketAndNodes(document::BucketId(16, 1), toVector<uint16_t>(0, 1, 2))); + MergeOperation op(BucketAndNodes(makeDocumentBucket(document::BucketId(16, 1)), toVector<uint16_t>(0, 1, 2))); op.setIdealStateManager(&getIdealStateManager()); // Should not block on nodes _not_ included in operation node set diff --git a/storage/src/tests/distributor/removebucketoperationtest.cpp b/storage/src/tests/distributor/removebucketoperationtest.cpp index d9f6518d694..f289d374509 100644 --- a/storage/src/tests/distributor/removebucketoperationtest.cpp +++ b/storage/src/tests/distributor/removebucketoperationtest.cpp @@ -7,6 +7,9 @@ #include <vespa/storage/distributor/idealstatemanager.h> #include <vespa/storage/distributor/distributor.h> #include <tests/distributor/distributortestutil.h> +#include <vespa/document/test/make_document_bucket.h> + +using document::test::makeDocumentBucket; namespace storage { namespace distributor { @@ -48,7 +51,7 @@ RemoveBucketOperationTest::testSimple() _distributor->enableClusterState(lib::ClusterState("distributor:1 storage:3")); RemoveBucketOperation op("storage", - BucketAndNodes(document::BucketId(16, 1), + BucketAndNodes(makeDocumentBucket(document::BucketId(16, 1)), toVector<uint16_t>(1,2))); op.setIdealStateManager(&getIdealStateManager()); op.start(_sender, framework::MilliSecTime(0)); @@ -85,7 +88,7 @@ RemoveBucketOperationTest::testBucketInfoMismatchFailure() _distributor->enableClusterState(lib::ClusterState("distributor:1 storage:2")); RemoveBucketOperation op("storage", - BucketAndNodes(document::BucketId(16, 1), + BucketAndNodes(makeDocumentBucket(document::BucketId(16, 1)), toVector<uint16_t>(1))); op.setIdealStateManager(&getIdealStateManager()); op.start(_sender, framework::MilliSecTime(0)); @@ -126,7 +129,7 @@ RemoveBucketOperationTest::testFailWithInvalidBucketInfo() _distributor->enableClusterState(lib::ClusterState("distributor:1 storage:2")); RemoveBucketOperation op("storage", - BucketAndNodes(document::BucketId(16, 1), + BucketAndNodes(makeDocumentBucket(document::BucketId(16, 1)), toVector<uint16_t>(1))); op.setIdealStateManager(&getIdealStateManager()); op.start(_sender, framework::MilliSecTime(0)); diff --git a/storage/src/tests/distributor/splitbuckettest.cpp b/storage/src/tests/distributor/splitbuckettest.cpp index 2caf8f106f1..47452aac391 100644 --- a/storage/src/tests/distributor/splitbuckettest.cpp +++ b/storage/src/tests/distributor/splitbuckettest.cpp @@ -76,7 +76,7 @@ SplitOperationTest::testSimple() tooLargeBucketSize, 250); SplitOperation op("storage", - BucketAndNodes(document::BucketId(16, 1), + BucketAndNodes(makeDocumentBucket(document::BucketId(16, 1)), toVector<uint16_t>(0)), maxSplitBits, splitCount, @@ -156,7 +156,7 @@ SplitOperationTest::testMultiNodeFailure() SplitOperation op("storage", - BucketAndNodes(document::BucketId(16, 1), + BucketAndNodes(makeDocumentBucket(document::BucketId(16, 1)), toVector<uint16_t>(0,1)), maxSplitBits, splitCount, @@ -256,7 +256,7 @@ SplitOperationTest::testCopyTrustedStatusNotCarriedOverAfterSplit() "2=550/60/70000"); SplitOperation op("storage", - BucketAndNodes(sourceBucket, toVector<uint16_t>(0, 1)), + BucketAndNodes(makeDocumentBucket(sourceBucket), toVector<uint16_t>(0, 1)), maxSplitBits, splitCount, splitByteSize); @@ -329,7 +329,7 @@ SplitOperationTest::testOperationBlockedByPendingJoin() insertBucketInfo(joinTarget, 0, 0xabc, 1000, 1234, 250); SplitOperation op("storage", - BucketAndNodes(joinTarget, toVector<uint16_t>(0)), + BucketAndNodes(makeDocumentBucket(joinTarget), toVector<uint16_t>(0)), maxSplitBits, splitCount, splitByteSize); diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.cpp index 2315c7ab745..09ea3566883 100644 --- a/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.cpp @@ -35,21 +35,28 @@ IdealStateOperation::~IdealStateOperation() { } -BucketAndNodes::BucketAndNodes(const document::BucketId& id, uint16_t node) - : _id(id) +BucketAndNodes::BucketAndNodes(const document::Bucket &bucket, uint16_t node) + : _bucket(bucket) { _nodes.push_back(node); } -BucketAndNodes::BucketAndNodes(const document::BucketId& id, +BucketAndNodes::BucketAndNodes(const document::Bucket &bucket, const std::vector<uint16_t>& nodes) - : _id(id), + : _bucket(bucket), _nodes(nodes) { assert(!nodes.empty()); std::sort(_nodes.begin(), _nodes.end()); } +void +BucketAndNodes::setBucketId(const document::BucketId &id) +{ + document::Bucket newBucket(_bucket.getBucketSpace(), id); + _bucket = newBucket; +} + std::string BucketAndNodes::toString() const { @@ -65,7 +72,7 @@ BucketAndNodes::toString() const } ost << "] "; - ost << _id; + ost << _bucket.toString(); return ost.str(); } diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.h b/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.h index e0d96296b83..52f65d8781b 100644 --- a/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.h +++ b/storage/src/vespa/storage/distributor/operations/idealstate/idealstateoperation.h @@ -32,7 +32,7 @@ public: @param id Target bucket @param node Target node */ - BucketAndNodes(const document::BucketId& id, uint16_t node); + BucketAndNodes(const document::Bucket &id, uint16_t node); /** Constructor for operations with multiple target nodes. @@ -40,7 +40,7 @@ public: @param id Target bucket @param nodes Target nodes */ - BucketAndNodes(const document::BucketId& id, + BucketAndNodes(const document::Bucket &id, const std::vector<uint16_t>& nodes); /** @@ -48,16 +48,16 @@ public: @param id The new target bucket */ - void setBucketId(const document::BucketId& id) { _id = id; } + void setBucketId(const document::BucketId &id); /** Returns the target bucket. @return Returns the target bucket. */ - const document::BucketId& getBucketId() const { return _id; } + document::BucketId getBucketId() const { return _bucket.getBucketId(); } - document::Bucket getBucket() const { return document::Bucket(document::BucketSpace::placeHolder(), _id); } + document::Bucket getBucket() const { return _bucket; } /** Returns the target nodes @@ -81,7 +81,7 @@ public: std::string toString() const; private: - document::BucketId _id; + document::Bucket _bucket; std::vector<uint16_t> _nodes; }; @@ -142,7 +142,7 @@ public: @return The target bucket. */ - const document::BucketId& getBucketId() const { return _bucketAndNodes.getBucketId(); } + document::BucketId getBucketId() const { return _bucketAndNodes.getBucketId(); } document::Bucket getBucket() const { return _bucketAndNodes.getBucket(); } diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp index 1b161b2c5f7..e889dbe279b 100644 --- a/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp @@ -228,7 +228,7 @@ MergeOperation::deleteSourceOnlyNodes( _removeOperation.reset( new RemoveBucketOperation( _manager->getDistributorComponent().getClusterName(), - BucketAndNodes(getBucketId(), sourceOnlyNodes))); + BucketAndNodes(getBucket(), sourceOnlyNodes))); // Must not send removes to source only copies if something has caused // pending load to the copy after the merge was sent! if (_removeOperation->isBlocked(sender.getPendingMessageTracker())) { diff --git a/storage/src/vespa/storage/distributor/statechecker.h b/storage/src/vespa/storage/distributor/statechecker.h index a8e198427f7..fbadd5642d4 100644 --- a/storage/src/vespa/storage/distributor/statechecker.h +++ b/storage/src/vespa/storage/distributor/statechecker.h @@ -82,6 +82,8 @@ public: return siblingEntry; } + document::Bucket getBucket() const { return document::Bucket(document::BucketSpace::placeHolder(), bucketId); } + std::string toString() const; }; diff --git a/storage/src/vespa/storage/distributor/statecheckers.cpp b/storage/src/vespa/storage/distributor/statecheckers.cpp index 701a147a56f..35d111a8c38 100644 --- a/storage/src/vespa/storage/distributor/statecheckers.cpp +++ b/storage/src/vespa/storage/distributor/statecheckers.cpp @@ -15,6 +15,8 @@ #include <vespa/log/log.h> LOG_SETUP(".distributor.operation.checkers"); +using document::BucketSpace; + namespace storage { namespace distributor { @@ -84,7 +86,7 @@ SplitBucketStateChecker::generateMinimumBucketSplitOperation( { IdealStateOperation::UP so(new SplitOperation( c.component.getClusterName(), - BucketAndNodes(c.bucketId, c.entry->getNodes()), + BucketAndNodes(c.getBucket(), c.entry->getNodes()), c.distributorConfig.getMinimalBucketSplit(), 0, 0)); @@ -103,7 +105,7 @@ SplitBucketStateChecker::generateMaxSizeExceededSplitOperation( { IdealStateOperation::UP so(new SplitOperation( c.component.getClusterName(), - BucketAndNodes(c.bucketId, c.entry->getNodes()), + BucketAndNodes(c.getBucket(), c.entry->getNodes()), 58, c.distributorConfig.getSplitCount(), c.distributorConfig.getSplitSize())); @@ -420,7 +422,7 @@ bucketHasMultipleChildren(const document::BucketId& bucket, } -document::BucketId +document::Bucket JoinBucketsStateChecker::computeJoinBucket(const Context& c) const { // Always decrease by at least 1 bit, as we could not get here unless this @@ -443,7 +445,7 @@ JoinBucketsStateChecker::computeJoinBucket(const Context& c) const --level; target = candidate; } - return target; + return document::Bucket(BucketSpace::placeHolder(), target); } StateChecker::Result @@ -455,8 +457,8 @@ JoinBucketsStateChecker::check(StateChecker::Context& c) return Result::noMaintenanceNeeded(); } - document::BucketId joinedBucket(computeJoinBucket(c)); - assert(joinedBucket.getUsedBits() < c.bucketId.getUsedBits()); + document::Bucket joinedBucket(computeJoinBucket(c)); + assert(joinedBucket.getBucketId().getUsedBits() < c.bucketId.getUsedBits()); std::vector<document::BucketId> sourceBuckets; if (c.getSiblingEntry().valid()) { @@ -572,7 +574,7 @@ SplitInconsistentStateChecker::check(StateChecker::Context& c) IdealStateOperation::UP op(new SplitOperation( c.component.getClusterName(), - BucketAndNodes(c.bucketId, c.entry->getNodes()), + BucketAndNodes(c.getBucket(), c.entry->getNodes()), getHighestUsedBits(c.entries), 0, 0)); @@ -842,7 +844,7 @@ SynchronizeAndMoveStateChecker::check(StateChecker::Context& c) if (result.shouldMerge()) { IdealStateOperation::UP op( - new MergeOperation(BucketAndNodes(c.bucketId, result.nodes()), + new MergeOperation(BucketAndNodes(c.getBucket(), result.nodes()), c.distributorConfig.getMaxNodesPerMerge())); op->setPriority(result.priority()); op->setDetailedReason(result.reason()); @@ -986,7 +988,7 @@ DeleteExtraCopiesStateChecker::check(StateChecker::Context& c) if (!removedCopies.empty()) { IdealStateOperation::UP ro(new RemoveBucketOperation( c.component.getClusterName(), - BucketAndNodes(c.bucketId, removedCopies))); + BucketAndNodes(c.getBucket(), removedCopies))); ro->setPriority(c.distributorConfig.getMaintenancePriorities() .deleteBucketCopy); @@ -1087,7 +1089,7 @@ BucketStateStateChecker::check(StateChecker::Context& c) } auto op = std::make_unique<SetBucketStateOperation>( c.component.getClusterName(), - BucketAndNodes(c.bucketId, operationNodes), + BucketAndNodes(c.getBucket(), operationNodes), activeNodeIndexes); // If activeNodes > 1, we're dealing with a active-per-leaf group case and @@ -1127,7 +1129,7 @@ GarbageCollectionStateChecker::check(Context& c) IdealStateOperation::UP op( new GarbageCollectionOperation( c.component.getClusterName(), - BucketAndNodes(c.bucketId, c.entry->getNodes()))); + BucketAndNodes(c.getBucket(), c.entry->getNodes()))); vespalib::asciistream reason; reason << "[Needs garbage collection: Last check at " diff --git a/storage/src/vespa/storage/distributor/statecheckers.h b/storage/src/vespa/storage/distributor/statecheckers.h index f474d75a6b6..4f72d31aac5 100644 --- a/storage/src/vespa/storage/distributor/statecheckers.h +++ b/storage/src/vespa/storage/distributor/statecheckers.h @@ -56,7 +56,7 @@ private: bool smallEnoughToJoin(const Context& c) const; bool singleBucketJoinIsEnabled(const Context&) const; bool singleBucketJoinIsConsistent(const Context& c) const; - document::BucketId computeJoinBucket(const Context& c) const; + document::Bucket computeJoinBucket(const Context& c) const; }; class SplitBucketStateChecker : public StateChecker |