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

Commitdff178f

Browse files
committed
More cleanup after failed reduced-lock-levels-for-DDL feature.
Turns out that use of ShareUpdateExclusiveLock or ShareRowExclusiveLockto protect DDL changes had gotten copied into several places that werenot touched by either of Simon's original patches for the feature, andthus neither he nor I thought to revert them. (Indeed, it appears thattwo of these uses were committed *after* the reversion, which just goesto show that git merging is no panacea.) Change these places to useAccessExclusiveLock again. If we ever manage to resurrect that feature,we're going to have to think a bit harder about how to keep lock levelusage in sync for DDL operations that aren't within the AlterTableinfrastructure.Two of these bugs are only in HEAD, but one is in the 9.1 branch too.Alvaro found one of them, I found the other two.
1 parent5c5138f commitdff178f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/backend/catalog/toasting.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ AlterTableCreateToastTable(Oid relOid, Datum reloptions)
5959
Relationrel;
6060

6161
/*
62-
* Grab a DDL-exclusive lock on the target table, since we'll update the
63-
* pg_class tuple.This is redundant for all present users. Tuple
64-
* toasting behaves safely in the face of a concurrent TOAST table add.
62+
* Grab an exclusive lock on the target table, since we'll update its
63+
* pg_class tuple. This is redundant for all present uses, since caller
64+
* will have such a lock already. But the lock is needed to ensure that
65+
* concurrent readers of the pg_class tuple won't have visibility issues,
66+
* so let's be safe.
6567
*/
66-
rel=heap_open(relOid,ShareUpdateExclusiveLock);
68+
rel=heap_open(relOid,AccessExclusiveLock);
6769

6870
/* create_toast_table does all the work */
6971
(void)create_toast_table(rel,InvalidOid,InvalidOid,reloptions);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp