- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit4b4798e
committed
Ensure that creation of an empty relfile is fsync'd at checkpoint.
If you create a table and don't insert any data into it, the relation fileis never fsync'd. You don't lose data, because an empty table doesn't haveany data to begin with, but if you crash and lose the file, subsequentoperations on the table will fail with "could not open file" error.To fix, register an fsync request in mdcreate(), like we do for mdwrite().Per discussion, we probably should also fsync the containing directoryafter creating a new file. But that's a separate and much wider issue.Backpatch to all supported versions.Reviewed-by: Andres Freund, Thomas MunroDiscussion:https://www.postgresql.org/message-id/d47d8122-415e-425c-d0a2-e0160829702d%40iki.fi1 parent657f5f2 commit4b4798e
1 file changed
+3
-0
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
239 | 239 |
| |
240 | 240 |
| |
241 | 241 |
| |
| 242 | + | |
| 243 | + | |
| 244 | + | |
242 | 245 |
| |
243 | 246 |
| |
244 | 247 |
| |
|
0 commit comments
Comments
(0)