Content-Length: 263486 | pFad | https://github.com/postgrespro/postgres/commit/b8e19b932a99a7eb5a3bce84e74b0b7c093d0981

7E Flush logical mapping files with fd opened for read/write at checkpoint · postgrespro/postgres@b8e19b9 · GitHub
Skip to content

Commit b8e19b9

Browse files
committed
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 by a586cc4 (which was broken by me with 82a5649), 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 of b89e151. Author: Michael Paquier Reviewed-by: Andres Freund Discussion: https://postgr.es/m/20191006045548.GA14532@paquier.xyz Backpatch-through: 9.4
1 parent 1634d36 commit b8e19b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/access/heap/rewriteheap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,8 @@ CheckPointLogicalRewriteHeap(void)
12801280
}
12811281
else
12821282
{
1283-
int fd = OpenTransientFile(path, O_RDONLY | PG_BINARY);
1283+
/* on some operating systems fsyncing a file requires O_RDWR */
1284+
int fd = OpenTransientFile(path, O_RDWR | PG_BINARY);
12841285

12851286
/*
12861287
* The file cannot vanish due to concurrency since this function

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/postgrespro/postgres/commit/b8e19b932a99a7eb5a3bce84e74b0b7c093d0981

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy