暂无图片
opengauss如何查找lsn对应的具体时间?
我来答
分享
桑凯
2022-09-01
opengauss如何查找lsn对应的具体时间?

如下段同步信息,
sender_xxx_location和receiver_xxx_location 有较多lsn信息,如何转换这些lsn到具体的时间点。
[omm@mogdbv3s1 ~]$ gs_ctl query
[2022-09-01 21:16:41.815][19870][][gs_ctl]: gs_ctl query ,datadir is /opt/mogdb/data
HA state:
local_role : Standby
static_connections : 2
db_state : Normal
detail_information : Normal

Senders info:
No information
Receiver info:
receiver_pid : 13482
local_role : Standby
peer_role : Primary
peer_state : Normal
state : Normal
** sender_sent_location : 5/67814800
sender_write_location : 5/67814800
sender_flush_location : 5/67814800
sender_replay_location : 5/67814800
receiver_received_location : 5/67814800
receiver_write_location : 5/67814800
receiver_flush_location : 5/67814800
receiver_replay_location : 5/67814800**
sync_percent : 100%
channel : 192.168.5.31:56158<–192.168.5.30:26001

我来答
添加附件
收藏
分享
问题补充
3条回答
默认
最新
农夫三拳

lsn消耗跟时间没有强关联关系

可以通过select pg_xlogfile_name('5/67814800');查xlog文件名,

xlog文件修改时间定大致的时间范围

暂无图片 评论
暂无图片 有用 1
桑凯
题主
2022-09-06
这种不够精确,比如分钟内的延迟看不出来。看看还有没有更好的办法。
桑凯

这种不够精确,比如分钟内的延迟看不出来。看看还有没有更好的办法。

暂无图片 评论
暂无图片 有用 0
农夫三拳
2022-09-06
查带时间戳的业务表,最新一条记录
DarkAthena

看看这个函数,直接给了个RTO的时间

select * from local_recovery_status();

还有这个视图

select * from global_rto_status;
暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏