forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commitacbffaa
committed
The GiST scan algorithm uses LSNs to detect concurrent pages splits, but
temporary indexes are not WAL-logged. We used a constant LSN for temporaryindexes, on the assumption that we don't need to worry about concurrent pagesplits in temporary indexes because they're only visible to the currentsession. But that assumption is wrong, it's possible to insert rows andsplit pages in the same session, while a scan is in progress. For example,by opening a cursor and fetching some rows, and INSERTing new rows beforefetching some more.Fix by generating fake increasing LSNs, used in place of real LSNs intemporary GiST indexes.1 parent0e27a73 commitacbffaa
File tree
4 files changed
+30
-10
lines changed- src
- backend/access/gist
- include/access
4 files changed
+30
-10
lines changedLines changed: 4 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
27 |
| - | |
28 | 26 |
| |
29 | 27 |
| |
30 | 28 |
| |
| |||
127 | 125 |
| |
128 | 126 |
| |
129 | 127 |
| |
130 |
| - | |
| 128 | + | |
131 | 129 |
| |
132 | 130 |
| |
133 | 131 |
| |
| |||
356 | 354 |
| |
357 | 355 |
| |
358 | 356 |
| |
359 |
| - | |
| 357 | + | |
360 | 358 |
| |
361 | 359 |
| |
362 | 360 |
| |
| |||
475 | 473 |
| |
476 | 474 |
| |
477 | 475 |
| |
478 |
| - | |
| 476 | + | |
479 | 477 |
| |
480 | 478 |
| |
481 | 479 |
| |
| |||
1206 | 1204 |
| |
1207 | 1205 |
| |
1208 | 1206 |
| |
1209 |
| - | |
| 1207 | + | |
1210 | 1208 |
| |
1211 | 1209 |
| |
1212 | 1210 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
977 | 977 |
| |
978 | 978 |
| |
979 | 979 |
| |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + |
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
201 | 201 |
| |
202 | 202 |
| |
203 | 203 |
| |
204 |
| - | |
| 204 | + | |
205 | 205 |
| |
206 | 206 |
| |
207 | 207 |
| |
| |||
306 | 306 |
| |
307 | 307 |
| |
308 | 308 |
| |
309 |
| - | |
| 309 | + | |
310 | 310 |
| |
311 | 311 |
| |
312 | 312 |
| |
| |||
589 | 589 |
| |
590 | 590 |
| |
591 | 591 |
| |
592 |
| - | |
| 592 | + | |
593 | 593 |
| |
594 | 594 |
| |
595 | 595 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
94 |
| - | |
95 | 94 |
| |
96 | 95 |
| |
97 | 96 |
| |
| |||
318 | 317 |
| |
319 | 318 |
| |
320 | 319 |
| |
| 320 | + | |
| 321 | + | |
321 | 322 |
| |
322 | 323 |
| |
323 | 324 |
| |
|
0 commit comments
Comments
(0)