forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6b77048

Amit Kapila
Fix catalog lookup due to wrong snapshot for subtransactions during decoding.
In commit272248a, we fixed the catalog lookup due to the wrong snapshotfor transactions and subtransactions during decoding. We failed toconsider the case where top-level xact is already marked as containingcatalog change but its subtransaction is not yet marked as containingcatalog change even though it contained such a change.This can happen when during decoding, none of the WAL records from thesubtransaction was decoded and top-level xact contains a DDL.We fix it by marking the transaction and all its subtransactions ascontaining catalog changes if the top-level xact contains any catalogchange and it is present in the initial running xacts array.This fix is required only for 14 and 15 because in prior branches wealready always mark the transaction and all its subtransactions ascontaining catalog changes in the same case. In 16 and above, we preservethe list of transaction IDs and sub-transaction IDs, that have modifiedcatalogs and are running during snapshot serialization, to the serializedsnapshot (see commit7f13ac8).Author: Fei ChanghongReviewed-by: Amit Kapila, Hayato Kuroda, Andy FanDiscussion:https://postgr.es/m/18280-4c8060178cb41750@postgresql.org1 parent3eb8a87 commit6b77048
File tree
3 files changed
+65
-4
lines changed- contrib/test_decoding
- expected
- specs
- src/backend/replication/logical
3 files changed
+65
-4
lines changedLines changed: 44 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + |
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| 6 | + | |
6 | 7 |
| |
| 8 | + | |
7 | 9 |
| |
8 | 10 |
| |
9 | 11 |
| |
10 | 12 |
| |
11 | 13 |
| |
12 | 14 |
| |
| 15 | + | |
13 | 16 |
| |
14 | 17 |
| |
15 | 18 |
| |
| |||
19 | 22 |
| |
20 | 23 |
| |
21 | 24 |
| |
| 25 | + | |
22 | 26 |
| |
23 | 27 |
| |
24 | 28 |
| |
| 29 | + | |
| 30 | + | |
| 31 | + | |
25 | 32 |
| |
26 | 33 |
| |
27 | 34 |
| |
| |||
60 | 67 |
| |
61 | 68 |
| |
62 | 69 |
| |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + |
Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2119 | 2119 |
| |
2120 | 2120 |
| |
2121 | 2121 |
| |
2122 |
| - | |
2123 |
| - | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
2124 | 2127 |
| |
2125 |
| - | |
2126 |
| - | |
| 2128 | + | |
2127 | 2129 |
| |
2128 | 2130 |
| |
2129 | 2131 |
| |
|
0 commit comments
Comments
(0)