Checkpoint replication slots later - Mailing list pgsql-hackers

From Ants Aasma
Subject Checkpoint replication slots later
Date
Msg-id CANwKhkPCBcTQ_pk06MD5W5YYNnuYHp8dLNuOUz8-5pMBMPY1Bw@mail.gmail.com
Whole thread
List pgsql-hackers
Hi,

Right now replication slots are synced close to the beginning of CheckpointGuts(). Importantly, before CheckPointBuffers() which for spread checkpoints might take most of checkpoint_timeout to complete. This is a problem because this function calculates how much WAL to keep around in ReplicationSlotsComputeRequiredLSN(). By the time RemoveOldXlogFiles() gets called this information might be quite stale and we hold onto many WAL files unnecessarily until the next checkpoint cycle.

As far as I could tell there is no reason for this to happen early, so in the attached patched I just moved it down closer to the end.

Regards,
Ants Aasma
Attachment

pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: Include schema-qualified names in publication error messages.
Next
From: Alexander Korotkov
Date:
Subject: Re: Fix bug with accessing to temporary tables of other sessions