Fix bug and add test

This commit is contained in:
Andrew Noyes 2020-05-09 02:46:40 +00:00
parent c6c0e2eb0f
commit a53d05ea2d
2 changed files with 12 additions and 2 deletions

View File

@ -96,9 +96,12 @@ ACTOR Future<Standalone<RangeResultRef>> SpecialKeySpace::checkModuleFound(Speci
GetRangeLimits limits, bool reverse) {
std::pair<Standalone<RangeResultRef>, Optional<SpecialKeyRangeBaseImpl*>> result =
wait(SpecialKeySpace::getRangeAggregationActor(pks, ryw, begin, end, limits, reverse));
if (ryw && !ryw->specialKeySpaceRelaxed() && !result.second.present()) {
if (ryw && !ryw->specialKeySpaceRelaxed()) {
auto* module = result.second.orDefault(nullptr);
if (module == nullptr) {
throw special_keys_no_module_found();
}
}
return result.first;
}

View File

@ -270,6 +270,13 @@ struct SpecialKeySpaceCorrectnessWorkload : TestWorkload {
}
TEST(true); // Read write conflict range of committed transaction
}
try {
wait(success(tx->get(LiteralStringRef("\xff\xff/1314109/i_hope_this_isn't_registered"))));
ASSERT(false);
} catch (Error& e) {
if (e.code() == error_code_actor_cancelled) throw;
ASSERT(e.code() == error_code_special_keys_no_module_found);
}
for (int i = 0; i < self->conflictRangeSizeFactor; ++i) {
GetRangeLimits limit;
KeySelector begin;