aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-08-19 14:09:04 +0200
committerGitHub <noreply@github.com>2019-08-19 14:09:04 +0200
commit326be83ad86b9f4924fa71cff10eb9cbfed2e96b (patch)
tree9d3d339e0afcab981d596e8ed77e01de747f5613 /storage
parenta031e6278de4952f070020859b127ad4b682ba03 (diff)
parent948b6509c3616d7267d4d2b9f445764bb806f2fb (diff)
Merge pull request #10313 from vespa-engine/balder/remove-doc-ids-part-3
doc: -> id:
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/bucketdb/bucketmanagertest.cpp6
-rw-r--r--storage/src/tests/distributor/getoperationtest.cpp54
-rw-r--r--storage/src/tests/distributor/pendingmessagetrackertest.cpp2
-rw-r--r--storage/src/tests/distributor/putoperationtest.cpp114
-rw-r--r--storage/src/tests/distributor/removeoperationtest.cpp29
-rw-r--r--storage/src/tests/distributor/twophaseupdateoperationtest.cpp129
-rw-r--r--storage/src/tests/distributor/updateoperationtest.cpp10
-rw-r--r--storage/src/tests/persistence/filestorage/filestormanagertest.cpp4
-rw-r--r--storage/src/tests/persistence/testandsettest.cpp14
-rw-r--r--storage/src/tests/storageserver/bouncertest.cpp4
-rw-r--r--storage/src/tests/storageserver/communicationmanagertest.cpp6
-rw-r--r--storage/src/tests/storageserver/documentapiconvertertest.cpp3
12 files changed, 171 insertions, 204 deletions
diff --git a/storage/src/tests/bucketdb/bucketmanagertest.cpp b/storage/src/tests/bucketdb/bucketmanagertest.cpp
index 11f5ec70014..ad46d494d11 100644
--- a/storage/src/tests/bucketdb/bucketmanagertest.cpp
+++ b/storage/src/tests/bucketdb/bucketmanagertest.cpp
@@ -171,10 +171,8 @@ void BucketManagerTest::setupTestEnvironment(bool fakePersistenceLayer,
_top->push_back(std::move(bottom));
}
// Generate a doc to use for testing..
- const DocumentType &type(*_node->getTypeRepo()
- ->getDocumentType("text/html"));
- _document = std::make_shared<document::Document>(
- type, document::DocumentId(document::DocIdString("test", "ntnu")));
+ const DocumentType &type(*_node->getTypeRepo()->getDocumentType("text/html"));
+ _document = std::make_shared<document::Document>(type, document::DocumentId("id:ns:text/html::ntnu"));
}
void BucketManagerTest::addBucketsToDB(uint32_t count)
diff --git a/storage/src/tests/distributor/getoperationtest.cpp b/storage/src/tests/distributor/getoperationtest.cpp
index 4b67cf1963d..7c308e152db 100644
--- a/storage/src/tests/distributor/getoperationtest.cpp
+++ b/storage/src/tests/distributor/getoperationtest.cpp
@@ -40,7 +40,7 @@ struct GetOperationTest : Test, DistributorTestUtil {
FileSpec("../config-doctypes.cfg"))));
createLinks();
- docId = document::DocumentId(document::DocIdString("test", "uri"));
+ docId = document::DocumentId("id:ns:text/html::uri");
bucketId = getExternalOperationHandler().getBucketId(docId);
};
@@ -133,7 +133,7 @@ TEST_F(GetOperationTest, simple) {
ASSERT_NO_FATAL_FAILURE(replyWithDocument());
- EXPECT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ EXPECT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 100) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -149,7 +149,7 @@ TEST_F(GetOperationTest, ask_trusted_node_if_bucket_is_inconsistent) {
ASSERT_NO_FATAL_FAILURE(replyWithDocument());
- EXPECT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ EXPECT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 100) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -166,7 +166,7 @@ TEST_F(GetOperationTest, ask_all_nodes_if_bucket_is_inconsistent) {
ASSERT_NO_FATAL_FAILURE(sendReply(0, api::ReturnCode::OK, "newauthor", 2));
ASSERT_NO_FATAL_FAILURE(sendReply(1, api::ReturnCode::OK, "oldauthor", 1));
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 2) ReturnCode(NONE)",
_sender.getLastReply());
@@ -185,7 +185,7 @@ TEST_F(GetOperationTest, send_to_all_invalid_copies) {
ASSERT_NO_FATAL_FAILURE(sendReply(0, api::ReturnCode::OK, "newauthor", 2));
ASSERT_NO_FATAL_FAILURE(sendReply(1, api::ReturnCode::OK, "oldauthor", 1));
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 2) ReturnCode(NONE)",
_sender.getLastReply());
@@ -207,7 +207,7 @@ TEST_F(GetOperationTest, send_to_all_invalid_nodes_when_inconsistent) {
ASSERT_NO_FATAL_FAILURE(sendReply(2, api::ReturnCode::OK, "oldauthor", 1));
ASSERT_NO_FATAL_FAILURE(sendReply(3, api::ReturnCode::OK, "oldauthor", 1));
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 2) ReturnCode(NONE)",
_sender.getLastReply());
@@ -217,8 +217,8 @@ TEST_F(GetOperationTest, send_to_all_invalid_nodes_when_inconsistent) {
TEST_F(GetOperationTest, inconsistent_split) {
setClusterState("distributor:1 storage:4");
- addNodesToBucketDB(document::BucketId(16, 0x2a52), "0=100");
- addNodesToBucketDB(document::BucketId(17, 0x2a52), "1=200");
+ addNodesToBucketDB(document::BucketId(16, 0x0593), "0=100");
+ addNodesToBucketDB(document::BucketId(17, 0x10593), "1=200");
sendGet();
@@ -227,7 +227,7 @@ TEST_F(GetOperationTest, inconsistent_split) {
ASSERT_NO_FATAL_FAILURE(sendReply(0, api::ReturnCode::OK, "newauthor", 2));
ASSERT_NO_FATAL_FAILURE(sendReply(1, api::ReturnCode::OK, "oldauthor", 1));
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 2) ReturnCode(NONE)",
_sender.getLastReply());
@@ -246,7 +246,7 @@ TEST_F(GetOperationTest, multi_inconsistent_bucket_not_found) {
ASSERT_NO_FATAL_FAILURE(sendReply(0, api::ReturnCode::OK, "newauthor", 2));
ASSERT_NO_FATAL_FAILURE(sendReply(1, api::ReturnCode::OK, "", 0));
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 2) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -265,7 +265,7 @@ TEST_F(GetOperationTest, multi_inconsistent_bucket_not_found_deleted) {
// at timestamp 3.
ASSERT_NO_FATAL_FAILURE(sendReply(1, api::ReturnCode::OK, "", 3));
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 3) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -282,7 +282,7 @@ TEST_F(GetOperationTest, multi_inconsistent_bucket) {
ASSERT_NO_FATAL_FAILURE(sendReply(0, api::ReturnCode::OK, "newauthor", 2));
ASSERT_NO_FATAL_FAILURE(sendReply(1, api::ReturnCode::OK, "oldauthor", 1));
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 2) ReturnCode(NONE)",
_sender.getLastReply());
@@ -301,12 +301,12 @@ TEST_F(GetOperationTest, multi_inconsistent_bucket_fail) {
ASSERT_NO_FATAL_FAILURE(sendReply(0, api::ReturnCode::OK, "newauthor", 1));
ASSERT_NO_FATAL_FAILURE(sendReply(1, api::ReturnCode::DISK_FAILURE, "", 0));
- ASSERT_EQ("Get(BucketId(0x4000000000002a52), doc:test:uri) => 3",
+ ASSERT_EQ("Get(BucketId(0x4000000000000593), id:ns:text/html::uri) => 3",
_sender.getLastCommand());
ASSERT_NO_FATAL_FAILURE(replyWithDocument());
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 100) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -316,7 +316,7 @@ TEST_F(GetOperationTest, return_not_found_when_bucket_not_in_db) {
sendGet();
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 0) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -328,12 +328,12 @@ TEST_F(GetOperationTest, not_found) {
sendGet();
- ASSERT_EQ("Get(BucketId(0x4000000000002a52), doc:test:uri) => 0",
+ ASSERT_EQ("Get(BucketId(0x4000000000000593), id:ns:text/html::uri) => 0",
_sender.getLastCommand());
ASSERT_NO_FATAL_FAILURE(replyWithNotFound());
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 0) ReturnCode(NONE)",
_sender.getLastReply());
@@ -350,17 +350,17 @@ TEST_F(GetOperationTest, resend_on_storage_failure) {
sendGet();
- ASSERT_EQ("Get(BucketId(0x4000000000002a52), doc:test:uri) => 1",
+ ASSERT_EQ("Get(BucketId(0x4000000000000593), id:ns:text/html::uri) => 1",
_sender.getLastCommand());
ASSERT_NO_FATAL_FAILURE(replyWithFailure());
- ASSERT_EQ("Get(BucketId(0x4000000000002a52), doc:test:uri) => 2",
+ ASSERT_EQ("Get(BucketId(0x4000000000000593), id:ns:text/html::uri) => 2",
_sender.getLastCommand());
ASSERT_NO_FATAL_FAILURE(replyWithDocument());
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 100) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -374,17 +374,17 @@ TEST_F(GetOperationTest, resend_on_storage_failure_all_fail) {
sendGet();
- ASSERT_EQ("Get(BucketId(0x4000000000002a52), doc:test:uri) => 1",
+ ASSERT_EQ("Get(BucketId(0x4000000000000593), id:ns:text/html::uri) => 1",
_sender.getLastCommand());
ASSERT_NO_FATAL_FAILURE(replyWithFailure());
- ASSERT_EQ("Get(BucketId(0x4000000000002a52), doc:test:uri) => 2",
+ ASSERT_EQ("Get(BucketId(0x4000000000000593), id:ns:text/html::uri) => 2",
_sender.getLastCommand());
ASSERT_NO_FATAL_FAILURE(replyWithFailure());
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 0) ReturnCode(IO_FAILURE)",
_sender.getLastReply());
}
@@ -397,12 +397,12 @@ TEST_F(GetOperationTest, send_to_ideal_copy_if_bucket_in_sync) {
sendGet();
// Should always send to node 1 (follow bucket db order)
- ASSERT_EQ("Get(BucketId(0x4000000000002a52), doc:test:uri) => 1",
+ ASSERT_EQ("Get(BucketId(0x4000000000000593), id:ns:text/html::uri) => 1",
_sender.getLastCommand());
ASSERT_NO_FATAL_FAILURE(replyWithDocument());
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 100) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -412,7 +412,7 @@ TEST_F(GetOperationTest, multiple_copies_with_failure_on_local_node) {
// Node 0 is local copy to distributor 0 and will be preferred when
// sending initially.
- addNodesToBucketDB(document::BucketId(16, 0x2a52), "2=100,0=100");
+ addNodesToBucketDB(document::BucketId(16, 0x0593), "2=100,0=100");
sendGet();
@@ -427,7 +427,7 @@ TEST_F(GetOperationTest, multiple_copies_with_failure_on_local_node) {
ASSERT_NO_FATAL_FAILURE(sendReply(1, api::ReturnCode::OK, "newestauthor", 3));
- ASSERT_EQ("GetReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("GetReply(BucketId(0x0000000000000000), id:ns:text/html::uri, "
"timestamp 3) ReturnCode(NONE)",
_sender.getLastReply());
diff --git a/storage/src/tests/distributor/pendingmessagetrackertest.cpp b/storage/src/tests/distributor/pendingmessagetrackertest.cpp
index a4a883d7059..e1bca1a1890 100644
--- a/storage/src/tests/distributor/pendingmessagetrackertest.cpp
+++ b/storage/src/tests/distributor/pendingmessagetrackertest.cpp
@@ -173,7 +173,7 @@ TEST_F(PendingMessageTrackerTest, simple) {
std::ostringstream ost;
tracker.reportStatus(ost, framework::HttpUrlPath("/pendingmessages?order=bucket"));
- EXPECT_THAT(ost.str(), Not(HasSubstr("doc:")));
+ EXPECT_THAT(ost.str(), Not(HasSubstr("id:")));
}
}
diff --git a/storage/src/tests/distributor/putoperationtest.cpp b/storage/src/tests/distributor/putoperationtest.cpp
index 99c6ec3d71e..d882d17841e 100644
--- a/storage/src/tests/distributor/putoperationtest.cpp
+++ b/storage/src/tests/distributor/putoperationtest.cpp
@@ -85,7 +85,7 @@ public:
}
Document::SP createDummyDocument(const char* ns, const char* id) const {
- return std::make_shared<Document>(doc_type(), DocumentId(DocIdString(ns, id)));
+ return std::make_shared<Document>(doc_type(), DocumentId(vespalib::make_string("id:%s:testdoctype1::%s", ns, id)));
}
std::shared_ptr<api::PutCommand> createPut(Document::SP doc) const {
@@ -97,7 +97,7 @@ PutOperationTest::~PutOperationTest() = default;
document::BucketId
PutOperationTest::createAndSendSampleDocument(uint32_t timeout) {
- auto doc = std::make_shared<Document>(doc_type(), DocumentId(DocIdString("test", "test")));
+ auto doc = std::make_shared<Document>(doc_type(), DocumentId("id:test:testdoctype1::"));
document::BucketId id = getExternalOperationHandler().getBucketId(doc->getId());
addIdealNodes(id);
@@ -123,13 +123,13 @@ TEST_F(PutOperationTest, simple) {
setupDistributor(1, 1, "storage:1 distributor:1");
createAndSendSampleDocument(180);
- ASSERT_EQ("Put(BucketId(0x4000000000008b13), "
- "doc:test:test, timestamp 100, size 36) => 0",
+ ASSERT_EQ("Put(BucketId(0x4000000000001dd4), "
+ "id:test:testdoctype1::, timestamp 100, size 45) => 0",
_sender.getCommands(true, true));
sendReply();
- ASSERT_EQ("PutReply(doc:test:test, BucketId(0x0000000000000000), "
+ ASSERT_EQ("PutReply(id:test:testdoctype1::, BucketId(0x0000000000000000), "
"timestamp 100) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -141,7 +141,7 @@ TEST_F(PutOperationTest, bucket_database_gets_special_entry_when_CreateBucket_se
sendPut(createPut(doc));
// Database updated before CreateBucket is sent
- ASSERT_EQ("BucketId(0x4000000000008b13) : "
+ ASSERT_EQ("BucketId(0x4000000000008f09) : "
"node(idx=0,crc=0x1,docs=0/0,bytes=0/0,trusted=true,active=true,ready=false)",
dumpBucket(getExternalOperationHandler().getBucketId(doc->getId())));
@@ -153,16 +153,16 @@ TEST_F(PutOperationTest, send_inline_split_before_put_if_bucket_too_large) {
getConfig().setSplitCount(1024);
getConfig().setSplitSize(1000000);
- addNodesToBucketDB(document::BucketId(0x4000000000002a52), "0=10000/10000/10000/t");
+ addNodesToBucketDB(document::BucketId(0x4000000000000593), "0=10000/10000/10000/t");
sendPut(createPut(createDummyDocument("test", "uri")));
- ASSERT_EQ("SplitBucketCommand(BucketId(0x4000000000002a52)Max doc count: "
+ ASSERT_EQ("SplitBucketCommand(BucketId(0x4000000000000593)Max doc count: "
"1024, Max total doc size: 1000000) Reasons to start: "
"[Splitting bucket because its maximum size (10000 b, 10000 docs, 10000 meta, 10000 b total) is "
"higher than the configured limit of (1000000, 1024)] => 0,"
- "Put(BucketId(0x4000000000002a52), doc:test:uri, timestamp 100, "
- "size 35) => 0",
+ "Put(BucketId(0x4000000000000593), id:test:testdoctype1::uri, timestamp 100, "
+ "size 48) => 0",
_sender.getCommands(true, true));
}
@@ -171,12 +171,12 @@ TEST_F(PutOperationTest, do_not_send_inline_split_if_not_configured) {
getConfig().setSplitCount(1024);
getConfig().setDoInlineSplit(false);
- addNodesToBucketDB(document::BucketId(0x4000000000002a52), "0=10000/10000/10000/t");
+ addNodesToBucketDB(document::BucketId(0x4000000000000593), "0=10000/10000/10000/t");
sendPut(createPut(createDummyDocument("test", "uri")));
- ASSERT_EQ("Put(BucketId(0x4000000000002a52), doc:test:uri, timestamp 100, "
- "size 35) => 0",
+ ASSERT_EQ("Put(BucketId(0x4000000000000593), id:test:testdoctype1::uri, timestamp 100, "
+ "size 48) => 0",
_sender.getCommands(true, true));
}
@@ -184,22 +184,22 @@ TEST_F(PutOperationTest, node_removed_on_reply) {
setupDistributor(2, 2, "storage:2 distributor:1");
createAndSendSampleDocument(180);
- ASSERT_EQ("Put(BucketId(0x4000000000008b13), "
- "doc:test:test, timestamp 100, size 36) => 1,"
- "Put(BucketId(0x4000000000008b13), "
- "doc:test:test, timestamp 100, size 36) => 0",
+ ASSERT_EQ("Put(BucketId(0x4000000000001dd4), "
+ "id:test:testdoctype1::, timestamp 100, size 45) => 0,"
+ "Put(BucketId(0x4000000000001dd4), "
+ "id:test:testdoctype1::, timestamp 100, size 45) => 1",
_sender.getCommands(true, true));
- getExternalOperationHandler().removeNodeFromDB(makeDocumentBucket(document::BucketId(16, 0x8b13)), 0);
+ getExternalOperationHandler().removeNodeFromDB(makeDocumentBucket(document::BucketId(16, 0x1dd4)), 0);
sendReply(0);
sendReply(1);
- ASSERT_EQ("PutReply(doc:test:test, BucketId(0x0000000000000000), "
+ ASSERT_EQ("PutReply(id:test:testdoctype1::, BucketId(0x0000000000000000), "
"timestamp 100) ReturnCode(BUCKET_DELETED, "
- "Bucket(BucketSpace(0x0000000000000001), BucketId(0x4000000000008b13)) was deleted from nodes [0] "
+ "Bucket(BucketSpace(0x0000000000000001), BucketId(0x4000000000001dd4)) was deleted from nodes [0] "
"after message was sent but before it was done. "
- "Sent to [1,0])",
+ "Sent to [0,1])",
_sender.getLastReply());
}
@@ -210,7 +210,7 @@ TEST_F(PutOperationTest, storage_failed) {
sendReply(-1, api::ReturnCode::INTERNAL_FAILURE);
- ASSERT_EQ("PutReply(doc:test:test, BucketId(0x0000000000000000), "
+ ASSERT_EQ("PutReply(id:test:testdoctype1::, BucketId(0x0000000000000000), "
"timestamp 100) ReturnCode(INTERNAL_FAILURE)",
_sender.getLastReply(true));
}
@@ -221,22 +221,22 @@ TEST_F(PutOperationTest, multiple_copies) {
Document::SP doc(createDummyDocument("test", "test"));
sendPut(createPut(doc));
- ASSERT_EQ("Create bucket => 3,Create bucket => 1,"
- "Create bucket => 0,Put => 3,Put => 1,Put => 0",
+ ASSERT_EQ("Create bucket => 3,Create bucket => 2,"
+ "Create bucket => 1,Put => 3,Put => 2,Put => 1",
_sender.getCommands(true));
for (uint32_t i = 0; i < 6; i++) {
sendReply(i);
}
- ASSERT_EQ("PutReply(doc:test:test, BucketId(0x0000000000000000), "
+ ASSERT_EQ("PutReply(id:test:testdoctype1::test, BucketId(0x0000000000000000), "
"timestamp 100) ReturnCode(NONE)",
_sender.getLastReply(true));
- ASSERT_EQ("BucketId(0x4000000000008b13) : "
+ ASSERT_EQ("BucketId(0x4000000000008f09) : "
"node(idx=3,crc=0x1,docs=2/4,bytes=3/5,trusted=true,active=false,ready=false), "
- "node(idx=1,crc=0x1,docs=2/4,bytes=3/5,trusted=true,active=false,ready=false), "
- "node(idx=0,crc=0x1,docs=2/4,bytes=3/5,trusted=true,active=false,ready=false)",
+ "node(idx=2,crc=0x1,docs=2/4,bytes=3/5,trusted=true,active=false,ready=false), "
+ "node(idx=1,crc=0x1,docs=2/4,bytes=3/5,trusted=true,active=false,ready=false)",
dumpBucket(getExternalOperationHandler().getBucketId(doc->getId())));
}
@@ -245,8 +245,8 @@ TEST_F(PutOperationTest, multiple_copies_early_return_primary_required) {
sendPut(createPut(createDummyDocument("test", "test")));
- ASSERT_EQ("Create bucket => 3,Create bucket => 1,"
- "Create bucket => 0,Put => 3,Put => 1,Put => 0",
+ ASSERT_EQ("Create bucket => 3,Create bucket => 2,"
+ "Create bucket => 1,Put => 3,Put => 2,Put => 1",
_sender.getCommands(true));
// Reply to 2 CreateBucket, including primary
@@ -258,7 +258,7 @@ TEST_F(PutOperationTest, multiple_copies_early_return_primary_required) {
sendReply(3 + i);
}
- ASSERT_EQ("PutReply(doc:test:test, BucketId(0x0000000000000000), "
+ ASSERT_EQ("PutReply(id:test:testdoctype1::test, BucketId(0x0000000000000000), "
"timestamp 100) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -268,8 +268,8 @@ TEST_F(PutOperationTest, multiple_copies_early_return_primary_not_required) {
sendPut(createPut(createDummyDocument("test", "test")));
- ASSERT_EQ("Create bucket => 3,Create bucket => 1,"
- "Create bucket => 0,Put => 3,Put => 1,Put => 0",
+ ASSERT_EQ("Create bucket => 3,Create bucket => 2,"
+ "Create bucket => 1,Put => 3,Put => 2,Put => 1",
_sender.getCommands(true));
// Reply only to 2 nodes (but not the primary)
@@ -280,7 +280,7 @@ TEST_F(PutOperationTest, multiple_copies_early_return_primary_not_required) {
sendReply(3 + i); // Put
}
- ASSERT_EQ("PutReply(doc:test:test, BucketId(0x0000000000000000), "
+ ASSERT_EQ("PutReply(id:test:testdoctype1::test, BucketId(0x0000000000000000), "
"timestamp 100) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -290,8 +290,8 @@ TEST_F(PutOperationTest, multiple_copies_early_return_primary_required_not_done)
sendPut(createPut(createDummyDocument("test", "test")));
- ASSERT_EQ("Create bucket => 3,Create bucket => 1,"
- "Create bucket => 0,Put => 3,Put => 1,Put => 0",
+ ASSERT_EQ("Create bucket => 3,Create bucket => 2,"
+ "Create bucket => 1,Put => 3,Put => 2,Put => 1",
_sender.getCommands(true));
// Reply only to 2 nodes (but not the primary)
@@ -309,8 +309,8 @@ TEST_F(PutOperationTest, do_not_revert_on_failure_after_early_return) {
sendPut(createPut(createDummyDocument("test", "test")));
- ASSERT_EQ("Create bucket => 3,Create bucket => 1,"
- "Create bucket => 0,Put => 3,Put => 1,Put => 0",
+ ASSERT_EQ("Create bucket => 3,Create bucket => 2,"
+ "Create bucket => 1,Put => 3,Put => 2,Put => 1",
_sender.getCommands(true));
for (uint32_t i = 0; i < 3; i++) {
@@ -320,14 +320,14 @@ TEST_F(PutOperationTest, do_not_revert_on_failure_after_early_return) {
sendReply(3 + i); // Put
}
- ASSERT_EQ("PutReply(doc:test:test, BucketId(0x0000000000000000), "
+ ASSERT_EQ("PutReply(id:test:testdoctype1::test, BucketId(0x0000000000000000), "
"timestamp 100) ReturnCode(NONE)",
_sender.getLastReply());
sendReply(5, api::ReturnCode::INTERNAL_FAILURE);
// Should not be any revert commands sent
- ASSERT_EQ("Create bucket => 3,Create bucket => 1,"
- "Create bucket => 0,Put => 3,Put => 1,Put => 0",
+ ASSERT_EQ("Create bucket => 3,Create bucket => 2,"
+ "Create bucket => 1,Put => 3,Put => 2,Put => 1",
_sender.getCommands(true));
}
@@ -336,7 +336,7 @@ TEST_F(PutOperationTest, revert_successful_copies_when_one_fails) {
createAndSendSampleDocument(180);
- ASSERT_EQ("Put => 3,Put => 1,Put => 0", _sender.getCommands(true));
+ ASSERT_EQ("Put => 0,Put => 2,Put => 1", _sender.getCommands(true));
for (uint32_t i = 0; i < 2; i++) {
sendReply(i);
@@ -344,12 +344,12 @@ TEST_F(PutOperationTest, revert_successful_copies_when_one_fails) {
sendReply(2, api::ReturnCode::INTERNAL_FAILURE);
- ASSERT_EQ("PutReply(doc:test:test, "
+ ASSERT_EQ("PutReply(id:test:testdoctype1::, "
"BucketId(0x0000000000000000), timestamp 100) "
"ReturnCode(INTERNAL_FAILURE)",
_sender.getLastReply(true));
- ASSERT_EQ("Revert => 3,Revert => 1", _sender.getCommands(true, false, 3));
+ ASSERT_EQ("Revert => 0,Revert => 2", _sender.getCommands(true, false, 3));
}
TEST_F(PutOperationTest, no_revert_if_revert_disabled) {
@@ -361,7 +361,7 @@ TEST_F(PutOperationTest, no_revert_if_revert_disabled) {
createAndSendSampleDocument(180);
- ASSERT_EQ("Put => 3,Put => 1,Put => 0", _sender.getCommands(true));
+ ASSERT_EQ("Put => 0,Put => 2,Put => 1", _sender.getCommands(true));
for (uint32_t i = 0; i < 2; i++) {
sendReply(i);
@@ -369,7 +369,7 @@ TEST_F(PutOperationTest, no_revert_if_revert_disabled) {
sendReply(2, api::ReturnCode::INTERNAL_FAILURE);
- ASSERT_EQ("PutReply(doc:test:test, "
+ ASSERT_EQ("PutReply(id:test:testdoctype1::, "
"BucketId(0x0000000000000000), timestamp 100) "
"ReturnCode(INTERNAL_FAILURE)",
_sender.getLastReply(true));
@@ -405,7 +405,7 @@ TEST_F(PutOperationTest, do_not_send_CreateBucket_if_already_pending) {
TEST_F(PutOperationTest, no_storage_nodes) {
setupDistributor(2, 1, "storage:0 distributor:1");
createAndSendSampleDocument(180);
- ASSERT_EQ("PutReply(doc:test:test, BucketId(0x0000000000000000), "
+ ASSERT_EQ("PutReply(id:test:testdoctype1::, BucketId(0x0000000000000000), "
"timestamp 100) ReturnCode(NOT_CONNECTED, "
"Can't store document: No storage nodes available)",
_sender.getLastReply(true));
@@ -492,10 +492,10 @@ PutOperationTest::getNodes(const std::string& infoString) {
TEST_F(PutOperationTest, target_nodes) {
setupDistributor(2, 6, "storage:6 distributor:1");
- // Ideal state of bucket is 1,3.
- ASSERT_EQ("target( 1 3 ) create( 1 3 )", getNodes(""));
- ASSERT_EQ("target( 1 3 ) create( 3 )", getNodes("1-1-true"));
- ASSERT_EQ("target( 1 3 ) create( 3 )", getNodes("1-1-false"));
+ // Ideal state of bucket is 1,2.
+ ASSERT_EQ("target( 1 2 ) create( 1 2 )", getNodes(""));
+ ASSERT_EQ("target( 1 2 ) create( 2 )", getNodes("1-1-true"));
+ ASSERT_EQ("target( 1 2 ) create( 2 )", getNodes("1-1-false"));
ASSERT_EQ("target( 3 4 5 ) create( )", getNodes("3-1-true,4-1-true,5-1-true"));
ASSERT_EQ("target( 3 4 ) create( )", getNodes("3-2-true,4-2-true,5-1-false"));
ASSERT_EQ("target( 1 3 4 ) create( )", getNodes("3-2-true,4-2-true,1-1-false"));
@@ -513,7 +513,7 @@ TEST_F(PutOperationTest, replica_not_resurrected_in_db_when_node_down_in_active_
sendPut(createPut(doc));
- ASSERT_EQ("Put => 1,Put => 0,Put => 2", _sender.getCommands(true));
+ ASSERT_EQ("Put => 1,Put => 2,Put => 0", _sender.getCommands(true));
enableDistributorClusterState("distributor:1 storage:3 .1.s:d .2.s:m");
addNodesToBucketDB(bId, "0=1/2/3/t"); // This will actually remove node #1.
@@ -522,8 +522,8 @@ TEST_F(PutOperationTest, replica_not_resurrected_in_db_when_node_down_in_active_
sendReply(1, api::ReturnCode::OK, api::BucketInfo(5, 6, 7));
sendReply(2, api::ReturnCode::OK, api::BucketInfo(7, 8, 9));
- ASSERT_EQ("BucketId(0x4000000000002a52) : "
- "node(idx=0,crc=0x5,docs=6/6,bytes=7/7,trusted=true,active=false,ready=false)",
+ ASSERT_EQ("BucketId(0x4000000000000593) : "
+ "node(idx=0,crc=0x7,docs=8/8,bytes=9/9,trusted=true,active=false,ready=false)",
dumpBucket(getExternalOperationHandler().getBucketId(doc->getId())));
}
@@ -535,7 +535,7 @@ TEST_F(PutOperationTest, replica_not_resurrected_in_db_when_node_down_in_pending
addNodesToBucketDB(bucket, "0=1/2/3/t,1=1/2/3/t,2=1/2/3/t");
sendPut(createPut(doc));
- ASSERT_EQ("Put => 1,Put => 0,Put => 2", _sender.getCommands(true));
+ ASSERT_EQ("Put => 1,Put => 2,Put => 0", _sender.getCommands(true));
// Trigger a pending (but not completed) cluster state transition where content
// node 0 is down. This will prune its replica from the DB. We assume that the
// downed node managed to send off a reply to the Put before it went down, and
@@ -555,7 +555,7 @@ TEST_F(PutOperationTest, replica_not_resurrected_in_db_when_node_down_in_pending
sendReply(1, api::ReturnCode::OK, api::BucketInfo(6, 7, 8));
sendReply(2, api::ReturnCode::OK, api::BucketInfo(9, 8, 7));
- ASSERT_EQ("BucketId(0x4000000000002a52) : "
+ ASSERT_EQ("BucketId(0x4000000000000593) : "
"node(idx=1,crc=0x5,docs=6/6,bytes=7/7,trusted=true,active=false,ready=false)",
dumpBucket(bucket));
}
@@ -574,7 +574,7 @@ TEST_F(PutOperationTest, put_is_failed_with_busy_if_target_down_in_pending_state
sendPut(createPut(doc));
EXPECT_EQ("", _sender.getCommands(true));
- EXPECT_EQ("PutReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("PutReply(id:test:testdoctype1::test, BucketId(0x0000000000000000), "
"timestamp 100) ReturnCode(BUSY, "
"One or more target content nodes are unavailable in the pending cluster state)",
_sender.getLastReply(true));
diff --git a/storage/src/tests/distributor/removeoperationtest.cpp b/storage/src/tests/distributor/removeoperationtest.cpp
index bae2395bfa7..c3fcda30bf5 100644
--- a/storage/src/tests/distributor/removeoperationtest.cpp
+++ b/storage/src/tests/distributor/removeoperationtest.cpp
@@ -22,7 +22,7 @@ struct RemoveOperationTest : Test, DistributorTestUtil {
void SetUp() override {
createLinks();
- docId = document::DocumentId(document::DocIdString("test", "uri"));
+ docId = document::DocumentId("id:test:test::uri");
bucketId = getExternalOperationHandler().getBucketId(docId);
enableDistributorClusterState("distributor:1 storage:4");
};
@@ -57,8 +57,7 @@ struct RemoveOperationTest : Test, DistributorTestUtil {
std::unique_ptr<api::StorageReply> reply(removec->makeReply());
auto* removeR = static_cast<api::RemoveReply*>(reply.get());
removeR->setOldTimestamp(oldTimestamp);
- callback.onReceive(_sender,
- std::shared_ptr<api::StorageReply>(reply.release()));
+ callback.onReceive(_sender, std::shared_ptr<api::StorageReply>(reply.release()));
}
void sendRemove() {
@@ -71,13 +70,13 @@ TEST_F(RemoveOperationTest, simple) {
sendRemove();
- ASSERT_EQ("Remove(BucketId(0x4000000000002a52), doc:test:uri, "
+ ASSERT_EQ("Remove(BucketId(0x4000000000000593), id:test:test::uri, "
"timestamp 100) => 1",
_sender.getLastCommand());
replyToMessage(*op, -1, 34);
- ASSERT_EQ("RemoveReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("RemoveReply(BucketId(0x0000000000000000), id:test:test::uri, "
"timestamp 100, removed doc from 34) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -87,13 +86,13 @@ TEST_F(RemoveOperationTest, not_found) {
sendRemove();
- ASSERT_EQ("Remove(BucketId(0x4000000000002a52), doc:test:uri, "
+ ASSERT_EQ("Remove(BucketId(0x4000000000000593), id:test:test::uri, "
"timestamp 100) => 1",
_sender.getLastCommand());
replyToMessage(*op, -1, 0);
- ASSERT_EQ("RemoveReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("RemoveReply(BucketId(0x0000000000000000), id:test:test::uri, "
"timestamp 100, not found) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -103,13 +102,13 @@ TEST_F(RemoveOperationTest, storage_failure) {
sendRemove();
- ASSERT_EQ("Remove(BucketId(0x4000000000002a52), doc:test:uri, "
+ ASSERT_EQ("Remove(BucketId(0x4000000000000593), id:test:test::uri, "
"timestamp 100) => 1",
_sender.getLastCommand());
sendReply(*op, -1, api::ReturnCode::INTERNAL_FAILURE);
- ASSERT_EQ("RemoveReply(BucketId(0x0000000000000000), doc:test:uri, "
+ ASSERT_EQ("RemoveReply(BucketId(0x0000000000000000), id:test:test::uri, "
"timestamp 100, not found) ReturnCode(INTERNAL_FAILURE)",
_sender.getLastReply());
}
@@ -118,7 +117,7 @@ TEST_F(RemoveOperationTest, not_in_db) {
sendRemove();
ASSERT_EQ("RemoveReply(BucketId(0x0000000000000000), "
- "doc:test:uri, timestamp 100, not found) ReturnCode(NONE)",
+ "id:test:test::uri, timestamp 100, not found) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -127,11 +126,11 @@ TEST_F(RemoveOperationTest, multiple_copies) {
sendRemove();
- ASSERT_EQ("Remove(BucketId(0x4000000000002a52), doc:test:uri, "
+ ASSERT_EQ("Remove(BucketId(0x4000000000000593), id:test:test::uri, "
"timestamp 100) => 1,"
- "Remove(BucketId(0x4000000000002a52), doc:test:uri, "
+ "Remove(BucketId(0x4000000000000593), id:test:test::uri, "
"timestamp 100) => 2,"
- "Remove(BucketId(0x4000000000002a52), doc:test:uri, "
+ "Remove(BucketId(0x4000000000000593), id:test:test::uri, "
"timestamp 100) => 3",
_sender.getCommands(true, true));
@@ -140,7 +139,7 @@ TEST_F(RemoveOperationTest, multiple_copies) {
replyToMessage(*op, 2, 75);
ASSERT_EQ("RemoveReply(BucketId(0x0000000000000000), "
- "doc:test:uri, timestamp 100, removed doc from 75) ReturnCode(NONE)",
+ "id:test:test::uri, timestamp 100, removed doc from 75) ReturnCode(NONE)",
_sender.getLastReply());
}
@@ -149,7 +148,7 @@ TEST_F(RemoveOperationTest, can_send_remove_when_all_replica_nodes_retired) {
addNodesToBucketDB(bucketId, "0=123");
sendRemove();
- ASSERT_EQ("Remove(BucketId(0x4000000000002a52), doc:test:uri, "
+ ASSERT_EQ("Remove(BucketId(0x4000000000000593), id:test:test::uri, "
"timestamp 100) => 0",
_sender.getLastCommand());
}
diff --git a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
index edb5261fbfa..df9bf683326 100644
--- a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
+++ b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
@@ -197,8 +197,7 @@ TwoPhaseUpdateOperationTest::replyToGet(
std::shared_ptr<api::StorageReply> reply;
if (haveDocument) {
- auto doc(std::make_shared<Document>(
- *_doc_type, DocumentId(DocIdString("test", "test"))));
+ auto doc(std::make_shared<Document>(*_doc_type, DocumentId("id:ns:" + _doc_type->getName() + "::1")));
doc->setValue("headerval", IntFieldValue(oldTimestamp));
reply = std::make_shared<api::GetReply>(get, doc, oldTimestamp);
@@ -229,7 +228,7 @@ TwoPhaseUpdateOperationTest::sendUpdate(const std::string& bucketState,
if (!options._withError) {
update = std::make_shared<document::DocumentUpdate>(
*_repo, *_doc_type,
- document::DocumentId(document::DocIdString("test", "test")));
+ document::DocumentId("id:ns:" + _doc_type->getName() + "::1"));
document::FieldUpdate fup(_doc_type->getField("headerval"));
fup.addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 10));
update->addUpdate(fup);
@@ -239,7 +238,7 @@ TwoPhaseUpdateOperationTest::sendUpdate(const std::string& bucketState,
auto* badDocType = _repo->getDocumentType("testdoctype2");
update = std::make_shared<document::DocumentUpdate>(
*_repo, *badDocType,
- document::DocumentId(document::DocIdString("test", "test")));
+ document::DocumentId("id:ns:" + _doc_type->getName() + "::1"));
document::FieldUpdate fup(badDocType->getField("onlyinchild"));
fup.addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 10));
update->addUpdate(fup);
@@ -285,7 +284,7 @@ TEST_F(TwoPhaseUpdateOperationTest, simple) {
replyToMessage(*cb, sender, 0, 90);
- EXPECT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 90) ReturnCode(NONE)",
sender.getLastReply(true));
}
@@ -297,7 +296,7 @@ TEST_F(TwoPhaseUpdateOperationTest, non_existing) {
DistributorMessageSenderStub sender;
cb->start(sender, framework::MilliSecTime(0));
- EXPECT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 0) ReturnCode(NONE)",
sender.getLastReply(true));
}
@@ -313,7 +312,7 @@ TEST_F(TwoPhaseUpdateOperationTest, update_failed) {
replyToMessage(*cb, sender, 0, 90, api::ReturnCode::INTERNAL_FAILURE);
- EXPECT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 0) "
"ReturnCode(INTERNAL_FAILURE)",
sender.getLastReply(true));
@@ -331,20 +330,18 @@ TEST_F(TwoPhaseUpdateOperationTest, fast_path_inconsistent_timestamps) {
replyToMessage(*cb, sender, 0, 90);
replyToMessage(*cb, sender, 1, 110);
- ASSERT_EQ("Get(BucketId(0x4000000000008b13), doc:test:test) => 1",
- sender.getLastCommand(true));
+ ASSERT_EQ("Get(BucketId(0x400000000000cac4), id:ns:testdoctype1::1) => 1", sender.getLastCommand(true));
replyToGet(*cb, sender, 2, 110);
- ASSERT_EQ("Update => 0,Update => 1,Get => 1,Put => 1,Put => 0",
- sender.getCommands(true));
+ ASSERT_EQ("Update => 0,Update => 1,Get => 1,Put => 1,Put => 0", sender.getCommands(true));
ASSERT_TRUE(sender.replies().empty());
replyToPut(*cb, sender, 3);
replyToPut(*cb, sender, 4);
- EXPECT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 110 Was inconsistent "
"(best node 1)) ReturnCode(NONE)",
sender.getLastReply(true));
@@ -362,13 +359,12 @@ TEST_F(TwoPhaseUpdateOperationTest, fast_path_inconsistent_timestamps_not_found)
replyToMessage(*cb, sender, 0, 90);
replyToMessage(*cb, sender, 1, 110);
- ASSERT_EQ("Get(BucketId(0x4000000000008b13), doc:test:test) => 1",
- sender.getLastCommand(true));
+ ASSERT_EQ("Get(BucketId(0x400000000000cac4), id:ns:testdoctype1::1) => 1", sender.getLastCommand(true));
ASSERT_TRUE(sender.replies().empty());
replyToGet(*cb, sender, 2, 110, false);
- EXPECT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 110 Was inconsistent "
"(best node 1)) ReturnCode(INTERNAL_FAILURE)",
sender.getLastReply(true));
@@ -387,7 +383,7 @@ TEST_F(TwoPhaseUpdateOperationTest, fast_path_inconsistent_timestamps_update_err
ASSERT_TRUE(sender.replies().empty());
replyToMessage(*cb, sender, 1, 110, api::ReturnCode::IO_FAILURE);
- EXPECT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 90) "
"ReturnCode(IO_FAILURE)",
sender.getLastReply(true));
@@ -405,13 +401,13 @@ TEST_F(TwoPhaseUpdateOperationTest, fast_path_inconsistent_timestamps_get_error)
replyToMessage(*cb, sender, 0, 90);
replyToMessage(*cb, sender, 1, 110);
- ASSERT_EQ("Get(BucketId(0x4000000000008b13), doc:test:test) => 1",
+ ASSERT_EQ("Get(BucketId(0x400000000000cac4), id:ns:testdoctype1::1) => 1",
sender.getLastCommand(true));
ASSERT_TRUE(sender.replies().empty());
replyToGet(*cb, sender, 2, 110, false, api::ReturnCode::IO_FAILURE);
- EXPECT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 110 Was inconsistent "
"(best node 1)) ReturnCode(IO_FAILURE)",
sender.getLastReply(true));
@@ -429,7 +425,7 @@ TEST_F(TwoPhaseUpdateOperationTest, fast_path_inconsistent_timestamps_put_error)
replyToMessage(*cb, sender, 0, 90);
replyToMessage(*cb, sender, 1, 110);
- ASSERT_EQ("Get(BucketId(0x4000000000008b13), doc:test:test) => 1",
+ ASSERT_EQ("Get(BucketId(0x400000000000cac4), id:ns:testdoctype1::1) => 1",
sender.getLastCommand(true));
replyToGet(*cb, sender, 2, 110);
@@ -441,7 +437,7 @@ TEST_F(TwoPhaseUpdateOperationTest, fast_path_inconsistent_timestamps_put_error)
ASSERT_TRUE(sender.replies().empty());
replyToPut(*cb, sender, 4);
- EXPECT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 110 Was inconsistent "
"(best node 1)) ReturnCode(IO_FAILURE)",
sender.getLastReply(true));
@@ -459,7 +455,7 @@ TEST_F(TwoPhaseUpdateOperationTest, fast_path_inconsistent_timestamps_put_not_st
replyToMessage(*cb, sender, 0, 90);
replyToMessage(*cb, sender, 1, 110);
- ASSERT_EQ("Get(BucketId(0x4000000000008b13), doc:test:test) => 1",
+ ASSERT_EQ("Get(BucketId(0x400000000000cac4), id:ns:testdoctype1::1) => 1",
sender.getLastCommand(true));
checkMessageSettingsPropagatedTo(sender.commands().back());
@@ -467,7 +463,7 @@ TEST_F(TwoPhaseUpdateOperationTest, fast_path_inconsistent_timestamps_put_not_st
ASSERT_TRUE(sender.replies().empty());
replyToGet(*cb, sender, 2, 110);
- EXPECT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 110 Was inconsistent "
"(best node 1)) ReturnCode(NOT_CONNECTED, "
"Can't store document: No storage nodes available)",
@@ -483,8 +479,8 @@ TEST_F(TwoPhaseUpdateOperationTest, fast_path_inconsistent_timestamps_inconsiste
DistributorMessageSenderStub sender;
cb->start(sender, framework::MilliSecTime(0));
- std::string wanted("Get(BucketId(0x4000000000008b13), doc:test:test) => 0,"
- "Get(BucketId(0x4400000000008b13), doc:test:test) => 0");
+ std::string wanted("Get(BucketId(0x400000000000cac4), id:ns:testdoctype1::1) => 0,"
+ "Get(BucketId(0x440000000000cac4), id:ns:testdoctype1::1) => 0");
std::string text = sender.getCommands(true, true);
ASSERT_EQ(wanted, text);
@@ -492,17 +488,17 @@ TEST_F(TwoPhaseUpdateOperationTest, fast_path_inconsistent_timestamps_inconsiste
replyToGet(*cb, sender, 0, 90);
replyToGet(*cb, sender, 1, 120);
- ASSERT_EQ("Put(BucketId(0x4400000000008b13), doc:test:test, "
- "timestamp 200000000, size 52) => 1,"
- "Put(BucketId(0x4400000000008b13), doc:test:test, "
- "timestamp 200000000, size 52) => 0",
+ ASSERT_EQ("Put(BucketId(0x440000000000cac4), id:ns:testdoctype1::1, "
+ "timestamp 200000000, size 60) => 1,"
+ "Put(BucketId(0x440000000000cac4), id:ns:testdoctype1::1, "
+ "timestamp 200000000, size 60) => 0",
sender.getCommands(true, true, 2));
replyToPut(*cb, sender, 2);
ASSERT_TRUE(sender.replies().empty());
replyToPut(*cb, sender, 3);
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 120) "
"ReturnCode(NONE)",
@@ -543,7 +539,7 @@ TEST_F(TwoPhaseUpdateOperationTest, n_of_m) {
ASSERT_TRUE(sender.replies().empty());
replyToMessage(*cb, sender, 0, 90);
- EXPECT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 90) ReturnCode(NONE)",
sender.getLastReply(true));
@@ -569,18 +565,15 @@ TEST_F(TwoPhaseUpdateOperationTest, safe_path_updates_newest_received_document)
DistributorMessageSenderStub sender;
cb->start(sender, framework::MilliSecTime(0));
- ASSERT_EQ("Get(BucketId(0x4000000000008b13), doc:test:test) => 0,"
- "Get(BucketId(0x4000000000008b13), doc:test:test) => 2",
+ ASSERT_EQ("Get(BucketId(0x400000000000cac4), id:ns:testdoctype1::1) => 0,"
+ "Get(BucketId(0x400000000000cac4), id:ns:testdoctype1::1) => 2",
sender.getCommands(true, true));
replyToGet(*cb, sender, 0, 50);
replyToGet(*cb, sender, 1, 70);
- ASSERT_EQ("Put(BucketId(0x4000000000008b13), doc:test:test, "
- "timestamp 200000000, size 52) => 1,"
- "Put(BucketId(0x4000000000008b13), doc:test:test, "
- "timestamp 200000000, size 52) => 0,"
- "Put(BucketId(0x4000000000008b13), doc:test:test, "
- "timestamp 200000000, size 52) => 2",
+ ASSERT_EQ("Put(BucketId(0x400000000000cac4), id:ns:testdoctype1::1, timestamp 200000000, size 60) => 1,"
+ "Put(BucketId(0x400000000000cac4), id:ns:testdoctype1::1, timestamp 200000000, size 60) => 2,"
+ "Put(BucketId(0x400000000000cac4), id:ns:testdoctype1::1, timestamp 200000000, size 60) => 0",
sender.getCommands(true, true, 2));
// Make sure Put contains an updated document (+10 arith. update on field
// whose value equals gotten timestamp). In this case we want 70 -> 80.
@@ -591,7 +584,7 @@ TEST_F(TwoPhaseUpdateOperationTest, safe_path_updates_newest_received_document)
ASSERT_TRUE(sender.replies().empty());
replyToPut(*cb, sender, 4);
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 70) "
"ReturnCode(NONE)",
@@ -612,12 +605,9 @@ TEST_F(TwoPhaseUpdateOperationTest, create_if_non_existent_creates_document_if_a
replyToGet(*cb, sender, 1, 0, false);
// Since create-if-non-existent is set, distributor should create doc from
// scratch.
- ASSERT_EQ("Put(BucketId(0x4000000000008b13), doc:test:test, "
- "timestamp 200000000, size 52) => 1,"
- "Put(BucketId(0x4000000000008b13), doc:test:test, "
- "timestamp 200000000, size 52) => 0,"
- "Put(BucketId(0x4000000000008b13), doc:test:test, "
- "timestamp 200000000, size 52) => 2",
+ ASSERT_EQ("Put(BucketId(0x400000000000cac4), id:ns:testdoctype1::1, timestamp 200000000, size 60) => 1,"
+ "Put(BucketId(0x400000000000cac4), id:ns:testdoctype1::1, timestamp 200000000, size 60) => 2,"
+ "Put(BucketId(0x400000000000cac4), id:ns:testdoctype1::1, timestamp 200000000, size 60) => 0",
sender.getCommands(true, true, 2));
ASSERT_EQ("10", getUpdatedValueFromLastPut(sender));
@@ -627,7 +617,7 @@ TEST_F(TwoPhaseUpdateOperationTest, create_if_non_existent_creates_document_if_a
ASSERT_TRUE(sender.replies().empty());
replyToPut(*cb, sender, 4);
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 200000000) "
"ReturnCode(NONE)",
@@ -648,14 +638,14 @@ TEST_F(TwoPhaseUpdateOperationTest, update_fails_if_safe_path_has_failed_put) {
replyToGet(*cb, sender, 1, 0, false);
// Since create-if-non-existent is set, distributor should create doc from
// scratch.
- ASSERT_EQ("Put => 1,Put => 0,Put => 2", sender.getCommands(true, false, 2));
+ ASSERT_EQ("Put => 1,Put => 2,Put => 0", sender.getCommands(true, false, 2));
replyToPut(*cb, sender, 2);
replyToPut(*cb, sender, 3);
ASSERT_TRUE(sender.replies().empty());
replyToPut(*cb, sender, 4, api::ReturnCode::IO_FAILURE);
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 200000000) "
"ReturnCode(IO_FAILURE)",
@@ -675,7 +665,7 @@ TEST_F(TwoPhaseUpdateOperationTest, update_fails_if_safe_path_gets_fail) {
replyToGet(*cb, sender, 0, 0, false, api::ReturnCode::IO_FAILURE);
ASSERT_TRUE(sender.replies().empty());
replyToGet(*cb, sender, 1, 0, false, api::ReturnCode::IO_FAILURE);
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 0) "
"ReturnCode(IO_FAILURE)",
@@ -696,7 +686,7 @@ TEST_F(TwoPhaseUpdateOperationTest, update_fails_if_apply_throws_exception) {
ASSERT_TRUE(sender.replies().empty());
replyToGet(*cb, sender, 1, 70);
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 70) "
"ReturnCode(INTERNAL_FAILURE, Can not apply a "
@@ -713,10 +703,10 @@ TEST_F(TwoPhaseUpdateOperationTest, non_existing_with_auto_create) {
DistributorMessageSenderStub sender;
cb->start(sender, framework::MilliSecTime(0));
- ASSERT_EQ("CreateBucketCommand(BucketId(0x4000000000008b13), active) "
+ ASSERT_EQ("CreateBucketCommand(BucketId(0x400000000000cac4), active) "
"Reasons to start: => 0,"
- "Put(BucketId(0x4000000000008b13), doc:test:test, "
- "timestamp 200000000, size 52) => 0",
+ "Put(BucketId(0x400000000000cac4), id:ns:testdoctype1::1, "
+ "timestamp 200000000, size 60) => 0",
sender.getCommands(true, true));
ASSERT_EQ("10", getUpdatedValueFromLastPut(sender));
@@ -725,7 +715,7 @@ TEST_F(TwoPhaseUpdateOperationTest, non_existing_with_auto_create) {
ASSERT_TRUE(sender.replies().empty());
replyToPut(*cb, sender, 1);
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 200000000) "
"ReturnCode(NONE)",
@@ -745,7 +735,7 @@ TEST_F(TwoPhaseUpdateOperationTest, safe_path_fails_update_when_mismatching_time
replyToGet(*cb, sender, 0, 100);
ASSERT_TRUE(sender.replies().empty());
replyToGet(*cb, sender, 1, 110);
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 0) "
"ReturnCode(NONE, No document with requested "
@@ -755,8 +745,7 @@ TEST_F(TwoPhaseUpdateOperationTest, safe_path_fails_update_when_mismatching_time
TEST_F(TwoPhaseUpdateOperationTest, safe_path_update_propagates_message_settings_to_gets_and_puts) {
setupDistributor(3, 3, "storage:3 distributor:1");
- std::shared_ptr<TwoPhaseUpdateOperation> cb(
- sendUpdate("0=1/2/3,1=1/2/3,2=2/3/4"));
+ std::shared_ptr<TwoPhaseUpdateOperation> cb(sendUpdate("0=1/2/3,1=1/2/3,2=2/3/4"));
DistributorMessageSenderStub sender;
cb->start(sender, framework::MilliSecTime(0));
@@ -765,7 +754,7 @@ TEST_F(TwoPhaseUpdateOperationTest, safe_path_update_propagates_message_settings
checkMessageSettingsPropagatedTo(sender.command(1));
replyToGet(*cb, sender, 0, 50);
replyToGet(*cb, sender, 1, 70);
- ASSERT_EQ("Put => 1,Put => 0,Put => 2", sender.getCommands(true, false, 2));
+ ASSERT_EQ("Put => 1,Put => 2,Put => 0", sender.getCommands(true, false, 2));
checkMessageSettingsPropagatedTo(sender.command(2));
checkMessageSettingsPropagatedTo(sender.command(3));
checkMessageSettingsPropagatedTo(sender.command(4));
@@ -776,16 +765,14 @@ TEST_F(TwoPhaseUpdateOperationTest, safe_path_update_propagates_message_settings
TEST_F(TwoPhaseUpdateOperationTest, safe_path_propagates_mbus_traces_from_replies) {
setupDistributor(3, 3, "storage:3 distributor:1");
- std::shared_ptr<TwoPhaseUpdateOperation> cb(
- sendUpdate("0=1/2/3,1=1/2/3,2=2/3/4"));
+ std::shared_ptr<TwoPhaseUpdateOperation> cb(sendUpdate("0=1/2/3,1=1/2/3,2=2/3/4"));
DistributorMessageSenderStub sender;
cb->start(sender, framework::MilliSecTime(0));
ASSERT_EQ("Get => 0,Get => 2", sender.getCommands(true));
- replyToGet(*cb, sender, 0, 50, true,
- api::ReturnCode::OK, "hello earthlings");
+ replyToGet(*cb, sender, 0, 50, true, api::ReturnCode::OK, "hello earthlings");
replyToGet(*cb, sender, 1, 70);
- ASSERT_EQ("Put => 1,Put => 0,Put => 2", sender.getCommands(true, false, 2));
+ ASSERT_EQ("Put => 1,Put => 2,Put => 0", sender.getCommands(true, false, 2));
replyToPut(*cb, sender, 2, api::ReturnCode::OK, "fooo");
replyToPut(*cb, sender, 3, api::ReturnCode::OK, "baaa");
ASSERT_TRUE(sender.replies().empty());
@@ -803,8 +790,7 @@ TEST_F(TwoPhaseUpdateOperationTest, update_fails_if_ownership_changes_between_ge
setupDistributor(2, 2, "storage:2 distributor:1");
// Update towards inconsistent bucket invokes safe path.
- std::shared_ptr<TwoPhaseUpdateOperation> cb(
- sendUpdate("0=1/2/3,1=2/3/4"));
+ std::shared_ptr<TwoPhaseUpdateOperation> cb(sendUpdate("0=1/2/3,1=2/3/4"));
DistributorMessageSenderStub sender;
cb->start(sender, framework::MilliSecTime(0));
@@ -823,7 +809,7 @@ TEST_F(TwoPhaseUpdateOperationTest, update_fails_if_ownership_changes_between_ge
// BUCKET_NOT_FOUND is a transient error code which should cause the client
// to re-send the operation, presumably to the correct distributor the next
// time.
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 70) "
"ReturnCode(BUCKET_NOT_FOUND, Distributor lost "
@@ -843,7 +829,7 @@ TEST_F(TwoPhaseUpdateOperationTest, safe_path_condition_mismatch_fails_with_tas_
// Newest doc has headerval==110, not 120.
replyToGet(*cb, sender, 0, 100);
replyToGet(*cb, sender, 1, 110);
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 0) "
"ReturnCode(TEST_AND_SET_CONDITION_FAILED, "
@@ -877,7 +863,7 @@ TEST_F(TwoPhaseUpdateOperationTest, safe_path_condition_parse_failure_fails_with
// NOTE: condition is currently not attempted parsed until Gets have been
// replied to. This may change in the future.
// XXX reliance on parser/exception error message is very fragile.
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 0) "
"ReturnCode(ILLEGAL_PARAMETERS, "
@@ -899,7 +885,7 @@ TEST_F(TwoPhaseUpdateOperationTest, safe_path_condition_unknown_doc_type_fails_w
replyToGet(*cb, sender, 1, 110);
// NOTE: condition is currently not attempted parsed until Gets have been
// replied to. This may change in the future.
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 0) "
"ReturnCode(ILLEGAL_PARAMETERS, "
@@ -920,7 +906,7 @@ TEST_F(TwoPhaseUpdateOperationTest, safe_path_condition_with_missing_doc_and_no_
// Both Gets return nothing at all, nothing at all.
replyToGet(*cb, sender, 0, 100, false);
replyToGet(*cb, sender, 1, 110, false);
- EXPECT_EQ("UpdateReply(doc:test:test, "
+ EXPECT_EQ("UpdateReply(id:ns:testdoctype1::1, "
"BucketId(0x0000000000000000), "
"timestamp 0, timestamp of updated doc: 0) "
"ReturnCode(TEST_AND_SET_CONDITION_FAILED, "
@@ -976,8 +962,7 @@ TEST_F(TwoPhaseUpdateOperationTest, fast_path_close_edge_sends_correct_reply) {
TEST_F(TwoPhaseUpdateOperationTest, safe_path_close_edge_sends_correct_reply) {
setupDistributor(2, 2, "storage:2 distributor:1");
- std::shared_ptr<TwoPhaseUpdateOperation> cb(
- sendUpdate("0=1/2/3,1=2/3/4")); // Inconsistent replicas.
+ std::shared_ptr<TwoPhaseUpdateOperation> cb(sendUpdate("0=1/2/3,1=2/3/4")); // Inconsistent replicas.
DistributorMessageSenderStub sender;
cb->start(sender, framework::MilliSecTime(0));
diff --git a/storage/src/tests/distributor/updateoperationtest.cpp b/storage/src/tests/distributor/updateoperationtest.cpp
index 7cf3ea0ad18..6bc000f6780 100644
--- a/storage/src/tests/distributor/updateoperationtest.cpp
+++ b/storage/src/tests/distributor/updateoperationtest.cpp
@@ -55,7 +55,7 @@ UpdateOperationTest::sendUpdate(const std::string& bucketState)
{
auto update = std::make_shared<document::DocumentUpdate>(
*_repo, *_html_type,
- document::DocumentId(document::DocIdString("test", "test")));
+ document::DocumentId("id:ns:" + _html_type->getName() + "::1"));
_bId = getExternalOperationHandler().getBucketId(update->getId());
@@ -95,7 +95,7 @@ TEST_F(UpdateOperationTest, simple) {
replyToMessage(*cb, sender, 0, 90);
- ASSERT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ ASSERT_EQ("UpdateReply(id:ns:text/html::1, BucketId(0x0000000000000000), "
"timestamp 100, timestamp of updated doc: 90) ReturnCode(NONE)",
sender.getLastReply(true));
@@ -114,7 +114,7 @@ TEST_F(UpdateOperationTest, not_found) {
replyToMessage(*cb, sender, 0, 0);
- EXPECT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ EXPECT_EQ("UpdateReply(id:ns:text/html::1, BucketId(0x0000000000000000), "
"timestamp 100, timestamp of updated doc: 0) ReturnCode(NONE)",
sender.getLastReply(true));
}
@@ -130,7 +130,7 @@ TEST_F(UpdateOperationTest, multi_node) {
replyToMessage(*cb, sender, 0, 120);
replyToMessage(*cb, sender, 1, 120);
- ASSERT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ ASSERT_EQ("UpdateReply(id:ns:text/html::1, BucketId(0x0000000000000000), "
"timestamp 100, timestamp of updated doc: 120) ReturnCode(NONE)",
sender.getLastReply(true));
@@ -154,7 +154,7 @@ TEST_F(UpdateOperationTest, multi_node_inconsistent_timestamp) {
replyToMessage(*cb, sender, 0, 119);
replyToMessage(*cb, sender, 1, 120);
- ASSERT_EQ("UpdateReply(doc:test:test, BucketId(0x0000000000000000), "
+ ASSERT_EQ("UpdateReply(id:ns:text/html::1, BucketId(0x0000000000000000), "
"timestamp 100, timestamp of updated doc: 120 Was inconsistent "
"(best node 1)) ReturnCode(NONE)",
sender.getLastReply(true));
diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
index 2a3e72b48b7..44cb92071a1 100644
--- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
+++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
@@ -474,7 +474,7 @@ TEST_F(FileStorManagerTest, flush) {
api::StorageMessageAddress address("storage", lib::NodeType::STORAGE, 3);
// Creating a document to test with
- document::DocumentId docId("doc:crawler:http://www.ntnu.no/");
+ document::DocumentId docId("id:ns:testdoctype1::crawler:http://www.ntnu.no/");
auto doc = std::make_shared<Document>(*_testdoctype1, docId);
document::BucketId bid(4000);
@@ -1767,7 +1767,7 @@ TEST_F(FileStorManagerTest, no_timestamps) {
"storage", lib::NodeType::STORAGE, 3);
// Creating a document to test with
Document::SP doc(createDocument(
- "some content", "doc:crawler:http://www.ntnu.no/").release());
+ "some content", "id:ns:testdoctype1::crawler:http://www.ntnu.no/").release());
document::BucketId bid(16, 4000);
createBucket(bid, 0);
diff --git a/storage/src/tests/persistence/testandsettest.cpp b/storage/src/tests/persistence/testandsettest.cpp
index 4c4a7c9a0be..fe10d346ba7 100644
--- a/storage/src/tests/persistence/testandsettest.cpp
+++ b/storage/src/tests/persistence/testandsettest.cpp
@@ -235,20 +235,6 @@ TEST_F(TestAndSetTest, conditional_put_to_non_existing_document_should_fail) {
EXPECT_EQ("", dumpBucket(BUCKET_ID));
}
-TEST_F(TestAndSetTest, document_with_no_type_should_fail) {
- // Conditionally replace nonexisting document
- // Fail since no document exists to match with test and set
- api::Timestamp timestamp = 0;
- document::DocumentId legacyDocId("doc:mail:3619.html");
- api::RemoveCommand remove(makeDocumentBucket(BUCKET_ID), legacyDocId, timestamp);
- setTestCondition(remove);
-
- auto code = thread->handleRemove(remove)->getResult();
- EXPECT_EQ(code.getResult(), api::ReturnCode::Result::ILLEGAL_PARAMETERS);
- EXPECT_EQ(code.getMessage(), "Document id has no doctype");
- EXPECT_EQ("", dumpBucket(BUCKET_ID));
-}
-
document::Document::SP
TestAndSetTest::createTestDocument()
{
diff --git a/storage/src/tests/storageserver/bouncertest.cpp b/storage/src/tests/storageserver/bouncertest.cpp
index 35b752fedfd..c19d8814af4 100644
--- a/storage/src/tests/storageserver/bouncertest.cpp
+++ b/storage/src/tests/storageserver/bouncertest.cpp
@@ -100,7 +100,7 @@ BouncerTest::createDummyFeedMessage(api::Timestamp timestamp,
{
auto cmd = std::make_shared<api::RemoveCommand>(
makeDocumentBucket(document::BucketId(0)),
- document::DocumentId("doc:foo:bar"),
+ document::DocumentId("id:ns:foo::bar"),
timestamp);
cmd->setPriority(priority);
return cmd;
@@ -112,7 +112,7 @@ BouncerTest::createDummyFeedMessage(api::Timestamp timestamp,
{
auto cmd = std::make_shared<api::RemoveCommand>(
document::Bucket(bucketSpace, document::BucketId(0)),
- document::DocumentId("doc:foo:bar"),
+ document::DocumentId("id:ns:foo::bar"),
timestamp);
cmd->setPriority(Priority(0));
return cmd;
diff --git a/storage/src/tests/storageserver/communicationmanagertest.cpp b/storage/src/tests/storageserver/communicationmanagertest.cpp
index b970e56343e..caee6e6ab91 100644
--- a/storage/src/tests/storageserver/communicationmanagertest.cpp
+++ b/storage/src/tests/storageserver/communicationmanagertest.cpp
@@ -32,7 +32,7 @@ struct CommunicationManagerTest : Test {
api::StorageMessage::Priority priority)
{
auto cmd = std::make_shared<api::GetCommand>(makeDocumentBucket(document::BucketId(0)),
- document::DocumentId("doc::mydoc"),
+ document::DocumentId("id:ns:mytype::mydoc"),
"[all]");
cmd->setAddress(api::StorageMessageAddress("storage", lib::NodeType::STORAGE, 1));
cmd->setPriority(priority);
@@ -69,13 +69,13 @@ TEST_F(CommunicationManagerTest, simple) {
// Send a message through from distributor to storage
auto cmd = std::make_shared<api::GetCommand>(
- makeDocumentBucket(document::BucketId(0)), document::DocumentId("doc::mydoc"), "[all]");
+ makeDocumentBucket(document::BucketId(0)), document::DocumentId("id:ns:mytype::mydoc"), "[all]");
cmd->setAddress(api::StorageMessageAddress("storage", lib::NodeType::STORAGE, 1));
distributorLink->sendUp(cmd);
storageLink->waitForMessages(1, MESSAGE_WAIT_TIME_SEC);
ASSERT_GT(storageLink->getNumCommands(), 0);
auto cmd2 = std::dynamic_pointer_cast<api::StorageCommand>(storageLink->getCommand(0));
- EXPECT_EQ("doc::mydoc", dynamic_cast<api::GetCommand&>(*cmd2).getDocumentId().toString());
+ EXPECT_EQ("id:ns:mytype::mydoc", dynamic_cast<api::GetCommand&>(*cmd2).getDocumentId().toString());
// Reply to the message
std::shared_ptr<api::StorageReply> reply(cmd2->makeReply().release());
storageLink->sendUp(reply);
diff --git a/storage/src/tests/storageserver/documentapiconvertertest.cpp b/storage/src/tests/storageserver/documentapiconvertertest.cpp
index c879f7d2779..f006277a7b6 100644
--- a/storage/src/tests/storageserver/documentapiconvertertest.cpp
+++ b/storage/src/tests/storageserver/documentapiconvertertest.cpp
@@ -22,7 +22,6 @@ using document::Bucket;
using document::BucketId;
using document::BucketSpace;
using document::DataType;
-using document::DocIdString;
using document::Document;
using document::DocumentId;
using document::DocumentTypeRepo;
@@ -124,7 +123,7 @@ TEST_F(DocumentApiConverterTest, put) {
}
TEST_F(DocumentApiConverterTest, forwarded_put) {
- auto doc = std::make_shared<Document>(_html_type, DocumentId(DocIdString("test", "test")));
+ auto doc = std::make_shared<Document>(_html_type, DocumentId("id:ns:" + _html_type.getName() + "::test"));
auto putmsg = std::make_unique<documentapi::PutDocumentMessage>(doc);
auto* putmsg_raw = putmsg.get();