exonum / exonum

An extensible open-source framework for creating private/permissioned blockchain applications

Home Page:https://exonum.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exonum fails to start when using existing database

orthecreedence opened this issue · comments

Hello. On exonum 0.12, when I remove the database files and start the server, it runs fine. I can run my integration tests serveral times without issue. However, if I stop the server and start it again (without removing the existing database files), I get the message:

Assertion failed!

Program: C:\htdocs\basis\basis\target\debug\basis.exe
File: C:/src/rocksdb-5.17.2/db/builder.cc, Line 83

Expression: (column_family_id == TablePropertiesCollectorFactory::Context::kUnknownColumnFamily) == column_family_name.empty()

This is using a pre-compiled version of RocksDB v5.17.2 (not the one bundled with liborcksdb-sys). I did try compiling librocksdb-sys with the bundled version, but had trouble:

running: "g++.exe" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-m64"
"-IC:/lib/include" "-I/usr/include" "-L/c/lib/lib" "-L/c/lib/bin" "-L/usr/lib" "-I" "rocksdb/include/"
"-I" "rocksdb/" "-I" "rocksdb/third-party/gtest-1.7.0/fused-src/" "-I" "." "-msse2" "-msse4.1" "-msse4.
2" "-mpclmul" "-std=c++11" "-Wno-unused-parameter" "-DNDEBUG=1" "-DHAVE_PCLMUL=1" "-DHAVE_SSE42=1" "-DO
S_WIN=1" "-DROCKSDB_WINDOWS_UTF8_FILENAMES=1" "-o" "C:\\htdocs\\tmp\\rust-rocksdb\\librocksdb-sys\\targ
et\\debug\\build\\librocksdb-sys-2f49d2044fb40099\\out\\rocksdb/port/win\\io_win.o" "-c" "rocksdb/port/
win/io_win.cc"
cargo:warning=rocksdb/port/win/env_win.cc: In member function 'virtual rocksdb::Status rocksdb::port::W
inEnvIO::AreFilesSame(const string&, const string&, bool*)':
cargo:warning=rocksdb/port/win/env_win.cc:792:3: error: 'FILE_ID_INFO' was not declared in this scope
cargo:warning=   FILE_ID_INFO FileInfo_1;
cargo:warning=   ^~~~~~~~~~~~
cargo:warning=rocksdb/port/win/env_win.cc:792:3: note: suggested alternative: 'SIID_INFO'
cargo:warning=   FILE_ID_INFO FileInfo_1;
cargo:warning=   ^~~~~~~~~~~~
cargo:warning=   SIID_INFO
cargo:warning=rocksdb/port/win/env_win.cc:793:54: error: 'FileIdInfo' was not declared in this scope
cargo:warning=   BOOL result = GetFileInformationByHandleEx(file_1, FileIdInfo, &FileInfo_1,
cargo:warning=                                                      ^~~~~~~~~~
cargo:warning=rocksdb/port/win/env_win.cc:793:54: note: suggested alternative: 'FileIdType'
cargo:warning=   BOOL result = GetFileInformationByHandleEx(file_1, FileIdInfo, &FileInfo_1,
cargo:warning=                                                      ^~~~~~~~~~
cargo:warning=                                                      FileIdType
cargo:warning=rocksdb/port/win/env_win.cc:793:67: error: 'FileInfo_1' was not declared in this scope
cargo:warning=   BOOL result = GetFileInformationByHandleEx(file_1, FileIdInfo, &FileInfo_1,
cargo:warning=                                                                   ^~~~~~~~~~
cargo:warning=rocksdb/port/win/env_win.cc:793:67: note: suggested alternative: 'FileLock'
cargo:warning=   BOOL result = GetFileInformationByHandleEx(file_1, FileIdInfo, &FileInfo_1,
cargo:warning=                                                                   ^~~~~~~~~~
cargo:warning=                                                                   FileLock
cargo:warning=rocksdb/port/win/env_win.cc:803:16: error: expected ';' before 'FileInfo_2'
cargo:warning=    FILE_ID_INFO FileInfo_2;
cargo:warning=                ^~~~~~~~~~~
cargo:warning=                ;
cargo:warning=rocksdb/port/win/env_win.cc:804:63: error: 'FileInfo_2' was not declared in this scope
cargo:warning=    result = GetFileInformationByHandleEx(file_2, FileIdInfo, &FileInfo_2,
cargo:warning=                                                               ^~~~~~~~~~
cargo:warning=rocksdb/port/win/env_win.cc:804:63: note: suggested alternative: 'FileLock'
cargo:warning=    result = GetFileInformationByHandleEx(file_2, FileIdInfo, &FileInfo_2,
cargo:warning=                                                               ^~~~~~~~~~
cargo:warning=                                                               FileLock
exit code: 1

I guess my question is: do you know if this an issue with rocksdb, rust-rocksdb, or exonum v0.12? The error is pretty foreign to me to I'm having trouble figuring out what I should try next.

Thank you!

@orthecreedence, as for rust-rocksdb: do you use latest c++ build tools and LLVM?

I forgot to mention, I am using stable-x86_64-pc-windows-gnu on msys, so it should be using mingw.

OK, it looks like msys/rocksdb do not mix. I'm going to compile the latest version via Visual Studio and have librocksdb-sys link to it and see if that gets me further.

I tried a number of different versions (6.2.2, 5.18.3). None of them work. The last one I tried was rocksdb v5.18.3 (the version librocksdb-sys bundles). It was giving me (exit code: 0xc0000374, STATUS_HEAP_CORRUPTION) when trying to open the actual DB folder. For now I'm giving up and going back to the dll of the old version (5.17.2) and just going to wipe the database each time I need to restart. I guess it will enforce good testing practices anyway.

It would be nice to try to narrow this down though.

@orthecreedence, try to use msvc rust.