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

Improve SeiDB replay&restart time by 2x #82

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

yzang2019
Copy link
Collaborator

@yzang2019 yzang2019 commented Jan 7, 2025

Describe your changes and provide context

Add parallelization for replaying changelog on all modules during restart. Reduced restart/replay time by 2x, 15 minutes -> 7 minutes

Testing performed to validate your change

Before this change:

Jan 07 11:13:43 ip-172-31-9-162 seid[38481]: 11:13AM INF Start catching up and replaying the MemIAVL changelog file
Jan 07 11:26:20 ip-172-31-9-162 seid[38481]: 11:26AM INF Finished the replay and caught up to version 0

After this change:

Jan 07 11:14:49 ip-172-31-2-59 seid[39128]: 11:14AM INF Start catching up and replaying the MemIAVL changelog file
Jan 07 11:21:57 ip-172-31-2-59 seid[39128]: 11:21AM INF Finished the replay and caught up to version 0

Comment on lines 131 to 137
go func() {
defer t.pendingWg.Done()
for nextChange := range t.pendingChanges {
t.ApplyChangeSet(nextChange)
t.SaveVersion(false)
}
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism
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.

3 participants