- Notifications
You must be signed in to change notification settings - Fork5
Commit2bef06d
committed
Preserve required !catalog tuples while computing initial decoding snapshot.
The logical decoding machinery already preserved all the requiredcatalog tuples, which is sufficient in the course of normal logicaldecoding, but did not guarantee that non-catalog tuples were preservedduring computation of the initial snapshot when creating a slot overthe replication protocol.This could cause a corrupted initial snapshot being exported. Thetime window for issues is usually not terribly large, but on a busyserver it's perfectly possible to it hit it. Ongoing decoding is notaffected by this bug.To avoid increased overhead for the SQL API, only retain additionaltuples when a logical slot is being created over the replicationprotocol. To do so this commit changes the signature ofCreateInitDecodingContext(), but it seems unlikely that it's beingused in an extension, so that's probably ok.In a drive-by fix, fix handling ofReplicationSlotsComputeRequiredXmin's already_locked argument, whichshould only apply to ProcArrayLock, not ReplicationSlotControlLock.Reported-By: Erik RijkersAnalyzed-By: Petr JelinekAuthor: Petr Jelinek, heavily editorialized by Andres FreundReviewed-By: Andres FreundDiscussion:https://postgr.es/m/9a897b86-46e1-9915-ee4c-da02e4ff6a95@2ndquadrant.comBackport: 9.4, where logical decoding was introduced.1 parentfa31b6f commit2bef06d
File tree
8 files changed
+66
-18
lines changed- src
- backend
- replication
- logical
- storage/ipc
- include
- replication
- storage
8 files changed
+66
-18
lines changedLines changed: 17 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
210 | 210 |
| |
211 | 211 |
| |
212 | 212 |
| |
| 213 | + | |
213 | 214 |
| |
214 | 215 |
| |
215 | 216 |
| |
| |||
267 | 268 |
| |
268 | 269 |
| |
269 | 270 |
| |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
270 | 281 |
| |
271 | 282 |
| |
272 | 283 |
| |
273 | 284 |
| |
274 |
| - | |
275 |
| - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
276 | 291 |
| |
277 | 292 |
| |
278 | 293 |
| |
279 | 294 |
| |
280 | 295 |
| |
281 |
| - | |
282 |
| - | |
283 |
| - | |
284 |
| - | |
285 |
| - | |
286 |
| - | |
287 | 296 |
| |
288 | 297 |
| |
289 | 298 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
533 | 533 |
| |
534 | 534 |
| |
535 | 535 |
| |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
536 | 548 |
| |
537 | 549 |
| |
538 | 550 |
| |
|
Lines changed: 21 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
398 | 398 |
| |
399 | 399 |
| |
400 | 400 |
| |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
401 | 417 |
| |
402 | 418 |
| |
403 | 419 |
| |
| |||
612 | 628 |
| |
613 | 629 |
| |
614 | 630 |
| |
| 631 | + | |
| 632 | + | |
| 633 | + | |
615 | 634 |
| |
616 | 635 |
| |
617 | 636 |
| |
| |||
622 | 641 |
| |
623 | 642 |
| |
624 | 643 |
| |
625 |
| - | |
626 |
| - | |
| 644 | + | |
627 | 645 |
| |
628 | 646 |
| |
629 | 647 |
| |
| |||
652 | 670 |
| |
653 | 671 |
| |
654 | 672 |
| |
655 |
| - | |
656 |
| - | |
| 673 | + | |
657 | 674 |
| |
658 | 675 |
| |
659 | 676 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
131 | 131 |
| |
132 | 132 |
| |
133 | 133 |
| |
134 |
| - | |
135 |
| - | |
| 134 | + | |
| 135 | + | |
136 | 136 |
| |
137 | 137 |
| |
138 | 138 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
909 | 909 |
| |
910 | 910 |
| |
911 | 911 |
| |
| 912 | + | |
912 | 913 |
| |
913 | 914 |
| |
914 | 915 |
| |
|
Lines changed: 11 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2151 | 2151 |
| |
2152 | 2152 |
| |
2153 | 2153 |
| |
2154 |
| - | |
| 2154 | + | |
2155 | 2155 |
| |
2156 | 2156 |
| |
2157 | 2157 |
| |
| |||
2174 | 2174 |
| |
2175 | 2175 |
| |
2176 | 2176 |
| |
2177 |
| - | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
2178 | 2180 |
| |
2179 |
| - | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
2180 | 2188 |
| |
2181 | 2189 |
| |
2182 | 2190 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
| 85 | + | |
85 | 86 |
| |
86 | 87 |
| |
87 | 88 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
88 | 88 |
| |
89 | 89 |
| |
90 | 90 |
| |
91 |
| - | |
| 91 | + | |
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
|
0 commit comments
Comments
(0)