-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Sync active memtable and value log on Db.Sync (#1847) #1953
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that we may need to consider acquiring some lock while accessing the memtable and vlog. Please look into it. Also, address the comments from the CI. CI also is not happy.
Linting part is ok, I will reduce the line length in the comment.
I am not sure if I can cover this part. |
Don't worry about it for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy with the change now. I will let @joshua-goldstein approve it for merging after review. Thanks for the PR Sarthak.
Welcome Aman :). Thank you for all the help. |
Fixes #1847
Currently,
DB.Sync()
only syncs the value log but not the WAL of the active memtable, however recovery happens from the WAL of the active memtable as a part of theDB.Open()
method.This change attempts to sync both the logs, however there can be an issue in syncing one of the logs. This change lists all of the possible cases that can arise during the sync operations. Some of these issues will be taken separately. For example,
the issue #1954 can arise and shall be handled separately.
This change adds a few tests to ensure that the Sync behavior is not broken. This change also adds a learning test
(db2_test.go -> TestAssertValueLogIsNotWrittenToOnStartup)
to ensure that value log is only read from (and not written to) during startup. This learning shall be used in the next issue (the one described above (*))