What version of Go are you using (go version
)?
$ go version go version go1.13.8 linux/amd64
What operating system are you using?
Ubuntu 20.04
What version of Badger are you using?
1.6.2, 3.2103.1
Does this issue reproduce with the latest master?
Yes
Steps to Reproduce the issue
Create backup of 1.6.2 data, restore it with 2+ version and see no data.
badger backup --dir /opt/data/jaeger_old/key --vlog-dir /opt/data/jaeger_old/data -f /opt/data/jaeger.backup
Listening for /debug HTTP requests at port: 8080
badger 2021/07/08 15:29:15 INFO: All 2 tables opened in 303ms
badger 2021/07/08 15:29:15 INFO: Replaying file id: 1 at offset: 508814882
badger 2021/07/08 15:29:15 INFO: Replay took: 2.212µs
badger 2021/07/08 15:29:15 DEBUG: Value log discard stats empty
badger 2021/07/08 15:29:15 INFO: DB.Backup Created batch of size: 4.2 MB in 5.712887ms.
badger 2021/07/08 15:29:15 INFO: DB.Backup Created batch of size: 4.2 MB in 37.694555ms.
badger 2021/07/08 15:29:15 INFO: DB.Backup Created batch of size: 11 MB in 37.014391ms.
badger 2021/07/08 15:29:15 INFO: DB.Backup Created batch of size: 13 MB in 32.926577ms.
badger 2021/07/08 15:29:15 INFO: DB.Backup Created batch of size: 13 MB in 52.783874ms.
badger 2021/07/08 15:29:15 INFO: DB.Backup Created batch of size: 17 MB in 54.551703ms.
badger 2021/07/08 15:29:15 INFO: DB.Backup Created batch of size: 4.2 MB in 7.821245ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 50.010087ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 9.106355ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.2 MB in 3.750503ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.2 MB in 9.951384ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.2 MB in 4.699206ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 14.48822ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 11.939633ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 13.730232ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 9.731127ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 7.586495ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 14.399199ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 10.096274ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 8.979687ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 12.062043ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 12.763218ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 11.970219ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 55.885914ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Time elapsed: 01s, bytes sent: 138 MB, speed: 138 MB/sec
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 8.5 MB in 11.188534ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 14.093795ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 4.3 MB in 10.667519ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Created batch of size: 2.8 MB in 4.919835ms.
badger 2021/07/08 15:29:16 INFO: DB.Backup Sent 1052133 keys
badger 2021/07/08 15:29:17 INFO: Got compaction priority: {level:0 score:1.73 dropPrefixes:[]}
Restore log:
badger-3 restore --dir /opt/data/jaeger_new/key --vlog-dir /opt/data/jaeger_new/data -f /opt/data/jaeger.backup
Listening for /debug HTTP requests at port: 8080
jemalloc enabled: false
Using Go memory
badger 2021/07/08 15:34:31 INFO: All 0 tables opened in 0s
badger 2021/07/08 15:34:31 INFO: Discard stats nextEmptySlot: 0
badger 2021/07/08 15:34:31 INFO: Set nextTxnTs to 0
badger 2021/07/08 15:34:33 INFO: Lifetime L0 stalled for: 0s
badger 2021/07/08 15:34:33 INFO:
Level 0 [ ]: NumTables: 03. Size: 71 MiB of 0 B. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 64 MiB
Level 1 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 2 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 3 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 4 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 5 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 6 [B]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level Done
Num Allocated Bytes at program end: 0 B
See no data after restore:
ls -lah /opt/data/jaeger_new/data/
total 16K
drwxr-sr-x 2 root gitlab-runner 4.0K Jul 8 15:34 .
drwxr-sr-x 4 root gitlab-runner 4.0K Jul 8 15:34 ..
-rw-r--r-- 1 root gitlab-runner 20 Jul 8 15:34 000001.vlog
-rw-r--r-- 1 root gitlab-runner 1.0M Jul 8 15:34 DISCARD
ls -lah /opt/data/jaeger_old/data/
total 486M
drwx------ 2 root root 4.0K Jul 8 15:37 .
drwxr-xr-x 4 root root 4.0K Jul 8 15:28 ..
-rw------- 1 root root 486M Jul 8 15:29 000001.vlog