Renamed SystemDBLockWriteNow() to SystemDBWriteLockedNow() and changed definition to be more direct / clear.

This commit is contained in:
Steve Atherton 2023-04-22 13:17:41 -07:00
parent dd334f1b02
commit c57ed25987
5 changed files with 7 additions and 7 deletions

View File

@ -73,7 +73,7 @@ ACTOR Future<bool> rangeConfigCommandActor(Database cx, std::vector<StringRef> t
}
DDConfiguration::RangeConfigMapSnapshot config = wait(DDConfiguration().userRangeConfig().getSnapshot(
SystemDBLockWriteNow(cx.getReference()), allKeys.begin, allKeys.end));
SystemDBWriteLockedNow(cx.getReference()), allKeys.begin, allKeys.end));
fmt::print(
"{}\n",
json_spirit::write_string(DDConfiguration::toJSON(config, includeDefault), json_spirit::pretty_print));
@ -110,7 +110,7 @@ ACTOR Future<bool> rangeConfigCommandActor(Database cx, std::vector<StringRef> t
}
wait(DDConfiguration().userRangeConfig().updateRange(
SystemDBLockWriteNow(cx.getReference()), begin, end, rangeConfig, cmd == "set"_sr));
SystemDBWriteLockedNow(cx.getReference()), begin, end, rangeConfig, cmd == "set"_sr));
}
} else {
return fail(fmt::format("Unknown command: '{}'", cmd.printable()));

View File

@ -128,8 +128,8 @@ auto SystemDB(Reference<DB> db, bool write = false, bool lockAware = false, bool
// SystemDB with all options true
template <typename DB>
auto SystemDBLockWriteNow(Reference<DB> db) {
return SystemDB(db, true, true, true);
auto SystemDBWriteLockedNow(Reference<DB> db) {
return makeReference<SystemTransactionGenerator<DB>>(db, true, true, true);
}
#include "flow/unactorcompiler.h"

View File

@ -443,7 +443,7 @@ ACTOR Future<Void> checkDataConsistency(Database cx,
state DDConfiguration::RangeConfigMapSnapshot userRangeConfig =
wait(DDConfiguration().userRangeConfig().getSnapshot(
SystemDBLockWriteNow(cx.getReference()), allKeys.begin, allKeys.end));
SystemDBWriteLockedNow(cx.getReference()), allKeys.begin, allKeys.end));
for (; i < ranges.size(); i++) {
state int shard = shardOrder[i];

View File

@ -245,7 +245,7 @@ class DDTxnProcessorImpl {
if (ddLargeTeamEnabled()) {
wait(store(*result->userRangeConfig,
DDConfiguration().userRangeConfig().getSnapshot(
SystemDBLockWriteNow(cx.getReference()), allKeys.begin, allKeys.end)));
SystemDBWriteLockedNow(cx.getReference()), allKeys.begin, allKeys.end)));
}
state std::map<UID, Optional<Key>> server_dc;
state std::map<std::vector<UID>, std::pair<std::vector<UID>, std::vector<UID>>> team_cache;

View File

@ -721,7 +721,7 @@ ACTOR Future<Void> dataDistribution(Reference<DataDistributor> self,
// Start watching for changes before reading the config in init() below
state Promise<Version> configChangeWatching;
state Future<Void> onConfigChange =
map(DDConfiguration().trigger.onChange(SystemDBLockWriteNow(cx.getReference()), {}, configChangeWatching),
map(DDConfiguration().trigger.onChange(SystemDBWriteLockedNow(cx.getReference()), {}, configChangeWatching),
[](Version v) {
CODE_PROBE(true, "DataDistribution change detected");
TraceEvent("DataDistributionConfigChanged").detail("ChangeVersion", v);