aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeir Storli <geirstorli@yahoo.no>2017-11-01 11:25:01 +0100
committerGitHub <noreply@github.com>2017-11-01 11:25:01 +0100
commit46cfff0bd05b994b563648922f06d7edfe249230 (patch)
treeceecd0ac86b92f74808ffd397521a85bcc56b240
parentc4e121b78594bb81f894fcfff1cb1ab4b4b8edcb (diff)
parent4534bbaed47c73e13ac931793ef2ae0e8c102243 (diff)
Merge pull request #3959 from vespa-engine/geirst/use-bucket-space-from-storage-command-in-external-operations
Use bucket space from storage command in external operations.
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/putoperation.cpp6
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/putoperation.h1
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/removeoperation.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp6
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp2
6 files changed, 11 insertions, 8 deletions
diff --git a/storage/src/vespa/storage/distributor/operations/external/putoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/putoperation.cpp
index dafc2b71e6a..3faf979cc9c 100644
--- a/storage/src/vespa/storage/distributor/operations/external/putoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/putoperation.cpp
@@ -224,11 +224,12 @@ PutOperation::insertDatabaseEntryAndScheduleCreateBucket(
void
PutOperation::sendPutToBucketOnNode(
+ document::BucketSpace bucketSpace,
const document::BucketId& bucketId,
const uint16_t node,
std::vector<PersistenceMessageTracker::ToSend>& putBatch)
{
- document::Bucket bucket(BucketSpace::placeHolder(), bucketId);
+ document::Bucket bucket(bucketSpace, bucketId);
std::shared_ptr<api::PutCommand> command(
new api::PutCommand(
bucket,
@@ -318,7 +319,8 @@ PutOperation::onStart(DistributorMessageSender& sender)
// Now send PUTs
for (uint32_t i = 0; i < targets.size(); i++) {
const OperationTarget& target(targets[i]);
- sendPutToBucketOnNode(target.getBucketId(), target.getNode().getIndex(),
+ sendPutToBucketOnNode(_msg->getBucket().getBucketSpace(),
+ target.getBucketId(), target.getNode().getIndex(),
putBatch);
}
diff --git a/storage/src/vespa/storage/distributor/operations/external/putoperation.h b/storage/src/vespa/storage/distributor/operations/external/putoperation.h
index 69c53d4d594..191a0116031 100644
--- a/storage/src/vespa/storage/distributor/operations/external/putoperation.h
+++ b/storage/src/vespa/storage/distributor/operations/external/putoperation.h
@@ -63,6 +63,7 @@ private:
std::vector<MessageTracker::ToSend>& messagesToSend);
void sendPutToBucketOnNode(
+ document::BucketSpace bucketSpace,
const document::BucketId& bucketId,
const uint16_t node,
std::vector<PersistenceMessageTracker::ToSend>& putBatch);
diff --git a/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp
index 8f19dabea92..fdf7cf4860f 100644
--- a/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp
@@ -80,7 +80,7 @@ RemoveLocationOperation::onStart(DistributorMessageSender& sender)
std::shared_ptr<api::RemoveLocationCommand> command(
new api::RemoveLocationCommand(
_msg->getDocumentSelection(),
- document::Bucket(BucketSpace::placeHolder(), e.getBucketId())));
+ document::Bucket(_msg->getBucket().getBucketSpace(), e.getBucketId())));
copyMessageSettings(*_msg, *command);
_tracker.queueCommand(command, nodes[i]);
diff --git a/storage/src/vespa/storage/distributor/operations/external/removeoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/removeoperation.cpp
index 84df38efad6..d2af1f6f9c5 100644
--- a/storage/src/vespa/storage/distributor/operations/external/removeoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/removeoperation.cpp
@@ -46,7 +46,7 @@ RemoveOperation::onStart(DistributorMessageSender& sender)
for (uint32_t i = 0; i < e->getNodeCount(); i++) {
std::shared_ptr<api::RemoveCommand> command(new api::RemoveCommand(
- document::Bucket(BucketSpace::placeHolder(), e.getBucketId()),
+ document::Bucket(_msg->getBucket().getBucketSpace(), e.getBucketId()),
_msg->getDocumentId(),
_msg->getTimestamp()));
diff --git a/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp
index c05bddc83de..b586d5ffed9 100644
--- a/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/twophaseupdateoperation.cpp
@@ -181,7 +181,7 @@ TwoPhaseUpdateOperation::startSafePathUpdate(DistributorMessageSender& sender)
_updateCmd->getDocumentId().toString().c_str());
_mode = Mode::SLOW_PATH;
- document::Bucket bucket(BucketSpace::placeHolder(), document::BucketId(0));
+ document::Bucket bucket(_updateCmd->getBucket().getBucketSpace(), document::BucketId(0));
std::shared_ptr<api::GetCommand> get(
std::make_shared<api::GetCommand>(
bucket,
@@ -251,7 +251,7 @@ TwoPhaseUpdateOperation::schedulePutsWithUpdatedDocument(
sendLostOwnershipTransientErrorReply(sender);
return;
}
- document::Bucket bucket(BucketSpace::placeHolder(), document::BucketId(0));
+ document::Bucket bucket(_updateCmd->getBucket().getBucketSpace(), document::BucketId(0));
std::shared_ptr<api::PutCommand> put(
new api::PutCommand(bucket, doc, putTimestamp));
copyMessageSettings(*_updateCmd, *put);
@@ -339,7 +339,7 @@ TwoPhaseUpdateOperation::handleFastPathReceive(
_updateCmd->getDocumentId().toString().c_str());
_updateReply = intermediate._reply;
- document::Bucket bucket(BucketSpace::placeHolder(), bestNode.first);
+ document::Bucket bucket(_updateCmd->getBucket().getBucketSpace(), bestNode.first);
std::shared_ptr<api::GetCommand> cmd(
new api::GetCommand(bucket,
_updateCmd->getDocumentId(),
diff --git a/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp
index f2aca874691..89bff0d1382 100644
--- a/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp
@@ -91,7 +91,7 @@ UpdateOperation::onStart(DistributorMessageSender& sender)
for (uint32_t i = 0; i < nodes.size(); i++) {
std::shared_ptr<api::UpdateCommand> command(
- new api::UpdateCommand(document::Bucket(BucketSpace::placeHolder(), entries[j].getBucketId()),
+ new api::UpdateCommand(document::Bucket(_msg->getBucket().getBucketSpace(), entries[j].getBucketId()),
_msg->getUpdate(),
_msg->getTimestamp()));
copyMessageSettings(*_msg, *command);