forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbcc93a3
committed
Fix race in SSI interaction with bitmap heap scan.
When performing a bitmap heap scan, we don't want to miss concurrentwrites that occurred after we observed the heap's rs_nblocks, but beforewe took predicate locks on index pages. Therefore, we can't skipfetching any heap tuples that are referenced by the index, because weneed to test them all with CheckForSerializableConflictOut(). Theold optimization that would ignore any references to blocks >=rs_nblocks gets in the way of that requirement, because it means thatconcurrent writes in that window are ignored.Removing that optimization shouldn't affect correctness at any isolationlevel, because any new tuples shouldn't be visible to an MVCC snapshot.There also shouldn't be any error-causing references to heap blocks pastthe end, because we should have held at least an AccessShareLock on thetable before the index scan. It can't get smaller while our transactionis running. For now, though, we'll keep the optimization at lowerlevels to avoid making unnecessary changes in a bug fix.Back-patch to all supported releases. In release 11, the code is in adifferent place but not fundamentally different. Fixes one aspect ofbug #17949.Reported-by: Artem Anisimov <artem.anisimov.255@gmail.com>Reviewed-by: Dmitry Dolgov <9erthalion6@gmail.com>Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>Discussion:https://postgr.es/m/17949-a0f17035294a55e2%40postgresql.org1 parentf9b7fc6 commitbcc93a3
1 file changed
+4
-2
lines changedLines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2132 | 2132 |
| |
2133 | 2133 |
| |
2134 | 2134 |
| |
2135 |
| - | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
2136 | 2138 |
| |
2137 |
| - | |
| 2139 | + | |
2138 | 2140 |
| |
2139 | 2141 |
| |
2140 | 2142 |
| |
|
0 commit comments
Comments
(0)