Re: Subscription statistics are not dropped at DROP SUBSCRIPTION in some cases
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-05-09T00:07:21Z
Lists: pgsql-hackers
On Mon, May 08, 2023 at 04:23:15PM +0900, Masahiko Sawada wrote: > We call pgstat_drop_subscription() at the end of DropSubscription() > but we could leave from this function earlier e.g. when no slot is > associated with the subscription. In this case, the statistics entry > for the subscription remains. To fix it, I think we need to call it > earlier, just after removing the catalog tuple. There is a chance the > transaction dropping the subscription fails due to network error etc > but we don't need to worry about it as reporting the subscription drop > is transactional. Looks reasonable to me. IIUC calling pgstat_drop_subscription() earlier makes no real difference (besides avoiding this bug) because it is uѕing pgstat_drop_transactional() behind the scenes. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
Commits
-
Stabilize subscription stats test.
- 28ed5ecbe071 17.0 landed
- 1b95c8d85fa6 16.0 landed
- 461a7fad7c67 15.5 landed
-
pgstat: fix subscription stats entry leak.
- be8cae7e2f03 16.0 landed
- 66f8a1397319 15.4 landed
- 68a59f9e9983 17.0 landed
-
Create subscription stats entry at CREATE SUBSCRIPTION time
- e0b014295906 16.0 cited
-
pgstat: drop subscription stats without slot as well, fix comment
- 7b64e4b3fa04 16.0 cited