Skip to content

Commit e27ac96

Browse files
committed
fix: excluded 'config' parameter from bootstrap
1 parent 9db6fc9 commit e27ac96

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

mamonsu/tools/bootstrap/sql.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
CREATE OR REPLACE FUNCTION mamonsu.timestamp_get()
5252
RETURNS double precision AS $$
5353
SELECT
54-
(extract(epoch from now() at time zone 'utc') - ts)::double precision
54+
CASE WHEN pg_last_{11}() = pg_last_{12}() THEN 0
55+
ELSE extract (epoch FROM now() - coalesce(pg_last_xact_replay_timestamp(), to_timestamp(ts)))
56+
END
5557
FROM mamonsu.timestamp_master_{1}
5658
WHERE id = 1 LIMIT 1;
5759
$$ LANGUAGE SQL SECURITY DEFINER;

mamonsu/tools/bootstrap/start.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ def fill_query_params(queries):
168168
'flush_lag INTERVAL, replay_lag INTERVAL, write_lag INTERVAL,' if Pooler.server_version_greater('10.0')
169169
else '',
170170
'lsn' if Pooler.server_version_greater('10.0') else 'location',
171-
'walfile' if Pooler.server_version_greater('10.0') else 'xlogfile'
171+
'walfile' if Pooler.server_version_greater('10.0') else 'xlogfile',
172+
'wal_receive_lsn' if Pooler.server_version_greater('10.0') else 'xlog_receive_location',
173+
'wal_replay_lsn' if Pooler.server_version_greater('10.0') else 'xlog_replay_location'
172174
).split(QuerySplit):
173175
formatted_queries += sql
174176
return formatted_queries

0 commit comments

Comments
 (0)