-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 discard stats moved by GC bug (#929) #1098
Conversation
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.
✅ A review job has been created and sent to the PullRequest network.
@jarifibrahim you can click here to see the review status or cancel the code review job.
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.
Reviewed 2 of 2 files at r1.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ashish-goswami and @manishrjain)
Adding #929 to release/1.6 branch. |
The discard stats are stored like normal keys in badger, which means if the size of the value of discard stats key is greater the value threshold it will be stored in the value log. When value log GC happens, we insert the same key in badger with a !badger!move prefix which points to the new value log file. So when searching for the value of a key, if the value points to a value log file which doesn't exist, we search for the same key with !badger!move prefix. The above logic was missing from the populateDiscardStats function. The earlier implementation would never search for the key with !badger!move prefix. It would return error on the first attempt to find the key. This commit ensures we search for a key with prefix badger move if the value for the existing key pointed to a value log file that no longer exists.
c9212f1
to
596d5ef
Compare
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.
⚠️ Warning
PullRequest detected a force-push on this branch. This may have caused some information to be lost, and additional time may be required to complete review of the code. Read More
This branch does not contain the fixes for windows build and that's why it's failing. |
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.
Windows fixes can go in a separate PR. This looks good to merge on my side to fix the issue on Linux environments.
Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @ashish-goswami, @danielmai, and @manishrjain)
This vendors in Badger v1.6.0 with hypermodeinc/badger#929 cherry-picked into it (hypermodeinc/badger#1098) to avoid any breaking changes to the data format.
This vendors in Badger v1.6.0 with hypermodeinc/badger#929 cherry-picked into it (hypermodeinc/badger#1098) to avoid any breaking changes to the data format. Vendor in Badger to fix a bug that prevents Alpha from starting up successfully. This happens in v1.0.16 and v1.0.17. Error while creating badger KV posting store error: Unable to find log file. Please retry The release/v1.0 branch uses the vendor directory for dependencies. Badger was pulled in with the following command: govendor fetch github.com/dgraph-io/badger/...@efb9d9d15d7f7baa656e04933058f006c33a8d0f
This vendors in Badger v1.6.0 with hypermodeinc/badger#929 cherry-picked into it (hypermodeinc/badger#1098) to avoid any breaking changes to the data format. Vendor in Badger to fix a bug that prevents Alpha from starting up successfully. This happens in v1.0.16 and v1.0.17. Error while creating badger KV posting store error: Unable to find log file. Please retry The release/v1.0 branch uses the vendor directory for dependencies. Badger was pulled in with the following command: govendor fetch github.com/dgraph-io/badger/...@efb9d9d15d7f7baa656e04933058f006c33a8d0f
The discard stats are stored like normal keys in badger, which means if
the size of the value of discard stats key is greater the value threshold it
will be stored in the value log. When value log GC happens, we insert
the same key in badger with a !badger!move prefix which points to the
new value log file. So when searching for the value of a key, if the value
points to a value log file which doesn't exist, we search for the same
key with !badger!move prefix.
The above logic was missing from the populateDiscardStats function. The
earlier implementation would never search for the key with !badger!move
prefix. It would return error on the first attempt to find the key. This
commit ensures we search for a key with prefix badger move if the value
for the existing key pointed to a value log file that no longer exists.
Original PR #929
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)