Re: Bug in slot.c and are replication slots ever used at Window?
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-08-31T18:46:47Z
Lists: pgsql-hackers
Attachments
- slotpath_sync.patch (text/x-diff) patch
Hi Konstantin, On Thu, Aug 30, 2018 at 11:27:31AM -0700, Michael Paquier wrote: > It seems to me that you are right here, "path" points to > pg_replslot/$SLOTNAME/state which is a file so the fsync is incorrect. > I am not sure that we'd want to publish fsync_parent_path out of fd.c > though, so perhaps we could just save the slot path in a different > variable and use it? I have spent more time on this bug, and the code path you have pointed at is the only one having such an issue. Attached is a patch to fix the problem. It includes the sanity checks I have used to check all code paths calling fsync_fname() for both the frontend and the backend code. The checks will not be included in the final fix, still they look useful so I am planning to start a new thread on the matter as perhaps other folks have more and/or better ideas. -- Michael
Commits
-
Fix initial sync of slot parent directory when restoring status
- 113020627235 9.4.20 landed
- 02b1b01d8ed4 9.5.15 landed
- d8030c684207 9.6.11 landed
- 504f059f5a19 10.6 landed
- 680f89e5613c 11.0 landed
- caa0c6ceba1f 12.0 landed