nosql icon indicating copy to clipboard operation
nosql copied to clipboard

Use the version of Badger that matches existing DB files

Open dopey opened this issue 5 years ago • 2 comments

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:

  1. Default to the correct version based on existing DB files
  2. If no files exist (new db) then default to the most recent version.

dopey avatar Dec 01 '20 20:12 dopey

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............|

dopey avatar Dec 01 '20 20:12 dopey

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.

maraino avatar Dec 03 '20 20:12 maraino