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

Fix data race in WAL #9587

Merged
merged 1 commit into from
Mar 15, 2018
Merged

Fix data race in WAL #9587

merged 1 commit into from
Mar 15, 2018

Conversation

e-dard
Copy link
Contributor

@e-dard e-dard commented Mar 15, 2018

Backport of #9580

This commit fixes a data race in the WAL, which can occur when writes
and deletes are being executed concurrently. The WAL uses a buffer pool
of `[]byte` when reading the WAL. WAL entries are unmarshaled into these
buffers and passed along to the relevant methods handling the different
types of entry (write, delete etc).

In the case of deletes, the keys that need to be deleted were being
stored for later processing, however these keys were part of the backing
array of initial buffer from the pool. As such, those keys could be
written to at a future time when handling other parts of the WAL.
@ghost ghost assigned e-dard Mar 15, 2018
@ghost ghost added the review label Mar 15, 2018
@e-dard e-dard added this to the 1.5.1 milestone Mar 15, 2018
Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥃

@e-dard e-dard merged commit 15ba2df into 1.5 Mar 15, 2018
@ghost ghost removed the review label Mar 15, 2018
@e-dard e-dard deleted the BP1.5-er-wal-race branch April 20, 2018 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants