Hi Gilles, On Wed, 23 Mar 2016 23:22:26 +0100 Gilles Darold <gilles.dar...@dalibo.com> wrote:
> Thanks for the reminder, here is the v3 of the patch after a deeper > review and testing. It is now registered to the next commit fest under > the System Administration topic. I am going to try reviewing your patch. I don't feel entirely confident, but should be able to provide at least some help. I've not yet even tried building it, but the the first thing I notice is that you're going to need to use pgrename() of src/port/dirmod.c in order to get an atomic update of the pg_log_file file. I believe this is the right approach here. Any other program will always see a fully-formed file content. The typical way this works is: you make a new file with new content, then rename the new file to the old file name. This makes the new file name go away and the old file content go away and, effectively, replaces the content of your file with new content. You'll want to look at other places where pg uses pgrename() to see what sort of name you should give to the new file. If it was me, I'd just stick a dot in front, calling it ".pg_log_file" but we want to be consistent with existing practice. I'd imagine that you'd create the new file in the same directly as pg_log_file, that being the usual way to ensure that both files are in the same file system (a requirement). But when you're looking at other uses of pgrename() in the existing code it wouldn't hurt to see check what that code is doing regards placement of the new file in the file system. If you have any guidance/scripts/whatever which support testing your patch please send it my way. Thanks. Regards, Karl <k...@meme.com> Free Software: "You don't pay back, you pay forward." -- Robert A. Heinlein -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers