- Address a review comment

This commit is contained in:
Sreenath Bodagala 2022-06-03 21:20:32 +00:00
parent a3c6ed2e86
commit 3ec76b4b53

View File

@ -66,6 +66,8 @@ struct MasterData : NonCopyable, ReferenceCounted<MasterData> {
// up-to-date in the presence of key range splits/merges.
VersionVector ssVersionVector;
int8_t locality; // sequencer locality
CounterCollection cc;
Counter getCommitVersionRequests;
Counter getLiveCommittedVersionRequests;
@ -115,6 +117,8 @@ struct MasterData : NonCopyable, ReferenceCounted<MasterData> {
forceRecovery = false;
}
balancer = resolutionBalancer.resolutionBalancing();
locality = myInterface.locality.dcId().present() ? std::stoi(myInterface.locality.dcId().get().toString())
: tagLocalityInvalid;
}
~MasterData() = default;
};
@ -241,10 +245,8 @@ void updateLiveCommittedVersion(Reference<MasterData> self, ReportRawCommittedVe
if (req.version > self->liveCommittedVersion.get()) {
if (SERVER_KNOBS->ENABLE_VERSION_VECTOR && req.writtenTags.present()) {
// TraceEvent("Received ReportRawCommittedVersionRequest").detail("Version",req.version);
int8_t primaryLocality = tagLocalityInvalid;
if (SERVER_KNOBS->ENABLE_VERSION_VECTOR_HA_OPTIMIZATION && self->myInterface.locality.dcId().present()) {
primaryLocality = std::stoi(self->myInterface.locality.dcId().get().toString());
}
int8_t primaryLocality =
SERVER_KNOBS->ENABLE_VERSION_VECTOR_HA_OPTIMIZATION ? self->locality : tagLocalityInvalid;
self->ssVersionVector.setVersion(req.writtenTags.get(), req.version, primaryLocality);
self->versionVectorTagUpdates += req.writtenTags.get().size();
}