off by one

This commit is contained in:
Josh Slocum 2022-03-10 12:11:44 -06:00
parent d7367dad99
commit ba35e7908a
1 changed files with 5 additions and 4 deletions

View File

@ -945,10 +945,11 @@ ACTOR Future<Void> maybeSplitRange(Reference<BlobManagerData> bmData,
// Something was previously committed, we must go with that decision. // Something was previously committed, we must go with that decision.
// Read its boundaries and override our planned split boundaries // Read its boundaries and override our planned split boundaries
TEST(true); // Overriding split ranges with existing ones from DB TEST(true); // Overriding split ranges with existing ones from DB
RangeResult existingBoundaries = wait(tr->getRange( RangeResult existingBoundaries =
KeyRangeRef(granuleRange.begin.withPrefix(blobGranuleMappingKeys.begin), wait(tr->getRange(KeyRangeRef(granuleRange.begin.withPrefix(blobGranuleMappingKeys.begin),
keyAfter(granuleRange.end).withPrefix(blobGranuleMappingKeys.begin)), keyAfter(granuleRange.end).withPrefix(blobGranuleMappingKeys.begin)),
existingState.size() + 1)); // +1 because this is boundaries and existingState was granules existingState.size() + 2));
// +2 because this is boundaries and existingState was granules, and to ensure it doesn't set more
ASSERT(!existingBoundaries.more); ASSERT(!existingBoundaries.more);
ASSERT(existingBoundaries.size() == existingState.size() + 1); ASSERT(existingBoundaries.size() == existingState.size() + 1);
newRanges.clear(); newRanges.clear();