Don't use O_SYNC or similar when opening signal file to fsync it.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sat, 31 Jul 2021 06:36:11 +0000 (09:36 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sat, 31 Jul 2021 06:36:11 +0000 (09:36 +0300)
No need to use get_sync_bit() when we're calling pg_fsync() on the file.
We're not writing to the files, so it doesn't make any difference in
practice, but seems less surprising this way.

Reviewed-by: Andres Freund
Discussion: https://www.postgresql.org/message-id/b3b71061-4919-e882-4857-27e370ab134a%40iki.fi

src/backend/access/transam/xlog.c

index 26fa2b6c8f3ee00880826fe15f4329cc46274084..8461c88b6bb14b12d2400c8bb9cbcaca9052eaca 100644 (file)
@@ -5484,7 +5484,7 @@ readRecoverySignalFile(void)
    {
        int         fd;
 
-       fd = BasicOpenFilePerm(STANDBY_SIGNAL_FILE, O_RDWR | PG_BINARY | get_sync_bit(sync_method),
+       fd = BasicOpenFilePerm(STANDBY_SIGNAL_FILE, O_RDWR | PG_BINARY,
                               S_IRUSR | S_IWUSR);
        if (fd >= 0)
        {
@@ -5497,7 +5497,7 @@ readRecoverySignalFile(void)
    {
        int         fd;
 
-       fd = BasicOpenFilePerm(RECOVERY_SIGNAL_FILE, O_RDWR | PG_BINARY | get_sync_bit(sync_method),
+       fd = BasicOpenFilePerm(RECOVERY_SIGNAL_FILE, O_RDWR | PG_BINARY,
                               S_IRUSR | S_IWUSR);
        if (fd >= 0)
        {