forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0e758ae
committed
Fix failure to remove non-first segments of temporary tables.
Commit4ab5dae broke mdunlinkfork's logic for removing additionalsegments of a multi-gigabyte table, because it neglected to advance"segno" after unlinking the first segment, in the code path where itchooses to unlink that one immediately. Then the main remove loopgets ENOENT at segment zero and figures it's done, so we never removewhatever additional segments might exist.The main problem here is with large temporary tables, but WAL replayof a drop of a large regular table would also fail to remove extrasegments. The third case where this path is taken is for non-mainforks; but I doubt it matters for those since they probably neverexceed 1GB.The simplest fix is just to increment segno after that unlink().(Probably this logic could do with a more thorough rethink, but notwith mere hours to go before 15.1 wraps.)While here, also fix an incautious assumption thatregister_forget_request cannot change errno. I don't think thatthat has any really bad consequences, as we'd end up trying to unlinkthe zero'th segment either way, but it greatly complicates reasoningabout what could happen here. Also make a couple of other cosmeticfixes.Per bug #17679 from Balazs Szilfai. Back-patch into v15, as thefaulty patch was.Discussion:https://postgr.es/m/17679-1095d04450cf6a6e@postgresql.org1 parenta1a7bb8 commit0e758ae
1 file changed
+12
-6
lines changedLines changed: 12 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
330 | 330 |
| |
331 | 331 |
| |
332 | 332 |
| |
| 333 | + | |
| 334 | + | |
333 | 335 |
| |
334 | 336 |
| |
335 | 337 |
| |
336 | 338 |
| |
| 339 | + | |
337 | 340 |
| |
| 341 | + | |
338 | 342 |
| |
339 | 343 |
| |
340 | 344 |
| |
| |||
347 | 351 |
| |
348 | 352 |
| |
349 | 353 |
| |
| 354 | + | |
350 | 355 |
| |
351 | 356 |
| |
352 | 357 |
| |
| |||
359 | 364 |
| |
360 | 365 |
| |
361 | 366 |
| |
362 |
| - | |
363 |
| - | |
| 367 | + | |
| 368 | + | |
364 | 369 |
| |
365 |
| - | |
366 |
| - | |
| 370 | + | |
| 371 | + | |
367 | 372 |
| |
368 | 373 |
| |
369 | 374 |
| |
370 | 375 |
| |
371 |
| - | |
| 376 | + | |
372 | 377 |
| |
373 | 378 |
| |
374 | 379 |
| |
375 | 380 |
| |
376 |
| - | |
| 381 | + | |
| 382 | + | |
377 | 383 |
| |
378 | 384 |
| |
379 | 385 |
| |
|
0 commit comments
Comments
(0)