Fix multiple compiler warnings

This commit is contained in:
Markus Pilman 2021-03-03 10:18:03 -07:00
parent f83423c968
commit 37d9e975e9
6 changed files with 9 additions and 10 deletions

View File

@ -697,7 +697,7 @@ void MultiVersionTransaction::reset() {
// MultiVersionDatabase // MultiVersionDatabase
MultiVersionDatabase::MultiVersionDatabase(MultiVersionApi* api, int threadIdx, std::string clusterFilePath, MultiVersionDatabase::MultiVersionDatabase(MultiVersionApi* api, int threadIdx, std::string clusterFilePath,
Reference<IDatabase> db, bool openConnectors) Reference<IDatabase> db, bool openConnectors)
: dbState(new DatabaseState()), threadIdx(threadIdx) { : dbState(new DatabaseState()) {
dbState->db = db; dbState->db = db;
dbState->dbVar->set(db); dbState->dbVar->set(db);

View File

@ -369,7 +369,6 @@ private:
}; };
const Reference<DatabaseState> dbState; const Reference<DatabaseState> dbState;
const int threadIdx;
friend class MultiVersionTransaction; friend class MultiVersionTransaction;
}; };

View File

@ -55,7 +55,7 @@ const Value keyServersValue( Standalone<RangeResultRef> result, const std::vecto
std::vector<Tag> destTag; std::vector<Tag> destTag;
bool foundOldLocality = false; bool foundOldLocality = false;
for (const KeyValueRef kv : result) { for (const KeyValueRef& kv : result) {
UID uid = decodeServerTagKey(kv.key); UID uid = decodeServerTagKey(kv.key);
if (std::find(src.begin(), src.end(), uid) != src.end()) { if (std::find(src.begin(), src.end(), uid) != src.end()) {
srcTag.push_back( decodeServerTagValue(kv.value) ); srcTag.push_back( decodeServerTagValue(kv.value) );
@ -107,7 +107,7 @@ void decodeKeyServersValue( Standalone<RangeResultRef> result, const ValueRef& v
src.clear(); src.clear();
dest.clear(); dest.clear();
for (const KeyValueRef kv : result) { for (const KeyValueRef& kv : result) {
Tag tag = decodeServerTagValue(kv.value); Tag tag = decodeServerTagValue(kv.value);
if (std::find(srcTag.begin(), srcTag.end(), tag) != srcTag.end()) { if (std::find(srcTag.begin(), srcTag.end(), tag) != srcTag.end()) {
src.push_back( decodeServerTagKey(kv.key) ); src.push_back( decodeServerTagKey(kv.key) );
@ -120,7 +120,7 @@ void decodeKeyServersValue( Standalone<RangeResultRef> result, const ValueRef& v
std::sort(dest.begin(), dest.end()); std::sort(dest.begin(), dest.end());
if(missingIsError && (src.size() != srcTag.size() || dest.size() != destTag.size())) { if(missingIsError && (src.size() != srcTag.size() || dest.size() != destTag.size())) {
TraceEvent(SevError, "AttemptedToDecodeMissingTag"); TraceEvent(SevError, "AttemptedToDecodeMissingTag");
for (const KeyValueRef kv : result) { for (const KeyValueRef& kv : result) {
Tag tag = decodeServerTagValue(kv.value); Tag tag = decodeServerTagValue(kv.value);
UID serverID = decodeServerTagKey(kv.key); UID serverID = decodeServerTagKey(kv.key);
TraceEvent("TagUIDMap").detail("Tag", tag.toString()).detail("UID", serverID.toString()); TraceEvent("TagUIDMap").detail("Tag", tag.toString()).detail("UID", serverID.toString());

View File

@ -121,7 +121,7 @@ std::map<std::tuple<LogEpoch, Version, int>, std::map<Tag, Version>> BackupProgr
} }
} }
for (const Tag tag : tags) { // tags without progress data for (const Tag& tag : tags) { // tags without progress data
tagVersions.insert({ tag, adjustedBeginVersion }); tagVersions.insert({ tag, adjustedBeginVersion });
TraceEvent("BackupVersionRange", dbgid) TraceEvent("BackupVersionRange", dbgid)
.detail("OldEpoch", epoch) .detail("OldEpoch", epoch)

View File

@ -504,7 +504,7 @@ ACTOR Future<Void> setBackupKeys(BackupData* self, std::map<UID, Version> savedL
state std::vector<Future<Optional<Version>>> prevVersions; state std::vector<Future<Optional<Version>>> prevVersions;
state std::vector<BackupConfig> versionConfigs; state std::vector<BackupConfig> versionConfigs;
state std::vector<Future<Optional<bool>>> allWorkersReady; state std::vector<Future<Optional<bool>>> allWorkersReady;
for (const auto [uid, version] : savedLogVersions) { for (const auto& [uid, version] : savedLogVersions) {
versionConfigs.emplace_back(uid); versionConfigs.emplace_back(uid);
prevVersions.push_back(versionConfigs.back().latestBackupWorkerSavedVersion().get(tr)); prevVersions.push_back(versionConfigs.back().latestBackupWorkerSavedVersion().get(tr));
allWorkersReady.push_back(versionConfigs.back().allWorkerStarted().get(tr)); allWorkersReady.push_back(versionConfigs.back().allWorkerStarted().get(tr));
@ -569,7 +569,7 @@ ACTOR Future<Void> monitorBackupProgress(BackupData* self) {
if (self->recruitedEpoch == self->oldestBackupEpoch) { if (self->recruitedEpoch == self->oldestBackupEpoch) {
// update update progress so far if previous epochs are done // update update progress so far if previous epochs are done
Version v = std::numeric_limits<Version>::max(); Version v = std::numeric_limits<Version>::max();
for (const auto [tag, version] : tagVersions) { for (const auto& [tag, version] : tagVersions) {
v = std::min(v, version); v = std::min(v, version);
} }
savedLogVersions.emplace(uid, v); savedLogVersions.emplace(uid, v);
@ -781,7 +781,7 @@ ACTOR Future<Void> saveMutationsToFile(BackupData* self, Version popVersion, int
.detail("TagId", self->tag.id) .detail("TagId", self->tag.id)
.detail("File", file->getFileName()); .detail("File", file->getFileName());
} }
for (const UID uid : activeUids) { for (const UID& uid : activeUids) {
self->backups[uid].lastSavedVersion = popVersion + 1; self->backups[uid].lastSavedVersion = popVersion + 1;
} }

View File

@ -2294,7 +2294,7 @@ ACTOR Future<Void> masterProxyServerCore(
state KeyRange txnKeys = allKeys; state KeyRange txnKeys = allKeys;
Standalone<RangeResultRef> UIDtoTagMap = commitData.txnStateStore->readRange( serverTagKeys ).get(); Standalone<RangeResultRef> UIDtoTagMap = commitData.txnStateStore->readRange( serverTagKeys ).get();
state std::map<Tag, UID> tag_uid; state std::map<Tag, UID> tag_uid;
for (const KeyValueRef kv : UIDtoTagMap) { for (const KeyValueRef& kv : UIDtoTagMap) {
tag_uid[decodeServerTagValue(kv.value)] = decodeServerTagKey(kv.key); tag_uid[decodeServerTagValue(kv.value)] = decodeServerTagKey(kv.key);
} }
loop { loop {