Commit d2efb90d authored by Alvaro Herrera's avatar Alvaro Herrera

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
parent 3f60f690
...@@ -2142,6 +2142,10 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) ...@@ -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 * possible if one of the transactions in question is blocked trying
* to acquire an exclusive lock on our table. The lock code will * to acquire an exclusive lock on our table. The lock code will
* detect deadlock and error out properly. * 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); WaitForLockers(heaplocktag, AccessExclusiveLock, true);
...@@ -2157,7 +2161,7 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) ...@@ -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 * Wait till every transaction that saw the old index state has
* finished. * finished. See above about progress reporting.
*/ */
WaitForLockers(heaplocktag, AccessExclusiveLock, true); WaitForLockers(heaplocktag, AccessExclusiveLock, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment