-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use WAL instead of Vlog for crash recovery. #1535
Conversation
8bbe1a9
to
a1c0e2e
Compare
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.
LGTM. 1 rules errored during the review.
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.
Delete all wal files on successful db close.
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)) | ||
for _, f := range db.vlog.vlog.filesMap { |
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.
Call vlog as logManager
@@ -861,7 +949,7 @@ func (db *DB) writeRequests(reqs []*request) error { | |||
return errors.Wrap(err, "writeRequests") | |||
} | |||
db.Lock() | |||
db.updateHead(b.Ptrs) | |||
db.updateHead([]valuePointer{b.head}) |
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.
db.go
Outdated
@@ -137,7 +217,12 @@ func (db *DB) replayFunction() func(Entry, valuePointer) error { | |||
nv = make([]byte, len(e.Value)) | |||
copy(nv, e.Value) | |||
} else { | |||
nv = vp.Encode() | |||
// Write to vlog and get the value pointer to vlog | |||
vlogP, err := toVlog(&e) |
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.
We'll need a test for this.
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.
LGTM. 1 rules errored during the review.
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.
LGTM. 1 rules errored during the review.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this as this is not needed now. #1555 was merged which fixes the issue. |
Fixes DGRAPH-2177
This PR separates smaller values from vlog and instead stores it in WAL.
This leads to minimization of disk usage as WAL files can be easily cleaned.
Smaller values ( <ValueThreshold ): WAL -> LSM
Bigger values : WAL -> Vlog -> LSM
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)