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

Commit7b64e4b

Browse files
committed
pgstat: drop subscription stats without slot as well, fix comment
There's no reason anymore to only drop subscription stats if associated with aslot, now that stats drops are transactional. And since there's now no othercleanup of stats, this would lead to stats for slot-less subscriptions to getleaked (however most slot-less subs won't have stats).Additionally, the comment referring to autovacuum cleaning up stats wasclearly outdated.Author: Masahiko Sawada <sawada.mshk@gmail.com>Discussion:https://postgr.es/m/CAD21AoAwiby3HeJE7vJe16Gr75RFfJ640dyHqvsiUhyKJTXPtw@mail.gmail.comBackpatch: 15-
1 parentb0a55e4 commit7b64e4b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

‎src/backend/commands/subscriptioncmds.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,15 +1578,9 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel)
15781578

15791579
/*
15801580
* Tell the cumulative stats system that the subscription is getting
1581-
* dropped. We can safely report dropping the subscription statistics here
1582-
* if the subscription is associated with a replication slot since we
1583-
* cannot run DROP SUBSCRIPTION inside a transaction block. Subscription
1584-
* statistics will be removed later by (auto)vacuum either if it's not
1585-
* associated with a replication slot or if the message for dropping the
1586-
* subscription gets lost.
1581+
* dropped.
15871582
*/
1588-
if (slotname)
1589-
pgstat_drop_subscription(subid);
1583+
pgstat_drop_subscription(subid);
15901584

15911585
table_close(rel,NoLock);
15921586
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp