Make sharded txsTag gated on TLogVersion::V4.

To allow a potential 6.2 -> 6.1 rollback.
This commit is contained in:
Alex Miller 2019-07-16 19:09:53 -07:00
parent 9396eedd11
commit 95487861be
2 changed files with 13 additions and 1 deletions

View File

@ -712,6 +712,10 @@ struct ILogSystem {
virtual Tag getRandomTxsTag() const = 0;
// Returns the TLogVersion of the current generation of TLogs.
// (This only exists because getLogSystemConfig is a significantly more expensive call.)
virtual TLogVersion getTLogVersion() const = 0;
virtual void stopRejoins() = 0;
// Returns the pseudo tag to be popped for the given process class. If the
@ -760,7 +764,11 @@ struct LogPushData : NonCopyable {
}
void addTxsTag() {
next_message_tags.push_back( logSystem->getRandomTxsTag() );
if ( logSystem->getTLogVersion() >= TLogVersion::V4 ) {
next_message_tags.push_back( logSystem->getRandomTxsTag() );
} else {
next_message_tags.push_back( txsTag );
}
}
// addTag() adds a tag for the *next* message to be added

View File

@ -1236,6 +1236,10 @@ struct TagPartitionedLogSystem : ILogSystem, ReferenceCounted<TagPartitionedLogS
return Tag(tagLocalityTxs, deterministicRandom()->randomInt(0, txsTags));
}
virtual TLogVersion getTLogVersion() const {
return tLogs[0]->tLogVersion;
}
ACTOR static Future<Void> monitorLog(Reference<AsyncVar<OptionalInterface<TLogInterface>>> logServer, Reference<AsyncVar<bool>> failed) {
state Future<Void> waitFailure;
loop {