Rewritten snapshot for token database
Closed this issue · 1 comments
harrywong commented
Current implementation is to hack the backup process of token database, but it will cause some bugs and not independent of RocksDB. Consider re-implement it via scan all keys and backup in binary format.
harrywong commented
Below is the crash log when creating snapshot.
Operating system: Linux
0.0.0 Linux 4.9.0-7-amd64 #1 SMP Debian 4.9.110-3+deb9u2 (2018-08-13) x86_64
CPU: amd64
family 6 model 85 stepping 4
1 CPU
GPU: UNKNOWN
Crash reason: SIGSEGV /SEGV_MAPERR
Crash address: 0x31
Process uptime: not available
Thread 0 (crashed)
0 evtd!rocksdb::BackupEngineImpl::BackupMeta::StoreToFile(bool) [backupable_db.cc : 1822 + 0x13]
rax = 0x0000000000000001 rdx = 0x00000000011f8971
rcx = 0x0000000000000000 rbx = 0x00007f72ae8ce010
rsi = 0x0000000000000013 rdi = 0x00007fff9c17d210
rbp = 0x00007fff9c17d2e0 rsp = 0x00007fff9c17d120
r8 = 0x00007fff9c17d210 r9 = 0x00007f72aef53e80
r10 = 0x0000000000000000 r11 = 0x00007f72aef53f00
r12 = 0x00007f7250c00ec0 r13 = 0x0000000000000012
r14 = 0x00007f72ae827380 r15 = 0x0000000000a836c6
rip = 0x0000000000db0add
Found by: given as instruction pointer in context
1 evtd!rocksdb::BackupEngineImpl::CreateNewBackupWithMetadata(rocksdb::DB*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::function<void ()>) [backupable_db.cc : 900 + 0x1b]
rbx = 0x00057eb161f5563f rbp = 0x00007fff9c17d7b0
rsp = 0x00007fff9c17d2f0 r12 = 0x00007fff9c17d400
r13 = 0x00000000aa987245 r14 = 0x00007fff9c17d580
r15 = 0x00007f72ae84e680 rip = 0x0000000000dba4a2
Found by: call frame info
2 evtd!evt::chain::token_database_snapshot::add_to_snapshot(std::shared_ptr<evt::chain::snapshot_writer>, evt::chain::token_database const&) [backupable_db.h : 277 + 0x25]
rbx = 0x00007fff9c17dd90 rbp = 0x00007f72ae8f71c0
rsp = 0x00007fff9c17d7c0 r12 = 0x00007fff9c17d9a0
r13 = 0x00007f72ae84e680 r14 = 0x00007fff9c17e070
r15 = 0x00007fff9c17db30 rip = 0x000000000099ed77
Found by: call frame info