diff options
| author | Robert Haas <rhaas@postgresql.org> | 2024-01-11 12:41:18 -0500 |
|---|---|---|
| committer | Robert Haas <rhaas@postgresql.org> | 2024-01-11 12:41:18 -0500 |
| commit | d9ef650fca7bc574586f4171cd929cfd5240326e (patch) | |
| tree | f855558ef73e86522b3859fa8ad4bc3fd005a38f /src/include | |
| parent | 544bcb5a5e778e8ef8d784de611c5f85bc33433c (diff) | |
Add new function pg_get_wal_summarizer_state().
This makes it possible to access information about the progress
of WAL summarization from SQL. The previously-added functions
pg_available_wal_summaries() and pg_wal_summary_contents() only
examine on-disk state, but this function exposes information from
the server's shared memory.
Discussion: http://postgr.es/m/CA+Tgmobvqqj-DW9F7uUzT-cQqs6wcVb-Xhs=w=hzJnXSE-kRGw@mail.gmail.com
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/catalog/catversion.h | 2 | ||||
| -rw-r--r-- | src/include/catalog/pg_proc.dat | 9 | ||||
| -rw-r--r-- | src/include/postmaster/walsummarizer.h | 4 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 686667a0f88..a94dcdc2713 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -57,6 +57,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 202401041 +#define CATALOG_VERSION_NO 202401111 #endif diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 7979392776d..58811a6530b 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -12142,5 +12142,14 @@ proargmodes => '{i,i,i,o,o,o,o,o,o}', proargnames => '{tli,start_lsn,end_lsn,relfilenode,reltablespace,reldatabase,relforknumber,relblocknumber,is_limit_block}', prosrc => 'pg_wal_summary_contents' }, +{ oid => '8438', + descr => 'WAL summarizer state', + proname => 'pg_get_wal_summarizer_state', + provolatile => 'v', proparallel => 's', + prorettype => 'record', proargtypes => '', + proallargtypes => '{int8,pg_lsn,pg_lsn,int4}', + proargmodes => '{o,o,o,o}', + proargnames => '{summarized_tli,summarized_lsn,pending_lsn,summarizer_pid}', + prosrc => 'pg_get_wal_summarizer_state' }, ] diff --git a/src/include/postmaster/walsummarizer.h b/src/include/postmaster/walsummarizer.h index 75cb1d709fc..d6e61b59ac7 100644 --- a/src/include/postmaster/walsummarizer.h +++ b/src/include/postmaster/walsummarizer.h @@ -23,6 +23,10 @@ extern Size WalSummarizerShmemSize(void); extern void WalSummarizerShmemInit(void); extern void WalSummarizerMain(void) pg_attribute_noreturn(); +extern void GetWalSummarizerState(TimeLineID *summarized_tli, + XLogRecPtr *summarized_lsn, + XLogRecPtr *pending_lsn, + int *summarizer_pid); extern XLogRecPtr GetOldestUnsummarizedLSN(TimeLineID *tli, bool *lsn_is_exact, bool reset_pending_lsn); |
