Skip to content

Commit

Permalink
Fix bug in RocksDB incremental collection sync for empty colls. (#3207)
Browse files Browse the repository at this point in the history
Also: Make hash computations for chunks independent.
  • Loading branch information
neunhoef committed Sep 6, 2017
1 parent eacad99 commit 98e6484
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arangod/RocksDBEngine/RocksDBReplicationContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,17 @@ arangodb::Result RocksDBReplicationContext::dumpKeyChunks(VPackBuilder& b,
try {
_hasMore = _iter->next(cb, chunkSize);

if (lowKey.empty()) {
// if lowKey is empty, no new documents were found
break;
}
b.add(VPackValue(VPackValueType::Object));
b.add("low", VPackValue(lowKey));
b.add("high", VPackValue(highKey.copyString()));
b.add("hash", VPackValue(std::to_string(hash)));
b.close();
lowKey.clear(); // reset string
hash = 0x012345678; // the next block ought to start with a clean sheet
} catch (std::exception const&) {
return rv.reset(TRI_ERROR_INTERNAL);
}
Expand Down

0 comments on commit 98e6484

Please sign in to comment.