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

Rust project 4: multithreading bug during KVStore compaction #461

Open
RPallas92 opened this issue Oct 21, 2023 · 0 comments
Open

Rust project 4: multithreading bug during KVStore compaction #461

RPallas92 opened this issue Oct 21, 2023 · 0 comments
Labels
type/bug Something isn't working

Comments

@RPallas92
Copy link

Bug Report

During compaction, we copy all the data from the logs to be compacted to the new compacted log (code pointer).

After that, we update the lock-free index (code pointer). At this point, readers will start reading these values from the new compacted log as the lock-free index has been updated.

The issue is we are using a buffered writer, that we flush after all data has been copied (code pointer).

Issue

In between we update the index and we flush the buffered writer, all lock-free readers will try to get data from the compaction log, that is not flushed. Get operations will return key not found error.

Expected behaviour

Lock-free readers don´t return key not found if the key exists.

Shouldn´t we flush the buffered writer before updating the index?

@RPallas92 RPallas92 added the type/bug Something isn't working label Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant