mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-03 15:57:10 +02:00
pgstat: drop subscription stats regardless of slot, fix comment
There's no reason anymore to only drop subscription stats if associated with a slot, now that stats drops are transactional. Additionally, the comment referring to autovacuum cleaning up stats was clearly outdated. Author: Masahiko Sawada <sawada.mshk@gmail.com> Discussion: https://postgr.es/m/CAD21AoAwiby3HeJE7vJe16Gr75RFfJ640dyHqvsiUhyKJTXPtw@mail.gmail.com Backpatch: 15-
This commit is contained in:
parent
30efc3b5a3
commit
596172260a
@ -1579,15 +1579,9 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel)
|
||||
|
||||
/*
|
||||
* Tell the cumulative stats system that the subscription is getting
|
||||
* dropped. We can safely report dropping the subscription statistics here
|
||||
* if the subscription is associated with a replication slot since we
|
||||
* cannot run DROP SUBSCRIPTION inside a transaction block. Subscription
|
||||
* statistics will be removed later by (auto)vacuum either if it's not
|
||||
* associated with a replication slot or if the message for dropping the
|
||||
* subscription gets lost.
|
||||
* dropped.
|
||||
*/
|
||||
if (slotname)
|
||||
pgstat_drop_subscription(subid);
|
||||
pgstat_drop_subscription(subid);
|
||||
|
||||
table_close(rel, NoLock);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user