Skip to content

Commit

Permalink
check unknown epoch number during replication
Browse files Browse the repository at this point in the history
  • Loading branch information
seckcoder committed Aug 22, 2023
1 parent 112d771 commit ed8cb20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions db/db_impl/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1539,8 +1539,12 @@ Status DBImpl::ApplyReplicationLogRecord(ReplicationLogRecord record,
auto epoch_number = p.second.epoch_number;
// advance next epoch number. next_epoch_number never goes
// backwards
if (epoch_number != kUnknownEpochNumber &&
(epoch_number >= next_epoch_number)) {
if (epoch_number == kUnknownEpochNumber) {
epoch_recovery_succeeded = false;
err_oss << "Unknown epoch number during replication";
break;
}
if (epoch_number >= next_epoch_number) {
next_epoch_number = epoch_number + 1;
}
}
Expand Down

0 comments on commit ed8cb20

Please sign in to comment.