mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-03 03:41:53 +08:00
- Address a review comment
This commit is contained in:
parent
a3c6ed2e86
commit
3ec76b4b53
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user