Use the version of Badger that matches existing DB files
What would you like to be added
Default to the version of Badger required by existing DB files
Why this is needed
Rather than forcing the user to select a version of Badger:
- Default to the correct version based on existing DB files
- If no files exist (new db) then default to the most recent version.
V1: 00000000 42 64 67 72 00 00 00 04 00 00 00 00 00 00 00 00 |Bdgr............|
V2: 00000000 42 64 67 72 00 00 00 07 00 00 00 00 00 00 00 00 |Bdgr............|
At master they are now using version 8, see https://github.com/dgraph-io/badger/commit/e3a0d29f75d9978d8230956c39f0dbdde2f1cb63 but they haven't yet released a new version of badger with that change, but we should monitor this.
The migration strategy is described here https://github.com/dgraph-io/badger/blob/master/docs/content/faq/index.md#i-see-manifest-has-unsupported-version-x-we-support-y-error. And it should not be hard to create a tool or an automatic process in step-ca to do this, looking at the badger's backup and restore cli commands.