aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@oath.com>2018-10-05 14:02:23 +0000
committerTor Brede Vekterli <vekterli@oath.com>2018-10-05 14:19:58 +0000
commit160b351839981ea8d7bcf2a0c2f8e25e04589c56 (patch)
tree44ad953ab6ef23efa34b69ea0ebf8e1b431d5b78 /storage
parentab9fca2196ab6a5c8d49d88cf8b539dab7195450 (diff)
Let CreateIterator inherit priority of parent visitor
Since CreateIterator now does more than just in-memory metadata work (i.e. it may hit the disk), it should not be given a fixed, very high priority.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/visiting/visitortest.cpp6
-rw-r--r--storage/src/vespa/storage/visiting/visitor.cpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/storage/src/tests/visiting/visitortest.cpp b/storage/src/tests/visiting/visitortest.cpp
index 4fc577226ca..11e5e355f0c 100644
--- a/storage/src/tests/visiting/visitortest.cpp
+++ b/storage/src/tests/visiting/visitortest.cpp
@@ -119,6 +119,8 @@ public:
}
};
+ constexpr static api::StorageMessage::Priority DefaultPriority = 123;
+
std::shared_ptr<api::CreateVisitorCommand> makeCreateVisitor(
const VisitorOptions& options = VisitorOptions());
void tearDown() override;
@@ -495,6 +497,7 @@ VisitorTest::makeCreateVisitor(const VisitorOptions& options)
cmd->setAddress(address);
cmd->setMaximumPendingReplyCount(UINT32_MAX);
cmd->setControlDestination("foo/bar");
+ cmd->setPriority(DefaultPriority);
return cmd;
}
@@ -519,7 +522,8 @@ VisitorTest::testNormalUsage()
CreateIteratorCommand::SP createCmd(
fetchSingleCommand<CreateIteratorCommand>(*_bottom));
- CPPUNIT_ASSERT_EQUAL(uint8_t(0), createCmd->getPriority()); // Highest pri
+ CPPUNIT_ASSERT_EQUAL(static_cast<int>(DefaultPriority),
+ static_cast<int>(createCmd->getPriority())); // Inherit pri
spi::IteratorId id(1234);
api::StorageReply::SP reply(
new CreateIteratorReply(*createCmd, id));
diff --git a/storage/src/vespa/storage/visiting/visitor.cpp b/storage/src/vespa/storage/visiting/visitor.cpp
index 2f028b5c9fa..60b94b6b33e 100644
--- a/storage/src/vespa/storage/visiting/visitor.cpp
+++ b/storage/src/vespa/storage/visiting/visitor.cpp
@@ -1257,7 +1257,7 @@ Visitor::getIterators()
cmd->setLoadType(_initiatingCmd->getLoadType());
cmd->getTrace().setLevel(_traceLevel);
- cmd->setPriority(0);
+ cmd->setPriority(_initiatingCmd->getPriority());
cmd->setReadConsistency(getRequiredReadConsistency());
_bucketStates.push_back(newBucketState.release());
_messageHandler->send(cmd, *this);