8000 Fix issue where the replay process fails to reach the end position. by shubhamdhama · Pull Request #566 · dimitri/pgcopydb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix issue where the replay process fai 8000 ls to reach the end position. #566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

shubhamdhama
Copy link
Contributor

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

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
```
@dimitri dimitri merged commit 295f2d1 into dimitri:main Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0