Introduce Version Vector.
This commit is contained in:
parent
63e530fc44
commit
fc0373c2d6
|
@ -1126,4 +1126,27 @@ inline const char* transactionPriorityToString(TransactionPriority priority, boo
|
|||
throw internal_error();
|
||||
}
|
||||
|
||||
struct VersionVector {
|
||||
std::map<Tag, Version> versions;
|
||||
|
||||
VersionVector() {}
|
||||
|
||||
void setVersion(const Tag& tag, Version version) {
|
||||
versions[tag] = version;
|
||||
}
|
||||
|
||||
bool hasVersion(const Tag& tag) const {
|
||||
return versions.find(tag) != versions.end();
|
||||
}
|
||||
|
||||
Version getVersion(const Tag& tag) const {
|
||||
return versions.at(tag);
|
||||
}
|
||||
|
||||
template <class Ar>
|
||||
void serialize(Ar& ar) {
|
||||
serializer(ar, versions);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -246,6 +246,9 @@ struct MasterData : NonCopyable, ReferenceCounted<MasterData> {
|
|||
|
||||
std::vector<WorkerInterface> backupWorkers; // Recruited backup workers from cluster controller.
|
||||
|
||||
// Captures the latest commit version for each storage server in the cluster.
|
||||
VersionVector ssVersionVector;
|
||||
|
||||
CounterCollection cc;
|
||||
Counter changeCoordinatorsRequests;
|
||||
Counter getCommitVersionRequests;
|
||||
|
|
Loading…
Reference in New Issue