如何查询日志回放延迟,以及如何针对性降低日志回放延迟

【 使用环境 】生产环境
【 OB or 其他组件 】OB
【 使用版本 】4.3.4.1
【问题描述】
集群为1-1-1集群。由于还未规划好表分区。目前所有表的主副本都在一台机器上。其他两台机器提供了弱读功能。

但是实际使用时发现,弱读延迟可能在30s以上了。
如图为写入时间点,以及写入数量
image
如图为弱读时间点,以及读取到的数量
image
经过接近半分钟,弱读到的数据仍只有一部分

查看文档,从副本的数据文本延迟时间可以通过这个 replay_service_ts 来计算出来。但不知道从何入手。

可以查看一下 clog 同步最大延迟:

select /* MONITOR_AGENT */ leader.tenant_id, ‘0’ as replica_type, abs(max(CAST(leader_ts as SIGNED)-CAST(follower_ts as SIGNED)))/1000000000 max_clog_sync_delay_seconds from (select max(end_scn) leader_ts, tenant_id, role from oceanbase.GV$OB_LOG_STAT where role=‘LEADER’ group by tenant_id ) leader inner join (select min(end_scn) follower_ts, tenant_id, role from oceanbase.GV$OB_LOG_STAT where role=‘FOLLOWER’ group by tenant_id ) follower on leader.tenant_id=follower.tenant_id group by leader.tenant_id;

查询无结果。 clog同步延迟很低。就想看看clog回放延迟。

可以这样查询确认日志流副本的同步位点(end_scn), 已提交回放的位点(unsubmitted_log_scn) 和在回放队列中等待回放的日志任务数(pending_task_count)。
select a.svr_ip, a.svr_port, a.tenant_id, a.ls_id, b.end_scn, a.unsubmitted_log_scn, a.pending_cnt from __all_virtual_replay_stat a join __all_virtual_log_stat b on a.svr_ip=b.svr_ip and a.svr_port=b.svr_port and a.tenant_id=b.tenant_id and a.ls_id = b.ls_id and a.role=‘FOLLOWER’