Unverified Commit 295f2d17 authored by Shubham Dhama's avatar Shubham Dhama Committed by GitHub
Browse files

Fix issue where the replay process fails to reach the end position. (#566)

In some cases, the replay process doesn't reach the endpos due to a problem
in the stream process. The problem arises when stream process receives a
'k' message from wal sender and reaches the endpos. But instead of writing
the newly received LSN, we write previous LSN with the KEEPALIVE message.
The following filtered logs from the streaming process illustrate this
issue.

```
endpos is now set to 3/AF01C408
Reported write_lsn 3/AF01C408, flush_lsn 3/AF01BF38, replay_lsn 3/AF01BF38
streamFlush: 3/AF01C408 3/AF01C0A0
Inserted action KEEPALIVE for lsn 3/AF01C0A0 @2023-11-27 11:43:55.946327+0000
Flushed up to 3/AF01C0A0 in file "cdc/0000000100000003000000AF.json.partial"
pgsql_stream_logical: endpos reached on keepalive: 3/AF01C5A0
streamFlush: 3/AF01C5A0 3/AF01C0A0
Inserted action KEEPALIVE for lsn 3/AF01C0A0 @2023-11-27 11:43:59.754050+0000
```
parent bb2e3e09
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment