From 9b4cbe94aa28fc8ea3385f2ebbae6cad4d456f57 Mon Sep 17 00:00:00 2001 From: Stephen Atherton Date: Tue, 19 Sep 2017 13:03:30 -0700 Subject: [PATCH] Bug fix, values exactly the size of the maximum part size were still split into a part set but of size 1, which is invalid. Also some debug output changes. --- fdbserver/VersionedBTree.actor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fdbserver/VersionedBTree.actor.cpp b/fdbserver/VersionedBTree.actor.cpp index df47418632..8029d799d9 100755 --- a/fdbserver/VersionedBTree.actor.cpp +++ b/fdbserver/VersionedBTree.actor.cpp @@ -188,7 +188,8 @@ struct KeyVersionValue { } std::string toString() const { - return format("'%s' -> '%s' @%lld [%lld]", key.toString().c_str(), value.present() ? value.get().toString().c_str() : "", version, valueIndex); + //return format("'%s' -> '%s' @%lld [%lld]", key.toString().c_str(), value.present() ? value.get().toString().c_str() : "", version, valueIndex); + return format("'%s' -> %d bytes @%lld [%lld]", key.toString().c_str(), value.present() ? (int)value.get().size() : -1, version, valueIndex); } }; @@ -627,7 +628,7 @@ private: // ( (page_size - map_overhead) / min_kvpairs_per_leaf ) - kvpair_overhead_est - keybytes int maxPartSize = ((self->m_pageSize - 1 - 4) / 3) - 21 - iMutationBoundary->first.size(); ASSERT(maxPartSize > 0); - if(m.isClear() || m.value.size() < maxPartSize) { + if(m.isClear() || m.value.size() <= maxPartSize) { if(iMutations->first < minVersion || minVersion == invalidVersion) minVersion = iMutations->first; merged.push_back(iMutations->second.toKVV(iMutationBoundary->first, iMutations->first).pack()); @@ -1399,6 +1400,7 @@ ACTOR Future verifyRandomRange(VersionedBTree *btree, Version v, std::mapfirst.second, iLast->first.first.c_str()); } + debug_printf("VerifyRangeReverse '%s' to '%s' @%lld\n", printable(start).c_str(), printable(end).c_str(), v); // Randomly use a new cursor for the revere range read if(g_random->coinflip()) { cur = btree->readAtVersion(v);