forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commited57cac
committed
pg_walinspect: fix case where flush LSN is in the middle of a record.
Instability in the test for pg_walinspect revealed thatpg_get_wal_records_info_till_end_of_wal(x) would try to decode all therecords with a start LSN earlier than the flush LSN, even though thatmight include a partial record at the end of the range. In that case,read_local_xlog_page_no_wait() would return NULL when it tried to readpast the flush LSN, which would be interpreted as an error by thecaller. That caused a test failure only on a BF animal that had beenrestarted recently, but could be expected to happen in the wild quiteeasily depending on the alignment of various parameters.Fix by using private data in read_local_xlog_page_no_wait() to signalend-of-wal to the caller, so that it can be properly distinguishedfrom a real error.Discussion:https://postgr.es/m/Ymd/e5eeZMNAkrXo%40paquier.xyzDiscussion:https://postgr.es/m/111657.1650910309@sss.pgh.pa.usAuthors: Thomas Munro, Bharath Rupireddy.1 parentccd10a9 commited57cac
File tree
3 files changed
+50
-26
lines changed- contrib/pg_walinspect
- src
- backend/access/transam
- include/access
3 files changed
+50
-26
lines changedLines changed: 33 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
89 | 89 |
| |
90 | 90 |
| |
91 | 91 |
| |
| 92 | + | |
92 | 93 |
| |
93 | 94 |
| |
94 | 95 |
| |
| |||
100 | 101 |
| |
101 | 102 |
| |
102 | 103 |
| |
| 104 | + | |
| 105 | + | |
| 106 | + | |
103 | 107 |
| |
104 | 108 |
| |
105 | 109 |
| |
106 | 110 |
| |
107 |
| - | |
| 111 | + | |
108 | 112 |
| |
109 | 113 |
| |
110 | 114 |
| |
| |||
132 | 136 |
| |
133 | 137 |
| |
134 | 138 |
| |
135 |
| - | |
| 139 | + | |
| 140 | + | |
136 | 141 |
| |
137 | 142 |
| |
138 | 143 |
| |
| |||
144 | 149 |
| |
145 | 150 |
| |
146 | 151 |
| |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
147 | 161 |
| |
148 | 162 |
| |
149 | 163 |
| |
| |||
246 | 260 |
| |
247 | 261 |
| |
248 | 262 |
| |
249 |
| - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
250 | 268 |
| |
251 | 269 |
| |
252 | 270 |
| |
253 | 271 |
| |
254 | 272 |
| |
255 | 273 |
| |
256 | 274 |
| |
| 275 | + | |
257 | 276 |
| |
258 | 277 |
| |
259 | 278 |
| |
| |||
327 | 346 |
| |
328 | 347 |
| |
329 | 348 |
| |
330 |
| - | |
| 349 | + | |
| 350 | + | |
331 | 351 |
| |
332 |
| - | |
333 |
| - | |
334 |
| - | |
335 |
| - | |
336 |
| - | |
337 |
| - | |
| 352 | + | |
| 353 | + | |
338 | 354 |
| |
339 |
| - | |
340 |
| - | |
341 |
| - | |
342 |
| - | |
343 |
| - | |
344 |
| - | |
345 |
| - | |
| 355 | + | |
| 356 | + | |
346 | 357 |
| |
347 | 358 |
| |
348 | 359 |
| |
349 | 360 |
| |
| 361 | + | |
350 | 362 |
| |
351 | 363 |
| |
352 | 364 |
| |
| |||
555 | 567 |
| |
556 | 568 |
| |
557 | 569 |
| |
558 |
| - | |
| 570 | + | |
| 571 | + | |
559 | 572 |
| |
560 |
| - | |
561 |
| - | |
562 |
| - | |
563 |
| - | |
564 |
| - | |
565 |
| - | |
566 |
| - | |
567 |
| - | |
| 573 | + | |
568 | 574 |
| |
569 | 575 |
| |
570 | 576 |
| |
571 | 577 |
| |
| 578 | + | |
572 | 579 |
| |
573 | 580 |
| |
574 | 581 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
957 | 957 |
| |
958 | 958 |
| |
959 | 959 |
| |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
960 | 970 |
| |
| 971 | + | |
961 | 972 |
| |
962 | 973 |
| |
963 | 974 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
78 | 84 |
| |
79 | 85 |
| |
80 | 86 |
| |
|
0 commit comments
Comments
(0)