forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2ff6555
committed
Use the right timeline when beginning to stream from master.
The xlogreader refactoring broke the logic to decide which timeline to startstreaming from. XLogPageRead() uses the timeline history to check whichtimeline the requested WAL position falls into. However, after therefactoring, XLogPageRead() is always first called with the first page inthe segment, to verify the segment header, and only then with the actual WALposition we're interested in. That first read of the segment's header madeXLogPageRead() to always start streaming from the old timeline containingthe segment header, not the timeline containing the actual record, if therewas a timeline switch within the segment.I thought I fixed this yesterday, but that fix was too narrow and only fixedthis for the corner-case that the timeline switch happened in the first pageof the segment. To fix this more robustly, pass explicitly the position ofthe record we're actually interested in to XLogPageRead, and use that todecide which timeline to read from, rather than deduce it from the page andoffset.Per report from Fujii Masao.1 parent88228e6 commit2ff6555
File tree
3 files changed
+36
-11
lines changed- src
- backend/access/transam
- include/access
3 files changed
+36
-11
lines changedLines changed: 17 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
626 | 626 |
| |
627 | 627 |
| |
628 | 628 |
| |
629 |
| - | |
| 629 | + | |
| 630 | + | |
630 | 631 |
| |
631 |
| - | |
| 632 | + | |
632 | 633 |
| |
633 | 634 |
| |
634 | 635 |
| |
| |||
8832 | 8833 |
| |
8833 | 8834 |
| |
8834 | 8835 |
| |
8835 |
| - | |
| 8836 | + | |
8836 | 8837 |
| |
8837 | 8838 |
| |
8838 | 8839 |
| |
| |||
8880 | 8881 |
| |
8881 | 8882 |
| |
8882 | 8883 |
| |
8883 |
| - | |
| 8884 | + | |
| 8885 | + | |
8884 | 8886 |
| |
8885 | 8887 |
| |
8886 | 8888 |
| |
| |||
8980 | 8982 |
| |
8981 | 8983 |
| |
8982 | 8984 |
| |
8983 |
| - | |
| 8985 | + | |
8984 | 8986 |
| |
8985 | 8987 |
| |
8986 | 8988 |
| |
8987 | 8989 |
| |
| 8990 | + | |
| 8991 | + | |
| 8992 | + | |
| 8993 | + | |
| 8994 | + | |
| 8995 | + | |
| 8996 | + | |
| 8997 | + | |
8988 | 8998 |
| |
8989 | 8999 |
| |
8990 | 9000 |
| |
8991 | 9001 |
| |
8992 | 9002 |
| |
8993 | 9003 |
| |
8994 | 9004 |
| |
8995 |
| - | |
| 9005 | + | |
8996 | 9006 |
| |
8997 | 9007 |
| |
8998 | 9008 |
| |
| |||
9076 | 9086 |
| |
9077 | 9087 |
| |
9078 | 9088 |
| |
9079 |
| - | |
| 9089 | + | |
9080 | 9090 |
| |
9081 | 9091 |
| |
9082 | 9092 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
216 | 216 |
| |
217 | 217 |
| |
218 | 218 |
| |
| 219 | + | |
| 220 | + | |
219 | 221 |
| |
220 | 222 |
| |
221 | 223 |
| |
| |||
503 | 505 |
| |
504 | 506 |
| |
505 | 507 |
| |
| 508 | + | |
506 | 509 |
| |
507 | 510 |
| |
508 | 511 |
| |
| |||
521 | 524 |
| |
522 | 525 |
| |
523 | 526 |
| |
| 527 | + | |
524 | 528 |
| |
525 | 529 |
| |
526 | 530 |
| |
| |||
539 | 543 |
| |
540 | 544 |
| |
541 | 545 |
| |
| 546 | + | |
542 | 547 |
| |
543 | 548 |
| |
544 | 549 |
| |
|
Lines changed: 14 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
| |||
46 | 47 |
| |
47 | 48 |
| |
48 | 49 |
| |
49 |
| - | |
| 50 | + | |
50 | 51 |
| |
51 |
| - | |
52 |
| - | |
53 |
| - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
54 | 61 |
| |
55 | 62 |
| |
56 | 63 |
| |
| |||
90 | 97 |
| |
91 | 98 |
| |
92 | 99 |
| |
| 100 | + | |
| 101 | + | |
| 102 | + | |
93 | 103 |
| |
94 | 104 |
| |
95 | 105 |
| |
|
0 commit comments
Comments
(0)