Re: WAL segments removed from primary despite the fact that logical replication slot needs it.

hubert depesz lubaczewski <depesz@depesz.com>

From: hubert depesz lubaczewski <depesz@depesz.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-bugs mailing list <pgsql-bugs@postgresql.org>
Date: 2022-10-19T11:09:46Z
Lists: pgsql-bugs

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix a possibility of logical replication slot's restart_lsn going backwards.

On Wed, Oct 19, 2022 at 04:14:28PM +0530, Amit Kapila wrote:
> One idea is to change log level to DEBUG2 so that we can print which
> files are removed by the server via
> RemoveOldXlogFiles()
> {
> ...
> elog(DEBUG2, "attempting to remove WAL segments older than log file %s",
> lastoff);
> ...
> }
> 
> If we can do this then at the very least we can know whether the
> required files are removed by the server or by some external
> application.

That should be doable. Will take some time to setup test env, and run
it. Will get back to you on this.

Best regards,

depesz