summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@oath.com>2017-10-23 12:14:19 +0000
committerTor Egge <Tor.Egge@oath.com>2017-10-23 12:14:19 +0000
commitc2105574acbf1694e83b4b43fa8200fb48eb79b2 (patch)
tree094e665bed23596671614b6b9131a11fabbe5677 /storage
parent116c78e48da8f099c32168c48f8fbde56a2f74a0 (diff)
Add bucket space to request bucket info command.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/bucketdb/bucketmanagertest.cpp20
-rw-r--r--storage/src/tests/distributor/idealstatemanagertest.cpp4
-rw-r--r--storage/src/vespa/storage/distributor/bucketdbupdater.cpp3
-rw-r--r--storage/src/vespa/storage/distributor/pendingclusterstate.cpp3
4 files changed, 19 insertions, 11 deletions
diff --git a/storage/src/tests/bucketdb/bucketmanagertest.cpp b/storage/src/tests/bucketdb/bucketmanagertest.cpp
index 98f3e06fc62..8cc046861be 100644
--- a/storage/src/tests/bucketdb/bucketmanagertest.cpp
+++ b/storage/src/tests/bucketdb/bucketmanagertest.cpp
@@ -15,6 +15,7 @@
#include <tests/common/dummystoragelink.h>
#include <tests/common/testhelper.h>
#include <vespa/document/test/make_document_bucket.h>
+#include <vespa/document/test/make_bucket_space.h>
#include <vespa/vdslib/state/random.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/testkit/testapp.h>
@@ -31,6 +32,7 @@ using config::FileSpec;
using document::DocumentType;
using document::DocumentTypeRepo;
using document::test::makeDocumentBucket;
+using document::test::makeBucketSpace;
namespace storage {
@@ -415,13 +417,13 @@ void BucketManagerTest::testRequestBucketInfoWithState()
// Send a request bucket info command that will be outdated and failed.
std::shared_ptr<api::RequestBucketInfoCommand> cmd1(
- new api::RequestBucketInfoCommand(0, states[1]));
+ new api::RequestBucketInfoCommand(makeBucketSpace(), 0, states[1]));
// Send two request bucket info commands that will be processed together
// when the bucket manager is idle, as states are equivalent
std::shared_ptr<api::RequestBucketInfoCommand> cmd2(
- new api::RequestBucketInfoCommand(0, states[2]));
+ new api::RequestBucketInfoCommand(makeBucketSpace(), 0, states[2]));
std::shared_ptr<api::RequestBucketInfoCommand> cmd3(
- new api::RequestBucketInfoCommand(0, states[3]));
+ new api::RequestBucketInfoCommand(makeBucketSpace(), 0, states[3]));
// Tag server initialized before starting
_top->open();
@@ -559,7 +561,7 @@ void BucketManagerTest::testRequestBucketInfoWithList()
bids.push_back(document::BucketId(16, 0xe8c8));
std::shared_ptr<api::RequestBucketInfoCommand> cmd(
- new api::RequestBucketInfoCommand(bids));
+ new api::RequestBucketInfoCommand(makeBucketSpace(), bids));
_top->sendDown(cmd);
_top->waitForMessages(1, 5);
@@ -729,11 +731,11 @@ public:
}
auto createFullFetchCommand() const {
- return std::make_shared<api::RequestBucketInfoCommand>(0, _state);
+ return std::make_shared<api::RequestBucketInfoCommand>(makeBucketSpace(), 0, _state);
}
auto createFullFetchCommandWithHash(vespalib::stringref hash) const {
- return std::make_shared<api::RequestBucketInfoCommand>(0, _state, hash);
+ return std::make_shared<api::RequestBucketInfoCommand>(makeBucketSpace(), 0, _state, hash);
}
auto acquireBucketLockAndSendInfoRequest(const document::BucketId& bucket) {
@@ -907,7 +909,7 @@ BucketManagerTest::testOrderRepliesAfterBucketSpecificRequest()
auto infoRoundtrip = std::async(std::launch::async, [&]() {
std::vector<document::BucketId> buckets{bucketA};
- auto infoCmd = std::make_shared<api::RequestBucketInfoCommand>(buckets);
+ auto infoCmd = std::make_shared<api::RequestBucketInfoCommand>(makeBucketSpace(), buckets);
// Can't complete until `guard` has been unlocked.
_top->sendDown(infoCmd);
// Barrier: bucket reply and subsequent split reply
@@ -947,7 +949,7 @@ BucketManagerTest::testQueuedRepliesOnlyDispatchedWhenAllProcessingDone()
auto singleBucketInfo = std::async(std::launch::async, [&]() {
std::vector<document::BucketId> buckets{bucketA};
- auto infoCmd = std::make_shared<api::RequestBucketInfoCommand>(buckets);
+ auto infoCmd = std::make_shared<api::RequestBucketInfoCommand>(makeBucketSpace(), buckets);
_top->sendDown(infoCmd);
_top->waitForMessages(3, MESSAGE_WAIT_TIME);
});
@@ -1209,7 +1211,7 @@ void
BucketManagerTest::sendSingleBucketInfoRequest(const document::BucketId& id)
{
std::vector<document::BucketId> buckets{id};
- auto infoCmd = std::make_shared<api::RequestBucketInfoCommand>(buckets);
+ auto infoCmd = std::make_shared<api::RequestBucketInfoCommand>(makeBucketSpace(), buckets);
_top->sendDown(infoCmd);
}
diff --git a/storage/src/tests/distributor/idealstatemanagertest.cpp b/storage/src/tests/distributor/idealstatemanagertest.cpp
index e48046fb4ac..fe7a03856c7 100644
--- a/storage/src/tests/distributor/idealstatemanagertest.cpp
+++ b/storage/src/tests/distributor/idealstatemanagertest.cpp
@@ -10,8 +10,10 @@
#include <vespa/storageapi/message/bucketsplitting.h>
#include <tests/distributor/distributortestutil.h>
#include <vespa/document/test/make_document_bucket.h>
+#include <vespa/document/test/make_bucket_space.h>
using document::test::makeDocumentBucket;
+using document::test::makeBucketSpace;
namespace storage {
namespace distributor {
@@ -198,7 +200,7 @@ IdealStateManagerTest::testBlockIdealStateOpsOnFullRequestBucketInfo()
// sent to the entire node. It will then use a null bucketid.
{
std::shared_ptr<api::RequestBucketInfoCommand> msg(
- new api::RequestBucketInfoCommand(buckets));
+ new api::RequestBucketInfoCommand(makeBucketSpace(), buckets));
msg->setAddress(
api::StorageMessageAddress("storage", lib::NodeType::STORAGE, 4));
tracker.insert(msg);
diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
index ce7f7afc670..2a056949f9a 100644
--- a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
+++ b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
@@ -14,6 +14,7 @@ LOG_SETUP(".distributor.bucketdb.updater");
using storage::lib::Node;
using storage::lib::NodeType;
+using document::BucketSpace;
namespace storage::distributor {
@@ -81,7 +82,7 @@ BucketDBUpdater::sendRequestBucketInfo(
buckets.push_back(bucket);
std::shared_ptr<api::RequestBucketInfoCommand> msg(
- new api::RequestBucketInfoCommand(buckets));
+ new api::RequestBucketInfoCommand(BucketSpace::placeHolder(), buckets));
LOG(debug,
"Sending request bucket info command %lu for "
diff --git a/storage/src/vespa/storage/distributor/pendingclusterstate.cpp b/storage/src/vespa/storage/distributor/pendingclusterstate.cpp
index bd14ded3710..9ad803b7b7f 100644
--- a/storage/src/vespa/storage/distributor/pendingclusterstate.cpp
+++ b/storage/src/vespa/storage/distributor/pendingclusterstate.cpp
@@ -10,6 +10,8 @@
#include <vespa/log/log.h>
LOG_SETUP(".pendingclusterstate");
+using document::BucketSpace;
+
namespace storage::distributor {
using lib::Node;
@@ -317,6 +319,7 @@ PendingClusterState::requestNode(uint16_t node)
std::shared_ptr<api::RequestBucketInfoCommand> cmd(
new api::RequestBucketInfoCommand(
+ BucketSpace::placeHolder(),
_sender.getDistributorIndex(),
_newClusterState,
distributionHash));