Commit 952365c
committed
Remove unnecessary GetTransactionSnapshot() calls
In get_database_list() and get_subscription_list(), the
GetTransactionSnapshot() call is not required because the catalog
table scans use the catalog snapshot, which is held until the end of
the scan. See table_beginscan_catalog(), which calls
RegisterSnapshot(GetCatalogSnapshot(relid)).
In InitPostgres, it's a little less obvious that it's not required,
but still true I believe. All the catalog lookups in InitPostgres()
also use the catalog snapshot, and the looked up values are copied
while still holding the snapshot.
Furthermore, as the removed FIXME comments said, calling
GetTransactionSnapshot() didn't really prevent MyProc->xmin from being
reset anyway.
Discussion: https://www.postgresql.org/message-id/7c56f180-b9e1-481e-8c1d-efa63de3ecbb@iki.fi1 parent 7ec4b9f commit 952365c
File tree
3 files changed
+3
-32
lines changed- src/backend
- postmaster
- replication/logical
- utils/init
3 files changed
+3
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1799 | 1799 | | |
1800 | 1800 | | |
1801 | 1801 | | |
1802 | | - | |
1803 | | - | |
1804 | | - | |
1805 | | - | |
1806 | | - | |
1807 | | - | |
1808 | | - | |
1809 | | - | |
1810 | | - | |
| 1802 | + | |
1811 | 1803 | | |
1812 | 1804 | | |
1813 | | - | |
1814 | 1805 | | |
1815 | 1806 | | |
1816 | 1807 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 124 | + | |
133 | 125 | | |
134 | 126 | | |
135 | | - | |
136 | 127 | | |
137 | 128 | | |
138 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
| 816 | + | |
826 | 817 | | |
827 | 818 | | |
828 | 819 | | |
| |||
837 | 828 | | |
838 | 829 | | |
839 | 830 | | |
840 | | - | |
841 | | - | |
842 | 831 | | |
843 | 832 | | |
844 | 833 | | |
| |||
0 commit comments