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

Commit5ef9b4a

Browse files
committed
Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions.
The current use always releases this locktag. A planned use willcontinue that intent. It will involve more areas of code, making unlockomissions easier. Warn under debug_assertions, like we do for variousresource leaks. Back-patch to v12 (all supported versions), the planfor the commit of the new use.Reviewed by Heikki Linnakangas.Discussion:https://postgr.es/m/20240512232923.aa.nmisch@google.com
1 parent1299564 commit5ef9b4a

File tree

1 file changed

+10
-0
lines changed
  • src/backend/storage/lmgr

1 file changed

+10
-0
lines changed

‎src/backend/storage/lmgr/lock.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,6 +2278,16 @@ LockReleaseAll(LOCKMETHODID lockmethodid, bool allLocks)
22782278
locallock->numLockOwners=0;
22792279
}
22802280

2281+
#ifdefUSE_ASSERT_CHECKING
2282+
2283+
/*
2284+
* Tuple locks are currently held only for short durations within a
2285+
* transaction. Check that we didn't forget to release one.
2286+
*/
2287+
if (LOCALLOCK_LOCKTAG(*locallock)==LOCKTAG_TUPLE&& !allLocks)
2288+
elog(WARNING,"tuple lock held at commit");
2289+
#endif
2290+
22812291
/*
22822292
* If the lock or proclock pointers are NULL, this lock was taken via
22832293
* the relation fast-path (and is not known to have been transferred).

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp