forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit522baf1
committed
Delay fsyncs of pg_basebackup until the end of backup
Since the addition of fsync requests in bc34223 to make base backup dataconsistent on disk once pg_basebackup finishes, each tablespace tar fileis individually flushed once completed, with an additional flush of theparent directory when the base backup finishes. While holding aconnection to the server, a fsync request taking a long time may cause afailure of the base backup, which is annoying for any integration. Arecent example of breakage can involve tcp_user_timeout, butwal_sender_timeout can cause similar problems.While reviewing the code, there was a second issue causing too manyfsync requests to be done for the same WAL data. As recursive fsyncsare done at the end of the backup for both the plain and tar formatsfrom the base target directory where everything is written, it is fineto disable fsyncs when fetching or streaming WAL.Reported-by: Ryohei TakahashiAuthor: Michael PaquierReviewed-by: Ryohei TakahashiDiscussion:https://postgr.es/m/OSBPR01MB4550DAE2F8C9502894A45AAB82BE0@OSBPR01MB4550.jpnprd01.prod.outlook.comBackpatch-through: 101 parent25dcc9d commit522baf1
1 file changed
+14
-10
lines changedLines changed: 14 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
486 | 486 |
| |
487 | 487 |
| |
488 | 488 |
| |
489 |
| - | |
| 489 | + | |
| 490 | + | |
490 | 491 |
| |
491 | 492 |
| |
492 | 493 |
| |
493 | 494 |
| |
494 | 495 |
| |
495 |
| - | |
| 496 | + | |
| 497 | + | |
496 | 498 |
| |
497 |
| - | |
| 499 | + | |
| 500 | + | |
498 | 501 |
| |
499 | 502 |
| |
500 | 503 |
| |
| |||
1346 | 1349 |
| |
1347 | 1350 |
| |
1348 | 1351 |
| |
1349 |
| - | |
1350 |
| - | |
1351 |
| - | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
1352 | 1356 |
| |
1353 | 1357 |
| |
1354 | 1358 |
| |
| |||
2138 | 2142 |
| |
2139 | 2143 |
| |
2140 | 2144 |
| |
2141 |
| - | |
2142 |
| - | |
2143 |
| - | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
2144 | 2148 |
| |
2145 | 2149 |
| |
2146 | 2150 |
| |
| |||
2150 | 2154 |
| |
2151 | 2155 |
| |
2152 | 2156 |
| |
2153 |
| - | |
| 2157 | + | |
2154 | 2158 |
| |
2155 | 2159 |
| |
2156 | 2160 |
| |
|
0 commit comments
Comments
(0)