Fix inaccurate comment on how often we checkpoint the repository.

This commit is contained in:
Heikki Linnakangas
2021-07-10 18:30:47 +03:00
parent 3e69c41a47
commit 19528de03e

View File

@@ -198,13 +198,14 @@ fn walreceiver_main(
// flush ptr.
timeline.advance_last_valid_lsn(endlsn);
// Somewhat arbitrarily, if we have at least 10 complete wal segments (16 MB each),
// Somewhat arbitrarily, if we have at least one complete wal segment (16 MB each),
// "checkpoint" the repository to flush all the changes from WAL we've processed
// so far to disk. After this, we don't need the original WAL anymore, and it
// can be removed.
// can be removed. This is probably too aggressive for production, but it's useful
// to expose bugs now.
//
// TODO: We don't actually dare to remove the WAL. It's useful for debugging,
// and we might it for logical decoiding other things in the future. Although
// and we might it for logical decoding other things in the future. Although
// we should also be able to fetch it back from the WAL safekeepers or S3 if
// needed.
if prev_last_rec_lsn.segment_number(pg_constants::WAL_SEGMENT_SIZE)