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-11-17T15:55:34Z
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 →
-
Fix a possibility of logical replication slot's restart_lsn going backwards.
- e5ed873b1b4a 18.0 landed
- 568e78a653ee 17.2 landed
- f353911337cf 16.6 landed
- 91771b3fbbc3 15.10 landed
- 26c4e8968690 14.15 landed
- 15dc1abb17dd 13.18 landed
On Mon, Nov 14, 2022 at 05:08:15PM +0530, Amit Kapila wrote: > You may have the LOG for "attempting to remove WAL segments older than > log file %s", if so, please share. Also on similar lines, I think we > need to add some LOGs before calling RemoveOldXlogFiles() to know > where our computation to remove files goes off. Something, like the > attached, would be helpful but note I have added this quickly on my > working branch to show you what I have in mind. You may need small > changes based on the branch you are working on. Hi, I tried to apply it on pg12.12, both clean from https://www.postgresql.org/ftp/source/v12.12/ and one that is being built for pgdg .deb for 12.12, and in both cases it failed. Current state of xlog.c from the deb building (which is what I have to build) is available at https://depesz.com/various/xlog.c.xz I don't trust myself with modifing patches in C - any chance I could ask you to check why it doesn't apply, and possibly make new one that applies on pg12? I tried to see what is going on there, but you have in patch lines that I don't see in my version of xlog.c, so I'm not sure what to do with it. The procedure I followed to get this xlog.c in this form was: dget -x https://apt-archive.postgresql.org/pub/repos/apt/pool/main/p/postgresql-12/postgresql-12_12.1-2.pgdg100%2B1.dsc dpkg-source -x postgresql-12_12.1-2.pgdg100%2B1.dsc cd postgresql-12-12.1/ sudo apt build-dep . quilt push -a and I think that was it. Best regards, depesz