Use from_timestamp for WAL retention (#240)
This commit is contained in:
parent
9f855676cb
commit
b94e50bf1c
@ -274,13 +274,13 @@ std::optional<RecoveryInfo> RecoverData(const std::filesystem::path &snapshot_di
|
||||
LOG_FATAL(
|
||||
"There are missing prefix WAL files and data can't be "
|
||||
"recovered without them!");
|
||||
} else if (first_wal.to_timestamp >= *snapshot_timestamp) {
|
||||
} else if (first_wal.from_timestamp >= *snapshot_timestamp) {
|
||||
// We recovered from a snapshot and we must have at least one WAL file
|
||||
// whose all deltas were created before the snapshot in order to
|
||||
// that has at least one delta that was created before the snapshot in order to
|
||||
// verify that nothing is missing from the beginning of the WAL chain.
|
||||
LOG_FATAL(
|
||||
"You must have at least one WAL file that contains "
|
||||
"deltas that were created before the snapshot file!");
|
||||
"You must have at least one WAL file that contains at least one "
|
||||
"delta that was created before the snapshot file!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -946,7 +946,7 @@ void CreateSnapshot(Transaction *transaction, const std::filesystem::path &snaps
|
||||
std::optional<uint64_t> pos = 0;
|
||||
for (uint64_t i = 0; i < wal_files.size(); ++i) {
|
||||
const auto &[seq_num, from_timestamp, to_timestamp, wal_path] = wal_files[i];
|
||||
if (to_timestamp <= snapshot_start_timestamp) {
|
||||
if (from_timestamp <= snapshot_start_timestamp) {
|
||||
pos = i;
|
||||
} else {
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user