- Notifications
You must be signed in to change notification settings - Fork5
Commit57eb009
committed
Allow snapshot references to still work during transaction abort.
In REPEATABLE READ (nee SERIALIZABLE) mode, an attempt to doGetTransactionSnapshot() between AbortTransaction and CleanupTransactionfailed, because GetTransactionSnapshot would recompute the transactionsnapshot (which is already wrong, given the isolation mode) and thenre-register it in the TopTransactionResourceOwner, leading to an Assertbecause the TopTransactionResourceOwner should be empty of resources afterAbortTransaction. This is the root cause of bug #6218 from YamamotoTakashi. While changing plancache.c to avoid requesting a snapshot whenhandling a ROLLBACK masks the problem, I think this is really a snapmgr.cbug: it's lower-level than the resource manager mechanism and should not beshutting itself down before we unwind resource manager resources. However,just postponing the release of the transaction snapshot until cleanup timedidn't work because of the circular dependency withTopTransactionResourceOwner. Fix by managing the internal reference tothat snapshot manually instead of depending on TopTransactionResourceOwner.This saves a few cycles as well as making the module layering morestraightforward. predicate.c's dependencies on TopTransactionResourceOwnergo away too.I think this is a longstanding bug, but there's no evidence that it's morethan a latent bug, so it doesn't seem worth any risk of back-patching.1 parent16762b5 commit57eb009
File tree
5 files changed
+67
-57
lines changed- src
- backend
- access/transam
- storage/lmgr
- utils/time
- include
- storage
- utils
5 files changed
+67
-57
lines changedLines changed: 1 addition & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1906 | 1906 |
| |
1907 | 1907 |
| |
1908 | 1908 |
| |
1909 |
| - | |
1910 |
| - | |
1911 |
| - | |
1912 | 1909 |
| |
1913 | 1910 |
| |
1914 | 1911 |
| |
| |||
2158 | 2155 |
| |
2159 | 2156 |
| |
2160 | 2157 |
| |
2161 |
| - | |
2162 |
| - | |
2163 |
| - | |
2164 | 2158 |
| |
2165 | 2159 |
| |
2166 | 2160 |
| |
| |||
2339 | 2333 |
| |
2340 | 2334 |
| |
2341 | 2335 |
| |
2342 |
| - | |
2343 | 2336 |
| |
2344 | 2337 |
| |
2345 | 2338 |
| |
| |||
2368 | 2361 |
| |
2369 | 2362 |
| |
2370 | 2363 |
| |
| 2364 | + | |
2371 | 2365 |
| |
2372 | 2366 |
| |
2373 | 2367 |
| |
|
Lines changed: 23 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
146 | 146 |
| |
147 | 147 |
| |
148 | 148 |
| |
149 |
| - | |
| 149 | + | |
150 | 150 |
| |
151 | 151 |
| |
152 | 152 |
| |
| |||
417 | 417 |
| |
418 | 418 |
| |
419 | 419 |
| |
420 |
| - | |
| 420 | + | |
421 | 421 |
| |
422 | 422 |
| |
423 | 423 |
| |
| |||
1485 | 1485 |
| |
1486 | 1486 |
| |
1487 | 1487 |
| |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
1488 | 1492 |
| |
1489 | 1493 |
| |
1490 | 1494 |
| |
| |||
1496 | 1500 |
| |
1497 | 1501 |
| |
1498 | 1502 |
| |
1499 |
| - | |
1500 |
| - | |
1501 |
| - | |
1502 |
| - | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
1503 | 1507 |
| |
1504 |
| - | |
| 1508 | + | |
1505 | 1509 |
| |
1506 | 1510 |
| |
1507 | 1511 |
| |
| |||
1535 | 1539 |
| |
1536 | 1540 |
| |
1537 | 1541 |
| |
1538 |
| - | |
1539 |
| - | |
1540 | 1542 |
| |
1541 | 1543 |
| |
1542 | 1544 |
| |
| |||
1549 | 1551 |
| |
1550 | 1552 |
| |
1551 | 1553 |
| |
1552 |
| - | |
| 1554 | + | |
| 1555 | + | |
1553 | 1556 |
| |
1554 | 1557 |
| |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
1555 | 1563 |
| |
1556 | 1564 |
| |
1557 |
| - | |
| 1565 | + | |
1558 | 1566 |
| |
1559 | 1567 |
| |
1560 | 1568 |
| |
1561 | 1569 |
| |
1562 | 1570 |
| |
1563 | 1571 |
| |
1564 |
| - | |
| 1572 | + | |
1565 | 1573 |
| |
1566 | 1574 |
| |
1567 | 1575 |
| |
1568 | 1576 |
| |
1569 |
| - | |
| 1577 | + | |
1570 | 1578 |
| |
1571 | 1579 |
| |
1572 | 1580 |
| |
1573 |
| - | |
| 1581 | + | |
1574 | 1582 |
| |
1575 | 1583 |
| |
1576 | 1584 |
| |
| |||
1607 | 1615 |
| |
1608 | 1616 |
| |
1609 | 1617 |
| |
1610 |
| - | |
| 1618 | + | |
1611 | 1619 |
| |
1612 |
| - | |
1613 | 1620 |
| |
1614 | 1621 |
| |
1615 | 1622 |
| |
|
Lines changed: 42 additions & 32 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
10 | 18 |
| |
11 | 19 |
| |
12 | 20 |
| |
| |||
97 | 105 |
| |
98 | 106 |
| |
99 | 107 |
| |
100 |
| - | |
101 |
| - | |
102 |
| - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
103 | 111 |
| |
104 |
| - | |
| 112 | + | |
105 | 113 |
| |
106 | 114 |
| |
107 | 115 |
| |
| |||
125 | 133 |
| |
126 | 134 |
| |
127 | 135 |
| |
| 136 | + | |
128 | 137 |
| |
129 | 138 |
| |
130 | 139 |
| |
131 | 140 |
| |
132 |
| - | |
| 141 | + | |
| 142 | + | |
133 | 143 |
| |
134 | 144 |
| |
135 | 145 |
| |
| 146 | + | |
136 | 147 |
| |
137 |
| - | |
| 148 | + | |
138 | 149 |
| |
139 |
| - | |
140 | 150 |
| |
141 |
| - | |
142 |
| - | |
143 |
| - | |
144 |
| - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
145 | 157 |
| |
146 | 158 |
| |
147 | 159 |
| |
| |||
522 | 534 |
| |
523 | 535 |
| |
524 | 536 |
| |
525 |
| - | |
526 |
| - | |
527 |
| - | |
528 |
| - | |
529 |
| - | |
530 |
| - | |
531 |
| - | |
532 |
| - | |
533 |
| - | |
534 |
| - | |
535 |
| - | |
536 |
| - | |
537 |
| - | |
538 |
| - | |
539 |
| - | |
540 |
| - | |
541 |
| - | |
542 |
| - | |
543 |
| - | |
544 |
| - | |
545 | 537 |
| |
546 | 538 |
| |
547 | 539 |
| |
548 | 540 |
| |
549 | 541 |
| |
550 | 542 |
| |
551 | 543 |
| |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
552 | 561 |
| |
553 | 562 |
| |
554 | 563 |
| |
| |||
574 | 583 |
| |
575 | 584 |
| |
576 | 585 |
| |
577 |
| - | |
| 586 | + | |
| 587 | + | |
578 | 588 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
45 |
| - | |
| 45 | + | |
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
43 |
| - | |
44 | 43 |
| |
45 | 44 |
| |
46 | 45 |
|
0 commit comments
Comments
(0)