forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc6b9204
committed
Skip WAL for new relfilenodes, under wal_level=minimal.
Until now, only selected bulk operations (e.g. COPY) did this. If agiven relfilenode received both a WAL-skipping COPY and a WAL-loggedoperation (e.g. INSERT), recovery could lose tuples from the COPY. Seesrc/backend/access/transam/README section "Skipping WAL for NewRelFileNode" for the new coding rules. Maintainers of table accessmethods should examine that section.To maintain data durability, just before commit, we choose between anfsync of the relfilenode and copying its contents to WAL. A new GUC,wal_skip_threshold, guides that choice. If this change slows a workloadthat creates small, permanent relfilenodes under wal_level=minimal, tryadjusting wal_skip_threshold. Users setting a timeout on COMMIT mayneed to adjust that timeout, and log_min_duration_statement analysiswill reflect time consumption moving to COMMIT from commands like COPY.Internally, this requires a reliable determination of whetherRollbackAndReleaseCurrentSubTransaction() would unlink a relation'scurrent relfilenode. Introduce rd_firstRelfilenodeSubid. Amend thespecification of rd_createSubid such that the field is zero when a newrel has an old rd_node. Make relcache.c retain entries for certaindropped relations until end of transaction.Bump XLOG_PAGE_MAGIC, since this introduces XLOG_GIST_ASSIGN_LSN.Future servers accept older WAL, so this bump is discretionary.Kyotaro Horiguchi, reviewed (in earlier, similar versions) by RobertHaas. Heikki Linnakangas and Michael Paquier implemented earlierdesigns that materially clarified the problem. Reviewed, in earlierdesigns, by Andrew Dunstan, Andres Freund, Alvaro Herrera, Tom Lane,Fujii Masao, and Simon Riggs. Reported by Martijn van Oosterhout.Discussion:https://postgr.es/m/20150702220524.GA9392@svana.org1 parent552fceb commitc6b9204
File tree
53 files changed
+1565
-371
lines changed- contrib/pg_visibility
- expected
- sql
- doc/src/sgml
- src
- backend
- access
- gist
- heap
- nbtree
- rmgrdesc
- transam
- bootstrap
- catalog
- commands
- nodes
- parser
- storage
- buffer
- lmgr
- smgr
- utils
- cache
- misc
- include
- access
- catalog
- nodes
- storage
- utils
- test
- recovery/t
- regress
- expected
- sql
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
53 files changed
+1565
-371
lines changedLines changed: 35 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
3 | 38 |
| |
4 | 39 |
| |
5 | 40 |
| |
|
Lines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
3 | 22 |
| |
4 | 23 |
| |
5 | 24 |
| |
|
Lines changed: 32 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2496 | 2496 |
| |
2497 | 2497 |
| |
2498 | 2498 |
| |
2499 |
| - | |
2500 |
| - | |
2501 |
| - | |
2502 |
| - | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
2503 | 2504 |
| |
2504 |
| - | |
2505 |
| - | |
| 2505 | + | |
2506 | 2506 |
| |
2507 |
| - | |
2508 |
| - | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
2509 | 2512 |
| |
2510 | 2513 |
| |
2511 | 2514 |
| |
| |||
2902 | 2905 |
| |
2903 | 2906 |
| |
2904 | 2907 |
| |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
2905 | 2929 |
| |
2906 | 2930 |
| |
2907 | 2931 |
| |
|
Lines changed: 9 additions & 38 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1607 | 1607 |
| |
1608 | 1608 |
| |
1609 | 1609 |
| |
1610 |
| - | |
1611 |
| - | |
| 1610 | + | |
| 1611 | + | |
1612 | 1612 |
| |
1613 | 1613 |
| |
1614 | 1614 |
| |
| |||
1708 | 1708 |
| |
1709 | 1709 |
| |
1710 | 1710 |
| |
1711 |
| - | |
1712 |
| - | |
1713 |
| - | |
1714 |
| - | |
1715 |
| - | |
1716 |
| - | |
1717 |
| - | |
1718 |
| - | |
1719 |
| - | |
1720 |
| - | |
1721 |
| - | |
1722 |
| - | |
1723 |
| - | |
1724 |
| - | |
1725 |
| - | |
1726 |
| - | |
1727 |
| - | |
1728 |
| - | |
1729 |
| - | |
1730 |
| - | |
1731 |
| - | |
1732 |
| - | |
1733 |
| - | |
1734 |
| - | |
1735 |
| - | |
1736 |
| - | |
1737 |
| - | |
1738 |
| - | |
1739 |
| - | |
1740 |
| - | |
1741 |
| - | |
1742 |
| - | |
1743 |
| - | |
1744 |
| - | |
1745 |
| - | |
1746 |
| - | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
1747 | 1718 |
| |
1748 | 1719 |
| |
1749 | 1720 |
| |
|
Lines changed: 26 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1004 | 1004 |
| |
1005 | 1005 |
| |
1006 | 1006 |
| |
1007 |
| - | |
1008 |
| - | |
1009 |
| - | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
1010 | 1010 |
| |
1011 | 1011 |
| |
1012 | 1012 |
| |
1013 | 1013 |
| |
1014 |
| - | |
1015 |
| - | |
1016 | 1014 |
| |
1017 | 1015 |
| |
1018 | 1016 |
| |
1019 | 1017 |
| |
1020 | 1018 |
| |
1021 | 1019 |
| |
| 1020 | + | |
| 1021 | + | |
1022 | 1022 |
| |
1023 | 1023 |
| |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1024 | 1045 |
| |
1025 | 1046 |
| |
1026 | 1047 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
449 | 449 |
| |
450 | 450 |
| |
451 | 451 |
| |
| 452 | + | |
| 453 | + | |
| 454 | + | |
452 | 455 |
| |
453 | 456 |
| |
454 | 457 |
| |
| |||
592 | 595 |
| |
593 | 596 |
| |
594 | 597 |
| |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
595 | 616 |
| |
596 | 617 |
| |
597 | 618 |
| |
|
Lines changed: 2 additions & 43 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
25 | 24 |
| |
26 | 25 |
| |
27 | 26 |
| |
| |||
1939 | 1938 |
| |
1940 | 1939 |
| |
1941 | 1940 |
| |
1942 |
| - | |
| 1941 | + | |
1943 | 1942 |
| |
1944 | 1943 |
| |
1945 | 1944 |
| |
| |||
2122 | 2121 |
| |
2123 | 2122 |
| |
2124 | 2123 |
| |
2125 |
| - | |
| 2124 | + | |
2126 | 2125 |
| |
2127 | 2126 |
| |
2128 | 2127 |
| |
| |||
8920 | 8919 |
| |
8921 | 8920 |
| |
8922 | 8921 |
| |
8923 |
| - | |
8924 |
| - | |
8925 |
| - | |
8926 |
| - | |
8927 |
| - | |
8928 |
| - | |
8929 |
| - | |
8930 |
| - | |
8931 |
| - | |
8932 |
| - | |
8933 |
| - | |
8934 |
| - | |
8935 |
| - | |
8936 |
| - | |
8937 |
| - | |
8938 |
| - | |
8939 |
| - | |
8940 |
| - | |
8941 |
| - | |
8942 |
| - | |
8943 |
| - | |
8944 |
| - | |
8945 |
| - | |
8946 |
| - | |
8947 |
| - | |
8948 |
| - | |
8949 |
| - | |
8950 |
| - | |
8951 |
| - | |
8952 |
| - | |
8953 |
| - | |
8954 |
| - | |
8955 |
| - | |
8956 |
| - | |
8957 |
| - | |
8958 |
| - | |
8959 |
| - | |
8960 |
| - | |
8961 |
| - | |
8962 |
| - | |
8963 | 8922 |
| |
8964 | 8923 |
| |
8965 | 8924 |
| |
|
Lines changed: 3 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
555 | 555 |
| |
556 | 556 |
| |
557 | 557 |
| |
558 |
| - | |
559 |
| - | |
560 |
| - | |
561 |
| - | |
562 |
| - | |
563 |
| - | |
564 |
| - | |
565 |
| - | |
566 |
| - | |
567 |
| - | |
568 |
| - | |
569 | 558 |
| |
570 | 559 |
| |
571 | 560 |
| |
| |||
698 | 687 |
| |
699 | 688 |
| |
700 | 689 |
| |
701 |
| - | |
702 | 690 |
| |
703 | 691 |
| |
704 | 692 |
| |
| |||
713 | 701 |
| |
714 | 702 |
| |
715 | 703 |
| |
716 |
| - | |
717 |
| - | |
| 704 | + | |
| 705 | + | |
718 | 706 |
| |
719 |
| - | |
720 |
| - | |
721 |
| - | |
722 | 707 |
| |
723 | 708 |
| |
724 | 709 |
| |
| |||
728 | 713 |
| |
729 | 714 |
| |
730 | 715 |
| |
731 |
| - | |
| 716 | + | |
732 | 717 |
| |
733 | 718 |
| |
734 | 719 |
| |
| |||
2525 | 2510 |
| |
2526 | 2511 |
| |
2527 | 2512 |
| |
2528 |
| - | |
2529 | 2513 |
| |
2530 | 2514 |
| |
2531 | 2515 |
| |
|
0 commit comments
Comments
(0)