Skip to content
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

Solution to the periodic slowdown of GetUpdatesSnce #12516

Open
1522140840 opened this issue Apr 7, 2024 · 0 comments
Open

Solution to the periodic slowdown of GetUpdatesSnce #12516

1522140840 opened this issue Apr 7, 2024 · 0 comments

Comments

@1522140840
Copy link

1522140840 commented Apr 7, 2024

In my project, I use GetUpdatesSince for master-slave synchronization. I have noticed that the execution time of this method periodically increases, and by examining the source code, it is easy to identify that it is caused by SeekToStartSequence. Essentially, this is due to the periodic enlargement of the WAL (Write-Ahead Log) file. To address this issue, I have made a small optimization in my project. My approach involves adding a new method called GoOnRead to the TransactionLogIterator. As long as the WAL file hasn't switched and there is new data being written, I reset the state of the iterator to be valid. This way, I don't have to frequently reopen the iterator and can read the new data.

The overall time-consuming issue of my master-slave synchronization with TP999 is as follows: [The program itself sleeps for 100ms.]

image
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

No branches or pull requests

1 participant