summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera2019-10-18 10:18:50 +0000
committerAlvaro Herrera2019-10-18 10:23:05 +0000
commitd2efb90dbad97828838ab356c03927b3dda65070 (patch)
treeee148550737380be351d1635c240b4f5e4d69a92
parent3f60f690fac1bf375b92cf2f8682e8fe8f690981 (diff)
Update comments about progress reporting by index_drop
Michaƫl Paquier complained that index_drop is requesting progress reporting for non-obvious reasons, so let's add a comment to explain why. Discussion: https://postgr.es/m/20191017010412.GH2602@paquier.xyz
-rw-r--r--src/backend/catalog/index.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 098732cc4a8..c48ad93e28b 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -2142,6 +2142,10 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode)
* possible if one of the transactions in question is blocked trying
* to acquire an exclusive lock on our table. The lock code will
* detect deadlock and error out properly.
+ *
+ * Note: we report progress through WaitForLockers() unconditionally
+ * here, even though it will only be used when we're called by REINDEX
+ * CONCURRENTLY and not when called by DROP INDEX CONCURRENTLY.
*/
WaitForLockers(heaplocktag, AccessExclusiveLock, true);
@@ -2157,7 +2161,7 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode)
/*
* Wait till every transaction that saw the old index state has
- * finished.
+ * finished. See above about progress reporting.
*/
WaitForLockers(heaplocktag, AccessExclusiveLock, true);