【标题】(请简要描述下实现的内容)
修复开启synchronous_commit='remote_apply'后,事务提交延迟过大的问题

【根因分析】:
备库向主库反馈apply_lsn时有一个timeout。这个timeout是wal_receiver_status_interval(默认5s)控制的。简单来说就是在没有新的wal接收到的情况下,备库每隔wal_receiver_status_interval向主库反馈一个lsn位点。所以出现事务提交延迟5s的现象。

【实现内容】:
在判断是否应该向主库发送feedback时,添加一个判断条件,如果当前的apply_lsn大于之前的apply_lsn,那么此时应该向主库反馈新的apply_lsn值

【关联需求或issue】:
#I7F570:开启synchronous_commit='remote_apply'后,事务提交延迟过大

【开发自验报告】:

修改前

MogDB=# select now();insert into t4 select generate_series(1,1000);select now();
              now              
-------------------------------
 2023-06-20 21:37:06.859697-04
(1 row)

INSERT 0 1000
              now              
-------------------------------
 2023-06-20 21:37:09.866949-04
(1 row)

MogDB=#

修改后



MogDB=# select now();insert into t4 select generate_series(1,1000);select now();
              now              
-------------------------------
 2023-06-20 22:46:46.377741-04
(1 row)

INSERT 0 1000
              now              
-------------------------------
 2023-06-20 22:46:46.386989-04
(1 row)

MogDB=#