forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0c23771
committed
DETACH PARTITION: hold locks on indexes until end of transaction
When a partition is detached from its parent, we acquire locks on allattached indexes to also detach them ... but we release those locksimmediately. This is a violation of the policy of keeping locks on userobjects to the end of the transaction. Bug introduced in8b08f7d.It's unclear that there are any ill effects possible, but it's clearlywrong nonetheless. It's likely that bad behavior *is* possible, butmostly because the relation that the index is for is only locked withAccessShareLock, which is an older bug that shall be fixed separately.While touching that line of code, close the index opened withindex_open() using index_close() instead of relation_close().No difference in practice, but let's be consistent.Unearthed by Robert Haas.Discussion:https://postgr.es/m/CA+TgmoYruJQ+2qnFLtF1xQtr71pdwgfxy3Ziy-TxV28M6pEmyA@mail.gmail.com1 parent4cba9c2 commit0c23771
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14648 | 14648 |
| |
14649 | 14649 |
| |
14650 | 14650 |
| |
14651 |
| - | |
| 14651 | + | |
14652 | 14652 |
| |
14653 | 14653 |
| |
14654 | 14654 |
| |
|
0 commit comments
Comments
(0)