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

New WAL implementation with configurable variables #1356

Merged
merged 7 commits into from
Dec 16, 2024

Conversation

ayushsatyam146
Copy link
Contributor

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
image
New interaction of basic benchmark
image

@ayushsatyam146
Copy link
Contributor Author

@JyotinderSingh JyotinderSingh self-requested a review December 5, 2024 17:43
@JyotinderSingh
Copy link
Collaborator

Adding a comment here for context. We have discussed changes in the community call, please re-request a review once they are done.

Copy link
Collaborator

@JyotinderSingh JyotinderSingh left a 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 Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
internal/wal/wal.proto Outdated Show resolved Hide resolved
internal/wal/wal.proto Outdated Show resolved Hide resolved
internal/wal/wal_aof.go Outdated Show resolved Hide resolved
internal/wal/wal_aof.go Outdated Show resolved Hide resolved
internal/wal/wal_aof.go Outdated Show resolved Hide resolved
internal/wal/wal_aof.go Outdated Show resolved Hide resolved
internal/wal/wal_aof.go Outdated Show resolved Hide resolved
config/config.go Outdated
network.io_buffer_length_max = 51200

# WAL Configuration
LogDir = "tmp/deicdeb-wal-lt"
Copy link
Contributor

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"
Copy link
Contributor

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 Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
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"`
Copy link
Contributor

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)
Copy link
Contributor

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?

internal/wal/wal_aof.go Outdated Show resolved Hide resolved
config/config.go Show resolved Hide resolved
internal/wal/wal_aof.go Outdated Show resolved Hide resolved
internal/wal/wal_aof.go Outdated Show resolved Hide resolved
@ayushsatyam146
Copy link
Contributor Author

@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.
However, I have left a few things because I feel like they are more related to design decisions rather than current code in the PR. In my opinion we should follow up on those things in the next iteration as this PR is getting lengthy and a bit unmanageable. We should eventually retire the abstract WAL and make AOF as the default WAL.

Please let me know if there are other things you would like me to change. Thanks!

@ayushsatyam146
Copy link
Contributor Author

Hi @JyotinderSingh @arpitbbhayani can you please reveiw the PR, Thanks!

Copy link
Collaborator

@JyotinderSingh JyotinderSingh left a 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.

@JyotinderSingh JyotinderSingh merged commit f25bfb8 into DiceDB:master Dec 16, 2024
2 checks passed
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.

Enhance AOF based WAL
3 participants