Skip to content

Commit 1a3e82a

Browse files
committed
Restore some comments lost during 15732b3
Michael Paquier
1 parent a3b4aee commit 1a3e82a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/backend/catalog/index.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,9 +1446,11 @@ index_drop(Oid indexId, bool concurrent)
14461446

14471447
/*
14481448
* Now we must wait until no running transaction could be using the
1449-
* index for a query. Note we do not need to worry about xacts that
1450-
* open the table for reading after this point; they will see the
1451-
* index as invalid when they open the relation.
1449+
* index for a query. Use AccessExclusiveLock here to check for
1450+
* running transactions that hold locks of any kind on the table.
1451+
* Note we do not need to worry about xacts that open the table for
1452+
* reading after this point; they will see the index as invalid when
1453+
* they open the relation.
14521454
*
14531455
* Note: the reason we use actual lock acquisition here, rather than
14541456
* just checking the ProcArray and sleeping, is that deadlock is

src/backend/commands/indexcmds.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,10 @@ DefineIndex(IndexStmt *stmt,
651651
* for an overview of how this works)
652652
*
653653
* Now we must wait until no running transaction could have the table open
654-
* with the old list of indexes. Note we do not need to worry about xacts
655-
* that open the table for writing after this point; they will see the new
656-
* index when they open it.
654+
* with the old list of indexes. Use ShareLock to consider running
655+
* transactions that hold locks that permit writing to the table. Note we
656+
* do not need to worry about xacts that open the table for writing after
657+
* this point; they will see the new index when they open it.
657658
*
658659
* Note: the reason we use actual lock acquisition here, rather than just
659660
* checking the ProcArray and sleeping, is that deadlock is possible if

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy