Merge pull request #6991 from sfc-gh-etschannen/fix-recovery-version
fix: when more tlogs are absent than the replication factor we would access invalid memory
This commit is contained in:
commit
2887429f42
|
@ -1908,7 +1908,7 @@ Optional<std::tuple<Version, Version, std::vector<TLogLockResult>>> TagPartition
|
|||
int absent = logSet->logServers.size() - results.size();
|
||||
int safe_range_begin = logSet->tLogWriteAntiQuorum;
|
||||
int new_safe_range_begin = std::min(logSet->tLogWriteAntiQuorum, (int)(results.size() - 1));
|
||||
int safe_range_end = logSet->tLogReplicationFactor - absent;
|
||||
int safe_range_end = std::max(logSet->tLogReplicationFactor - absent, 1);
|
||||
|
||||
if (!lastEnd.present() || ((safe_range_end > 0) && (safe_range_end - 1 < results.size()) &&
|
||||
results[safe_range_end - 1].end < lastEnd.get())) {
|
||||
|
|
Loading…
Reference in New Issue