-
Notifications
You must be signed in to change notification settings - Fork 66
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 for concurrency race #84
Conversation
|
If we start a new transaction, reads that started after the last committed write, but before the compaction wont be able to find those commited reads. Instead copy the watermark as the tx id to allow those reads to be able to read all the committed data.
f8be7a1
to
a3e6195
Compare
With the latest fix from @ostafen and this fix I'm no longer seeing any failures with the concurrency test. |
Not sure if I'm missing something but I tried running the test again with the race detector enabled and I still get races detected:
The logs can be found here: https://gist.github.com/MadhavJivrajani/fa69278be76cdf18143dcde533f0e193 Edit: This is probably unrelated to the bug being fixed by the PR tho |
This is a new one, but definitely unrelated to this fix. Can you open a second issue with this information? |
Created #86 |
@@ -490,8 +490,8 @@ func (t *TableBlock) splitGranule(granule *Granule) { | |||
return | |||
} | |||
|
|||
// Obtain a new tx for this compaction | |||
tx, watermark, commit := t.table.db.begin() | |||
// Use the latest watermark as the tx id |
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.
This is safe to do because we're not actually adding new data, we're just compacting it, right?
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.
Correct
If we start a new transaction, reads that started after the last
committed write, but before the compaction wont be able to find those commited
reads. Instead copy the watermark as the tx id to allow those reads to
be able to read all the committed data.
This is should be the fix for #71