-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
New WAL implementation with configurable variables #1356
New WAL implementation with configurable variables #1356
Conversation
@arpitbbhayani @JyotinderSingh @gauravsarma1992 @psrvere please review |
Adding a comment here for context. We have discussed changes in the community call, please re-request a review once they are done. |
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.
Thanks for the changes so far @ayushsatyam146. I have left a few more comments.
config/config.go
Outdated
network.io_buffer_length_max = 51200 | ||
|
||
# WAL Configuration | ||
LogDir = "tmp/deicdeb-wal-lt" |
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.
Would suggest having a parent directory for storing logs and persistent data similar to Redis, PostgreSQL etc. which typically define parent directory paths to store logs/data related to app.
Have raised PR for the same here: #1359
WalMode = "buffered" | ||
WriteMode = "default" | ||
BufferSizeMB = 1 | ||
RotationMode = "segemnt-size" |
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.
nit: segment
config/config.go
Outdated
WalMode string `config:"mode" default:"buffered" validate:"oneof=buffered unbuffered"` | ||
WriteMode string `config:"write_mode" default:"default" validate:"oneof=default fsync"` | ||
BufferSizeMB int `config:"buffer_size" default:"1" validate:"min=1"` | ||
RotationMode string `config:"rotation_mode" default:"segemnt-size" validate:"oneof=segment-size time"` |
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.
nit: segment
err := wal.rotateLog() | ||
wal.lock.Unlock() | ||
if err != nil { | ||
log.Printf("Error while performing sync: %v", err) |
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.
Shall we keep error statements different from L289?
@JyotinderSingh @lucifercr07 I have included most of the suggested changes now. I have tried to keep the implementation as close to the design doc as possible. Please let me know if there are other things you would like me to change. Thanks! |
feec987
to
42a459c
Compare
42a459c
to
0d30b68
Compare
Hi @JyotinderSingh @arpitbbhayani can you please reveiw the PR, Thanks! |
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.
Thanks for working on this large contribution and addressing all the reviews @ayushsatyam146! This PR lays a strong foundation for the WAL implementation.
LGTM.
Fixes #1285
It is a new WAL implementation based on the decided configurable values. This doesn't contain support for checkpointing and recovery yet. Appropriate TODO markers are there for checkpointing and recovery.
Previous iteration of basic Benchmark
New interaction of basic benchmark