From: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | New function(s) to get various timelines that the postgres server deals with. |
Date: | 2022-04-07 14:15:24 |
Message-ID: | CALj2ACXTed9-OhGhaEQqkwpepuHQ0+F9kU5pXz7OeOS1pyST5A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
I see there's no single function one can rely on to get various
timeline IDs [1] the postgres server deals with. We have the following
functions that emit controlfile's timelines
pg_control_checkpoint() - returns
ControlFile->checkPointCopy.ThisTimeLineID and
ControlFile->checkPointCopy.PrevTimeLineID
pg_control_recovery() - returns ControlFile->minRecoveryPointTLI
Most of the times XLogCtl->{InsertTimeLineID, PrevTimeLineID} and
ControlFile->checkPointCopy.{ThisTimeLineID, PrevTimeLineID} may be
the same (?).
No functions emit XLogRecoveryCtl->{lastReplayedTLI, replayEndTLI} and
WalRcv->{receiveStartTLI, receivedTLI}.
We may think of letting pg_current_wal_XXX, pg_last_wal_replay_lsn and
pg_last_wal_receive_lsn to return XLogCtl->{InsertTimeLineID,
PrevTimeLineID}, XLogRecoveryCtl->{lastReplayedTLI, replayEndTLI} and
WalRcv->{receiveStartTLI, receivedTLI} respectively, but the names of
those functions need a change which I don't think is a great idea
given the fact that many client apps, control planes would have used
them.
We have two options:
1) Having a new set of functions, something like pg_current_wal_tli,
pg_last_wal_replay_tli and pg_last_wal_receive_tli.
2) A single function, something like pg_get_server_tlis or
pg_get_wal_timelines or some other.
I prefer option (1).
Thoughts?
[1]
XLogCtl->InsertTimeLineID
XLogCtl->PrevTimeLineID
XLogRecoveryCtl->lastReplayedTLI
XLogRecoveryCtl->replayEndTLI
WalRcv->receiveStartTLI
WalRcv->receivedTLI
ControlFile->checkPointCopy.ThisTimeLineID
ControlFile->checkPointCopy.PrevTimeLineID
ControlFile->minRecoveryPointTLI
Regards,
Bharath Rupireddy.
From | Date | Subject | |
---|---|---|---|
Next Message | chap | 2022-04-07 14:30:13 | Re: trigger example for plsample |
Previous Message | David Rowley | 2022-04-07 14:11:06 | Re: Window Function "Run Conditions" |