Fix subtle replication bug (#1370)

When going from REPLICA to MAIN, need to ensure current WAL files are
finalised.
This commit is contained in:
Gareth Andrew Lloyd 2023-10-16 21:56:56 +01:00 committed by GitHub
parent 9524a51576
commit 64bf75117b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ bool ReplicationHandler::SetReplicationRoleMain() {
// ensure replica server brought down
storage_.repl_storage_state_.replication_server_.reset(nullptr);
// Remember old epoch + storage timestamp association
storage_.repl_storage_state_.AddEpochToHistory(current_epoch);
storage_.PrepareForNewEpoch(current_epoch);
}
// STEP 2) Change to MAIN