forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd5fef87
committed
Flush unlogged table's buffers when copying or moving databases.
CREATE DATABASE and ALTER DATABASE .. SET TABLESPACE copy the sourcedatabase directory on the filesystem level. To ensure the on diskstate is consistent they block out users of the affected database andforce a checkpoint to flush out all data to disk. Unfortunately, up tonow, that checkpoint didn't flush out dirty buffers from unloggedrelations.That bug means there could be leftover dirty buffers in either thetemplate database, or the database in its old location. Leading toproblems when accessing relations in an inconsistent state; and topossible problems during shutdown in the SET TABLESPACE case becausebuffers belonging files that don't exist anymore are flushed.This was reported in bug #10675 by Maxim Boguk.Fix by Pavan Deolasee, modified somewhat by me. Reviewed by MauMau andFujii Masao.Backpatch to 9.1 where unlogged tables were introduced.1 parent28e9ebb commitd5fef87
File tree
4 files changed
+30
-20
lines changed- src
- backend
- access/transam
- commands
- storage/buffer
- include/access
4 files changed
+30
-20
lines changedLines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7537 | 7537 |
| |
7538 | 7538 |
| |
7539 | 7539 |
| |
7540 |
| - | |
| 7540 | + | |
7541 | 7541 |
| |
7542 |
| - | |
| 7542 | + | |
7543 | 7543 |
| |
7544 | 7544 |
| |
7545 | 7545 |
| |
| |||
7548 | 7548 |
| |
7549 | 7549 |
| |
7550 | 7550 |
| |
7551 |
| - | |
| 7551 | + | |
| 7552 | + | |
7552 | 7553 |
| |
7553 | 7554 |
| |
7554 | 7555 |
| |
|
Lines changed: 15 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
523 | 523 |
| |
524 | 524 |
| |
525 | 525 |
| |
526 |
| - | |
527 |
| - | |
528 |
| - | |
529 |
| - | |
530 |
| - | |
531 |
| - | |
532 |
| - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
533 | 534 |
| |
534 |
| - | |
| 535 | + | |
| 536 | + | |
535 | 537 |
| |
536 | 538 |
| |
537 | 539 |
| |
| |||
1111 | 1113 |
| |
1112 | 1114 |
| |
1113 | 1115 |
| |
1114 |
| - | |
1115 |
| - | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
1116 | 1119 |
| |
1117 | 1120 |
| |
1118 | 1121 |
| |
1119 | 1122 |
| |
1120 | 1123 |
| |
1121 | 1124 |
| |
1122 | 1125 |
| |
1123 |
| - | |
| 1126 | + | |
| 1127 | + | |
1124 | 1128 |
| |
1125 | 1129 |
| |
1126 | 1130 |
| |
|
Lines changed: 9 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1168 | 1168 |
| |
1169 | 1169 |
| |
1170 | 1170 |
| |
1171 |
| - | |
1172 |
| - | |
1173 |
| - | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1174 | 1175 |
| |
1175 | 1176 |
| |
1176 | 1177 |
| |
| |||
1185 | 1186 |
| |
1186 | 1187 |
| |
1187 | 1188 |
| |
1188 |
| - | |
1189 |
| - | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1190 | 1192 |
| |
1191 |
| - | |
| 1193 | + | |
| 1194 | + | |
1192 | 1195 |
| |
1193 | 1196 |
| |
1194 | 1197 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
246 | 246 |
| |
247 | 247 |
| |
248 | 248 |
| |
| 249 | + | |
| 250 | + | |
249 | 251 |
| |
250 | 252 |
| |
251 | 253 |
| |
|
0 commit comments
Comments
(0)