8000 make cid values in /_api/replication/logger-follow strings as advertised by jsteemann · Pull Request #6499 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

make cid values in /_api/replication/logger-follow strings as advertised #6499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions arangod/MMFiles/mmfiles-replication-dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ static int SliceifyMarker(MMFilesReplicationDumpContext* dump,
type == TRI_DF_MARKER_VPACK_COMMIT_TRANSACTION ||
type == TRI_DF_MARKER_VPACK_ABORT_TRANSACTION) {
// transaction id
builder.add("tid", VPackValue(MMFilesDatafileHelper::TransactionId(marker)));
builder.add("tid", VPackValue(std::to_string(MMFilesDatafileHelper::TransactionId(marker))));
}
if (databaseId > 0) {
builder.add("database", VPackValue(databaseId));
builder.add("database", VPackValue(std::to_string(databaseId)));
if (collectionId > 0) {
builder.add("cid", VPackValue(collectionId));
builder.add("cid", VPackValue(std::to_string(collectionId)));
// also include collection name
std::string const& cname = nameFromCid(dump, collectionId);
if (!cname.empty()) {
Expand All @@ -246,7 +246,7 @@ static int SliceifyMarker(MMFilesReplicationDumpContext* dump,
} else {
// collection dump
if (withTicks) {
builder.add("tick", VPackValue(static_cast<uint64_t>(marker->getTick())));
builder.add("tick", VPackValue(std::to_string(static_cast<uint64_t>(marker->getTick()))));
}
builder.add("type",
VPackValue(static_cast<uint64_t>(TranslateType(marker))));
Expand Down
2 changes: 1 addition & 1 deletion arangod/RocksDBEngine/RocksDBReplicationTailing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ class WALParser final : public rocksdb::WriteBatch::Handler {
marker->add("type", VPackValue(REPLICATION_MARKER_DOCUMENT));
marker->add("database", VPackValue(std::to_string(dbid)));
marker->add("tid", VPackValue(std::to_string(_currentTrxId)));
marker->add("cid", VPackValue(cid));
marker->add("cid", VPackValue(std::to_string(cid)));
marker->add("cname", VPackValue(col->name()));
marker->add("data", RocksDBValue::data(value));
}
Expand Down
6 changes: 6 additions & 0 deletions tests/rb/HttpReplication/api-replication-global-spec.rb 8000
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@
c.should have_key("version")
c["type"].should eq(2)
c["cid"].should eq(cid)
c["cid"].should be_kind_of(String)
c["globallyUniqueId"].should eq(cuid)
c["deleted"].should eq(false)
c["name"].should eq("UnitTestsReplication")
Expand Down Expand Up @@ -463,6 +464,7 @@
c.should have_key("version")
c["type"].should eq(2)
c["cid"].should eq(cid)
c["cid"].should be_kind_of(String)
c["globallyUniqueId"].should eq(cuid)
c["deleted"].should eq(false)
c["name"].should eq("UnitTestsReplication")
Expand Down Expand Up @@ -900,6 +902,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(2)
parameters["cid"].should eq(cid)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication")
parameters["waitForSync"].should eq(false)
Expand All @@ -919,6 +922,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(3)
parameters["cid"].should eq(cid2)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication2")
parameters["waitForSync"].should eq(true)
Expand Down Expand Up @@ -985,6 +989,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(2)
parameters["cid"].should eq(cid)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication")
parameters["waitForSync"].should eq(false)
Expand Down Expand Up @@ -1017,6 +1022,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(2)
parameters["cid"].should eq(cid2)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication2")
parameters["waitForSync"].should eq(false)
Expand Down
22 changes: 22 additions & 0 deletions tests/rb/HttpReplication/api-replication-rocksdb-spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,14 @@
document["tick"].to_i.should >= fromTick.to_i
document["type"].should eq(2000)
document["cid"].should eq(cid)
document["cid"].should be_kind_of(String)
document["cname"].should eq("UnitTestsReplication")

c = document["data"]
c.should have_key("version")
c["type"].should eq(2)
c["cid"].should eq(cid)
c["cid"].should be_kind_of(String)
c["deleted"].should eq(false)
c["name"].should eq("UnitTestsReplication")
c["waitForSync"].should eq(true)
Expand Down Expand Up @@ -471,12 +473,14 @@
document["tick"].to_i.should >= fromTick.to_i
document["type"].should eq(2000)
document["cid"].should eq(cid)
document["cid"].should be_kind_of(String)
document["cname"].should eq("UnitTestsReplication")

c = document["data"]
c.should have_key("version")
c["type"].should eq(2)
c["cid"].should eq(cid)
c["cid"].should be_kind_of(String)
c["deleted"].should eq(false)
c["name"].should eq("UnitTestsReplication")
c["waitForSync"].should eq(true)
Expand All @@ -494,6 +498,7 @@
document["tick"].to_i.should >= fromTick.to_i
document["type"].should eq(2300)
document["cid"].should eq(cid)
document["cid"].should be_kind_of(String)
document["data"]["_key"].should eq("test")
document["data"]["_rev"].should match(/^[a-zA-Z0-9_\-]+$/)
document["data"]["_rev"].should_not eq("0")
Expand All @@ -510,6 +515,7 @@
document["tick"].to_i.should >= fromTick.to_i
document["type"].should eq(2302)
document["cid"].should eq(cid)
document["cid"].should be_kind_of(String)
document["data"]["_key"].should eq("test")

i = i + 1
Expand All @@ -523,6 +529,7 @@
document["tick"].to_i.should >= fromTick.to_i
document["type"].should eq(2001)
document["cid"].should eq(cid)
document["cid"].should be_kind_of(String)

i = i + 1
end
Expand Down Expand Up @@ -654,6 +661,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(2)
parameters["cid"].should eq(cid)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication")
parameters["waitForSync"].should eq(false)
Expand All @@ -671,6 +679,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(3)
parameters["cid"].should eq(cid2)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication2")
parameters["waitForSync"].should eq(true)
Expand Down Expand Up @@ -728,6 +737,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(2)
parameters["cid"].should eq(cid)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication")
parameters["waitForSync"].should eq(false)
Expand Down Expand Up @@ -758,6 +768,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(2)
parameters["cid"].should eq(cid2)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication2")
parameters["waitForSync"].should eq(false)
Expand Down Expand Up @@ -1508,12 +1519,14 @@
document["tick"].to_i.should >= fromTick.to_i
document["type"].should eq(2000)
document["cid"].should eq(cid)
document["cid"].should be_kind_of(String)
document["cname"].should eq("UnitTestsReplication")

c = document["data"]
c.should have_key("version")
c["type"].should eq(2)
c["cid"].should eq(cid)
c["cid"].should be_kind_of(String)
c["deleted"].should eq(false)
c["name"].should eq("UnitTestsReplication")
c["waitForSync"].should eq(true)
Expand Down Expand Up @@ -1589,12 +1602,14 @@
document["tick"].to_i.should >= fromTick.to_i
document["type"].should eq(2000)
document["cid"].should eq(cid)
document["cid"].should be_kind_of(String)
document["cname"].should eq("UnitTestsReplication")

c = document["data"]
c.should have_key("version")
c["type"].should eq(2)
c["cid"].should eq(cid)
c["cid"].should be_kind_of(String)
c["deleted"].should eq(false)
c["name"].should eq("UnitTestsReplication")
c["waitForSync"].should eq(true)
Expand All @@ -1612,6 +1627,7 @@
document["tick"].to_i.should >= fromTick.to_i
document["type"].should eq(2300)
document["cid"].should eq(cid)
document["cid"].should be_kind_of(String)
document["data"]["_key"].should eq("test")
document["data"]["_rev"].should match(/^[a-zA-Z0-9_\-]+$/)
document["data"]["_rev"].should_not eq("0")
Expand All @@ -1628,6 +1644,7 @@
document["tick"].to_i.should >= fromTick.to_i
document["type"].should eq(2302)
document["cid"].should eq(cid)
document["cid"].should be_kind_of(String)
document["data"]["_key"].should eq("test")

i = i + 1
Expand All @@ -1641,6 +1658,7 @@
document["tick"].to_i.should >= fromTick.to_i
document["type"].should eq(2001)
document["cid"].should eq(cid)
document["cid"].should be_kind_of(String)

i = i + 1
end
Expand Down Expand Up @@ -1772,6 +1790,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(2)
parameters["cid"].should eq(cid)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication")
parameters["waitForSync"].should eq(false)
Expand All @@ -1789,6 +1808,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(3)
parameters["cid"].should eq(cid2)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication2")
parameters["waitForSync"].should eq(true)
Expand Down Expand Up @@ -1856,6 +1876,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(2)
parameters["cid"].should eq(cid)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication")
parameters["waitForSync"].should eq(false)
Expand Down Expand Up @@ -1886,6 +1907,7 @@
parameters["type"].should be_kind_of(Integer)
parameters["type"].should eq(2)
parameters["cid"].should eq(cid2)
parameters["cid"].should be_kind_of(String)
parameters["deleted"].should eq(false)
parameters["name"].should eq("UnitTestsReplication2")
parameters["waitForSync"].should eq(false)
Expand Down
0