Issue with pg_stat_subscription_stats

Поиск
Список
Период
Сортировка
От Melanie Plageman
Тема Issue with pg_stat_subscription_stats
Дата
Msg-id CAAKRu_Zqd-e5imT_3-ZiQv1cfsWuy16OJTiUaCvqpq4V7GVdSg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Issue with pg_stat_subscription_stats  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
So, I noticed that pg_stat_reset_subscription_stats() wasn't working
properly, and, upon further investigation, I'm not sure the view
pg_stat_subscription_stats is being properly populated.

I don't think subscriptionStatHash will be created properly and that the
reset timestamp won't be initialized without the following code:

diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 53ddd930e6..0b8c5436e9 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -3092,7 +3092,7 @@ pgstat_fetch_stat_subscription(Oid subid)
        /* Load the stats file if needed */
        backend_read_statsfile();

-       return pgstat_get_subscription_entry(subid, false);
+       return pgstat_get_subscription_entry(subid, true);
 }

 /*
@@ -6252,7 +6252,7 @@ pgstat_get_subscription_entry(Oid subid, bool create)

        /* If not found, initialize the new one */
        if (!found)
-               pgstat_reset_subscription(subentry, 0);
+               pgstat_reset_subscription(subentry, GetCurrentTimestamp());

        return subentry;
 }

- melanie



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Non-replayable WAL records through overflows and >MaxAllocSize lengths
Следующее
От: Robert Haas
Дата:
Сообщение: Re: On login trigger: take three