forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit64f34eb
committed
Use CREATE DATABASE ... STRATEGY = FILE_COPY in pg_upgrade.
While this strategy is ordinarily quite costly because it requiresperforming two checkpoints, testing shows that it tends to be afaster choice than WAL_LOG during pg_upgrade, presumably becausefsync is turned off. Furthermore, we can skip the checkpointsaltogether because the problems they are intended to prevent don'tapply to pg_upgrade. Instead, we just need to CHECKPOINT once inthe new cluster after making any changes to template0 and beforerestoring the rest of the databases. This ensures that saidtemplate0 changes are written out to disk prior to creating thedatabases via FILE_COPY.Co-authored-by: Matthias van de MeentReviewed-by: Ranier Vilela, Dilip Kumar, Robert Haas, Michael PaquierDiscussion:https://postgr.es/m/Zl9ta3FtgdjizkJ5%40nathan1 parent4b4b931 commit64f34eb
File tree
3 files changed
+34
-4
lines changed- src
- backend/commands
- bin
- pg_dump
- pg_upgrade
3 files changed
+34
-4
lines changedLines changed: 15 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
563 | 563 |
| |
564 | 564 |
| |
565 | 565 |
| |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
566 | 570 |
| |
567 |
| - | |
568 |
| - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
569 | 574 |
| |
570 | 575 |
| |
571 | 576 |
| |
| |||
657 | 662 |
| |
658 | 663 |
| |
659 | 664 |
| |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
660 | 670 |
| |
661 | 671 |
| |
662 | 672 |
| |
663 |
| - | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
664 | 676 |
| |
665 | 677 |
| |
666 | 678 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3144 | 3144 |
| |
3145 | 3145 |
| |
3146 | 3146 |
| |
| 3147 | + | |
| 3148 | + | |
| 3149 | + | |
| 3150 | + | |
3147 | 3151 |
| |
3148 | 3152 |
| |
3149 | 3153 |
| |
3150 |
| - | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
3151 | 3157 |
| |
3152 | 3158 |
| |
3153 | 3159 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
534 | 534 |
| |
535 | 535 |
| |
536 | 536 |
| |
| 537 | + | |
537 | 538 |
| |
538 | 539 |
| |
539 | 540 |
| |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
540 | 552 |
| |
541 | 553 |
| |
542 | 554 |
| |
|
0 commit comments
Comments
(0)