Re: shared-memory based stats collector

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: gkokolatos(at)protonmail(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: shared-memory based stats collector
Date: 2020-11-04 08:39:10
Message-ID: 20201104.173910.2039727857513138224.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Fri, 30 Oct 2020 15:00:55 +0000, Georgios Kokolatos <gkokolatos(at)protonmail(dot)com> wrote in
> Hi,
>
> I noticed that according to the cfbot this patch no longer applies.
>
> As it is registered in the upcoming commitfest, it would be appreciated
> if you could rebase it.

Thanks! The replication slot stats patch (9868167500) hit this.

- Fixed a bug of original code.

get_stat_entry() returned a wrong result to found when shared entry
exists but it is not locally cached.

- Moved replication slot stats into shared memory stats.

Differently from wal_stats and slru_stats, it can be implemented as a
part of unified stats entry. I'm tempted to remove the entry for a
dropped slot immediately, but I didn't that since the number of the
slots should be under 10 or so and dropping an entry requires
exclusive lock on dshash. Instead, dropped entries are removed at
file-write time that happens only at the end of a process.

I had to clean up replication slots in pgstat_beshutdown_hook(). Even
though we have exactly the same code in several other places, the
function must be called before disabling DSA because we cannot update
statistics after detaching the shared-memory stats. Perhaps we can
remove some of the existing calling to ReplicationSlotCleanup() but I
haven't do that in this version.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
v40-0001-sequential-scan-for-dshash.patch text/x-patch 8.8 KB
v40-0002-Add-conditional-lock-feature-to-dshash.patch text/x-patch 6.2 KB
v40-0003-Make-archiver-process-an-auxiliary-process.patch text/x-patch 17.7 KB
v40-0004-Shared-memory-based-stats-collector.patch text/x-patch 294.9 KB
v40-0005-Doc-part-of-shared-memory-based-stats-collector.patch text/x-patch 20.7 KB
v40-0006-Remove-the-GUC-stats_temp_directory.patch text/x-patch 13.6 KB
v40-0007-Exclude-pg_stat-directory-from-base-backup.patch text/x-patch 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-11-04 08:48:41 Re: Online verification of checksums
Previous Message Julien Rouhaud 2020-11-04 08:21:47 Re: Collation versioning