Patch in https://github.com/dgraph-io/badger/pull/1313 to fix GC after restore. #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a patch of dgraph-io#1313; While the original patch indicates that the fix should only be applicable when
oldOptions.ValueThreshold < newOptions.ValueThreshold
, we seem to hit this case in other situations as well, this patch fixes GC on our restored DBs (I've also verified the # of doc-ids per-corpus after restore).I've been unable to reproduce this case in our unit-tests (i.e keeping
ValueThreshold
the same between backup/restore) - my suspicions are on some interaction between GC and the restore, but this has been hard to replicate/reproduce.The other option is to just upgrade to mainline v2.2007 - it looks like it contains a bunch of other fixes that we probably want as well (and which might also be playing a part in causing these inconsistent value-pointer bits):
badgerMove
entry required before rewrite dgraph-io/badger#1302It is a bit more risky to upgrade (ex: we may see a recurrence of the GC issues; mainline v2.2007 is still using an older version of Ristretto, whereas our fork seems to have been upgraded), especially given that this will be the first time we will be exercising the restore path for prod-instances, but we could save time and just do the upgrade now, rather than having to revisit later.