forked from dgraph-io/badger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix discard stats moved by GC bug (dgraph-io#929)
* Fix discard stats moved by GC bug 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.
- Loading branch information
1 parent
2fa005c
commit 164ded5
Showing
2 changed files
with
135 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters