[pgpool-hackers: 4104] Re: Proposal: allow to specify replication delay by time
Tatsuo Ishii
ishii at sraoss.co.jp
Fri Jan 21 14:12:40 JST 2022
> Currently delay_threshold specifies replication delay upper limit in
> bytes. It will be more intuitive to specify the replication delay by
> time like '10 seconds'. For this purpose, we can use
> (pg_last_committed_xact()).timestamp instead of pg_current_wal_lsn(),
> and pg_last_xact_replay_timestamp() instead of
> pg_last_wal_replay_lsn(). One thing we need to care about is, to use
> pg_last_committed_xact(), track_commit_timestamp (available in
> PostgreSQL 9.5 or after) must be enabled. If this is not enabled,
> pg_last_committed_xact() raises an error. Also the function returns
> NULL if no transaction is committed since the system started.
If pg_last_committed_xact() returns NULL or raises an error, we can
regard as if the replication delay is 0.
I think we also need to inform Pgpool-II whether we want the
replication delay in bytes or time. For this purpose I propose
following:
Introduce new parameter "delay_threshold_in_time" (default is 0
second). If delay_threshold_in_time is not 0, delay_threshold_in_time
is the preferred way to specify the upper limit of allowable
replication delay.
Best reagards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
More information about the pgpool-hackers
mailing list