- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit10564ee
committed
Fix code for re-finding scan position in a multicolumn GIN index.
collectMatchBitmap() needs to re-find the index tuple it was previouslylooking at, after transiently dropping lock on the index page it's on.The tuple should still exist and be at its prior position or somewhereto the right of that, since ginvacuum never removes tuples butconcurrent insertions could add one. However, there was a thinko inthat logic, to the effect of expecting any inserted tuples to have thesame index "attnum" as what we'd been scanning. Since there's nophysical separation of tuples with different attnums, it's not terriblyhard to devise scenarios where this fails, leading to transient "lostsaved point in index" errors. (While I've duplicated this with manualtesting, it seems impossible to make a reproducible test case with ouravailable testing technology.)Fix by just continuing the scan when the attnum doesn't match.While here, improve the error message used if we do fail, so that itmatches the wording used in btree for a similar case.collectMatchBitmap()'s posting-tree code path was previously notexercised at all by our regression tests. While I can't makea regression test that exhibits the bug, I can at least improvethe code coverage here, so do that. The test case I made for thisis an extension of one added by4b754d6, so it only works inHEAD and v13; didn't seem worth trying hard to back-patch it.Per bug #16595 from Jesse Kinkead. This has been broken sincemulticolumn capability was added to GIN (commit27cb66f),so back-patch to all supported branches.Discussion:https://postgr.es/m/16595-633118be8eef9ce2@postgresql.org1 parent77c7267 commit10564ee
3 files changed
+105
-12
lines changedLines changed: 16 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
264 | 264 |
| |
265 | 265 |
| |
266 | 266 |
| |
267 |
| - | |
268 |
| - | |
269 |
| - | |
270 | 267 |
| |
271 |
| - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
272 | 272 |
| |
273 | 273 |
| |
274 | 274 |
| |
275 | 275 |
| |
276 |
| - | |
277 |
| - | |
278 |
| - | |
279 |
| - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
280 | 283 |
| |
281 |
| - | |
282 |
| - | |
283 |
| - | |
284 |
| - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
285 | 289 |
| |
286 | 290 |
| |
287 | 291 |
| |
|
Lines changed: 65 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
199 | 199 |
| |
200 | 200 |
| |
201 | 201 |
| |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
202 | 267 |
| |
203 | 268 |
| |
204 | 269 |
|
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
138 | 138 |
| |
139 | 139 |
| |
140 | 140 |
| |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
141 | 165 |
|
0 commit comments
Comments
(0)