Minor configuration database bug fixes

This commit is contained in:
sfc-gh-tclinkenbeard 2021-05-11 12:00:44 -07:00
parent 21e5456230
commit fc0fbfb5dc
3 changed files with 2 additions and 4 deletions

View File

@ -24,7 +24,5 @@
ConfigKey ConfigKeyRef::decodeKey(KeyRef const& key) {
auto tuple = Tuple::unpack(key);
ASSERT(tuple.size() == 2); // TODO: Fail gracefully
ASSERT(tuple.getType(0) == Tuple::BYTES);
ASSERT(tuple.getType(1) == Tuple::BYTES);
return ConfigKeyRef(tuple.getString(0), tuple.getString(1));
}

View File

@ -172,7 +172,7 @@ class LocalConfigurationImpl {
choose {
when(wait(broadcaster->onChange())) {}
when(wait(brokenPromiseToNever(fetchChanges(self, broadcaster->get())))) {
wait(delay(0.5)); // TODO: Make knob?
wait(delay(5.0)); // TODO: Make knob?
}
when(wait(monitor)) { ASSERT(false); }
}

View File

@ -185,7 +185,7 @@ class SimpleConfigDatabaseNodeImpl {
return Void();
}
state Optional<Value> value =
wait(self->kvStore->readValue(BinaryWriter::toValue(req.key, Unversioned()).withPrefix(kvKeys.begin)));
wait(self->kvStore->readValue(BinaryWriter::toValue(req.key, IncludeVersion()).withPrefix(kvKeys.begin)));
Standalone<VectorRef<VersionedConfigMutationRef>> versionedMutations = wait(getMutations(self, 0, req.version));
for (const auto &versionedMutation : versionedMutations) {
const auto &mutation = versionedMutation.mutation;