mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-06 12:46:54 +02:00
Flush logical mapping files with fd opened for read/write at checkpoint
The file descriptor was opened with read-only to fsync a regular file, which would cause EBADFD errors on some platforms. This is similar to the recent fix done bya586cc4b
(which was broken by me with82a5649
), except that I noticed this issue while monitoring the backend code for similar mistakes. Backpatch to 9.4, as this has been introduced since logical decoding exists as ofb89e151
. Author: Michael Paquier Reviewed-by: Andres Freund Discussion: https://postgr.es/m/20191006045548.GA14532@paquier.xyz Backpatch-through: 9.4
This commit is contained in:
parent
e4ca62b948
commit
e34358c436
@ -1278,7 +1278,8 @@ CheckPointLogicalRewriteHeap(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int fd = OpenTransientFile(path, O_RDONLY | PG_BINARY);
|
/* on some operating systems fsyncing a file requires O_RDWR */
|
||||||
|
int fd = OpenTransientFile(path, O_RDWR | PG_BINARY);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The file cannot vanish due to concurrency since this function
|
* The file cannot vanish due to concurrency since this function
|
||||||
|
Loading…
Reference in New Issue
Block a user