Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9bb2ce5

Browse files
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.com
1 parent128ce8e commit9bb2ce5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14786,7 +14786,7 @@ ATExecDetachPartition(Relation rel, RangeVar *name)
1478614786
idx=index_open(idxid,AccessExclusiveLock);
1478714787
IndexSetParentIndex(idx,InvalidOid);
1478814788
update_relispartition(classRel,idxid, false);
14789-
relation_close(idx,AccessExclusiveLock);
14789+
index_close(idx,NoLock);
1479014790
}
1479114791
heap_close(classRel,RowExclusiveLock);
1479214792

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp