-
Notifications
You must be signed in to change notification settings - Fork 15
REP-6586 Store rechecks locally rather than in metaDB #136
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
REP-6586 Store rechecks locally rather than in metaDB #136
Conversation
|
||
const ( | ||
schemaVersionKey = "formatVersion" | ||
schemaVersion = uint16(3) |
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.
what is schema version?
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.
Similar to the comparable metaDB mechanism. How we prevent inadvertent breakage from using an outdated localDB across verifier updates.
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.
It sounds like each time we change the schema we should update the schema version. Is it documented or tested anywhere?
if errors.Is(err, badger.ErrKeyNotFound) { | ||
return nil | ||
} | ||
|
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.
Why are we not handling other errors?
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.
key-not-found is expected when the DB is new. There should be no other errors.
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.
Could we add an assertion that no other error should occur?
Co-authored-by: Jian Guan <[email protected]>
…igration-verifier into REP-6586-local-rechecks-badger
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.
LGTM
internal/verifier/localdb/recheck.go
Outdated
return errors.Wrapf( | ||
ldb.db.Update(func(tx *badger.Txn) error { | ||
var addedRechecks uint64 | ||
for _, chunk := range lo.Chunk(rechecks, 16384) { |
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.
chunk size could be a const.
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.
LGTM
This doesn’t actually work very well. It’s more performant to spin up a local MongoDB replset. |
This makes Migration Verifier enqueue rechecks to a local BadgerDB datastore rather than the metadata DB. This avoids problems with latency and allows the metadata to reside on the destination cluster without materially impeding handling of change events. The local DB is removed whenever the
--clean
flag is given.Since it is now sensible to store metadata on the destination cluster, this changeset also makes the
--metaURI
parameter default to the--dstURI
parameter’s value.It may be sensible in the future to migrate all of metadata to BadgerDB.