-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Use WAL instead of Vlog for crash recovery. #1535
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
Closed
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
3d4091c
TestUpdateAndView fails
NamanJain8 c84b212
Merge branch 'master' into naman/wal
0631de4
Skip all vlog truncate tests
fe3af25
Add some todos and move filesDelete to logwrapper
145932c
move fileLock and numIterators logWrapper
NamanJain8 b74ca81
close wal files after use
NamanJain8 1617c92
remove garbage changes
NamanJain8 875081b
fix close
NamanJain8 9b0f4e9
Remove unnecessary logs
9a526cc
Use wal offset as Head and fix ReadOnly Test
9c6f266
All Write and Read tests work
df468c4
Fix WAL head and ForceFlushMemtable test
155436e
Fix TestLSMOnly
c0a618a
Fix WalTruncate test
7f8bd5f
add wal cleaner and fix few tests
NamanJain8 c1b6e03
create vlog file only if required for writing, fix value_tests
NamanJain8 6c14c71
fix typo
NamanJain8 ac9a1a0
fixes refactoring
NamanJain8 d853b6e
mmap vlog files on value log open
NamanJain8 75b1cb9
initialize vlog completely before replay
NamanJain8 9459922
add replay wal, needs refactoring
NamanJain8 2547e4b
some refactoring
NamanJain8 a1c0e2e
fix GCManaged test
NamanJain8 d53e4bc
minor changes
NamanJain8 97c9c4f
refactor write code
NamanJain8 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,7 @@ func TestTruncateVlogWithClose(t *testing.T) { | |
|
|
||
| // Close the DB. | ||
| require.NoError(t, db.Close()) | ||
| require.NoError(t, os.Truncate(path.Join(dir, "000000.vlog"), 4090)) | ||
| require.NoError(t, os.Truncate(path.Join(dir, "000000.wal"), 4090)) | ||
|
|
||
| // Reopen and write some new data. | ||
| db, err = Open(opt) | ||
|
|
@@ -697,6 +697,7 @@ func TestL0GCBug(t *testing.T) { | |
| // Step 3 - Re-open the same badger. We should be able to read all the data | ||
| // inserted in the first step. | ||
| func TestWindowsDataLoss(t *testing.T) { | ||
| // TODO(ibrahim): Do we need this test? | ||
| if runtime.GOOS != "windows" { | ||
| t.Skip("The test is only for Windows.") | ||
| } | ||
|
|
@@ -742,8 +743,8 @@ func TestWindowsDataLoss(t *testing.T) { | |
| } | ||
| // Don't use vlog.Close here. We don't want to fix the file size. Only un-mmap | ||
| // the data so that we can truncate the file durning the next vlog.Open. | ||
| require.NoError(t, y.Munmap(db.vlog.filesMap[db.vlog.maxFid].fmap)) | ||
| for _, f := range db.vlog.filesMap { | ||
| require.NoError(t, y.Munmap(db.vlog.vlog.filesMap[db.vlog.vlog.maxFid].fmap)) | ||
NamanJain8 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| for _, f := range db.vlog.vlog.filesMap { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Call vlog as logManager |
||
| require.NoError(t, f.fd.Close()) | ||
| } | ||
| require.NoError(t, db.registry.Close()) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Add a comment.