forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit004a970
committed
Remove AtEOXact_CatCache().
The sole useful effect of this function, to check that no catcacheentries have positive refcounts at transaction end, has really beenobsolete since we introduced ResourceOwners in PG 8.1. We reduced thechecks to assertions years ago, so that the function was a completeno-op in production builds. There have been previous discussions aboutremoving it entirely, but consensus up to now was that it had some smallvalue as a cross-check for bugs in the ResourceOwner logic.However, it now emerges that it's possible to trigger these assertionsif you hit an assert-enabled backend with SIGTERM during a call toSearchCatCacheList, because that function temporarily increases therefcounts of entries it's intending to add to a catcache list construct.In a normal ERROR scenario, the extra refcounts are cleaned up bySearchCatCacheList's PG_CATCH block; but in a FATAL exit we do atransaction abort and exit without ever executing PG_CATCH handlers.There's a case to be made that this is a generic hazard and we shouldconsider restructuring elog(FATAL) handling so that pending PG_CATCHhandlers do get run. That's pretty scary though: it could easily createmore problems than it solves. Preliminary stress testing by AndreasSeltenreich suggests that there are not many live problems of this ilk,so we rejected that idea.There are more-localized ways to fix the problem; the most principledone would be to use PG_ENSURE_ERROR_CLEANUP instead of plain PG_TRY.But adding cycles to SearchCatCacheList isn't very appealing. We couldalso weaken the assertions in AtEOXact_CatCache in some more or lessad-hoc way, but that just makes its raison d'etre even less compelling.In the end, the most reasonable solution seems to be to just removeAtEOXact_CatCache altogether, on the grounds that it's not worth tryingto fix it. It hasn't found any bugs for us in many years.Per report from Jeevan Chalke. Back-patch to all supported branches.Discussion:https://postgr.es/m/CAM2+6=VEE30YtRQCZX7_sCFsEpoUkFBV1gZazL70fqLn8rcvBA@mail.gmail.com1 parent2336f84 commit004a970
File tree
3 files changed
+0
-59
lines changed- src
- backend
- access/transam
- utils/cache
- include/utils
3 files changed
+0
-59
lines changedLines changed: 0 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2124 | 2124 |
| |
2125 | 2125 |
| |
2126 | 2126 |
| |
2127 |
| - | |
2128 |
| - | |
2129 |
| - | |
2130 | 2127 |
| |
2131 | 2128 |
| |
2132 | 2129 |
| |
| |||
2405 | 2402 |
| |
2406 | 2403 |
| |
2407 | 2404 |
| |
2408 |
| - | |
2409 |
| - | |
2410 |
| - | |
2411 | 2405 |
| |
2412 | 2406 |
| |
2413 | 2407 |
| |
| |||
2610 | 2604 |
| |
2611 | 2605 |
| |
2612 | 2606 |
| |
2613 |
| - | |
2614 | 2607 |
| |
2615 | 2608 |
| |
2616 | 2609 |
| |
|
Lines changed: 0 additions & 51 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
521 | 521 |
| |
522 | 522 |
| |
523 | 523 |
| |
524 |
| - | |
525 |
| - | |
526 |
| - | |
527 |
| - | |
528 |
| - | |
529 |
| - | |
530 |
| - | |
531 |
| - | |
532 |
| - | |
533 |
| - | |
534 |
| - | |
535 |
| - | |
536 |
| - | |
537 |
| - | |
538 |
| - | |
539 |
| - | |
540 |
| - | |
541 |
| - | |
542 |
| - | |
543 |
| - | |
544 |
| - | |
545 |
| - | |
546 |
| - | |
547 |
| - | |
548 |
| - | |
549 |
| - | |
550 |
| - | |
551 |
| - | |
552 |
| - | |
553 |
| - | |
554 |
| - | |
555 |
| - | |
556 |
| - | |
557 |
| - | |
558 |
| - | |
559 |
| - | |
560 |
| - | |
561 |
| - | |
562 |
| - | |
563 |
| - | |
564 |
| - | |
565 |
| - | |
566 |
| - | |
567 |
| - | |
568 |
| - | |
569 |
| - | |
570 |
| - | |
571 |
| - | |
572 |
| - | |
573 |
| - | |
574 |
| - | |
575 | 524 |
| |
576 | 525 |
| |
577 | 526 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
167 | 167 |
| |
168 | 168 |
| |
169 | 169 |
| |
170 |
| - | |
171 | 170 |
| |
172 | 171 |
| |
173 | 172 |
| |
|
0 commit comments
Comments
(0)