8000 Improve startup error logging (#15846) · arangodb/arangodb@5a1026a · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a1026a

Browse files
jsteemannKVS85
andauthored
Improve startup error logging (#15846)
* Improve startup error logging * Log a better startup error in case an ArangoDB 3.7 is started on a too new database directory (3.9 or higher). * update CHANGELOG * Update CHANGELOG Co-authored-by: Vadim <vadim@arangodb.com>
1 parent 6788542 commit 5a1026a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
v3.8.6 (2022-02-16)
22
-------------------
33

4+
* Log a better startup error in case an ArangoDB 3.8 is started on a too new
5+
database directory (3.9 or higher).
6+
47
* Harden validator for binary VelocyPack against additional types of malicious
58
inputs.
69

arangod/RocksDBEngine/RocksDBEngine.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "Basics/WriteLocker.h"
3737
#include "Basics/application-exit.h"
3838
#include "Basics/build.h"
39+
#include "Basics/exitcodes.h"
3940
#include "Basics/files.h"
4041
#include "Basics/system-functions.h"
4142
#include "Cache/CacheManagerFeature.h"
@@ -871,6 +872,26 @@ void RocksDBEngine::start() {
871872
"re-import data";
872873
FATAL_ERROR_EXIT();
873874
}
875+
876+
// check if we have too many column families, namely some known ones
877+
// from future versions of ArangoDB
878+
if (existingColumnFamilies.size() > numberOfColumnFamilies) {
879+
for (auto const& it : existingColumnFamilies) {
880+
if (it == "ZkdIndex" || it == "ReplicatedLogs") {
881+
// introduced in 3.9 or 3.10
882+
LOG_TOPIC("1bdd3", ERR, Logger::STARTUP)
883+
<< "Unknown column family found in RocksDB database: " << it;
884+
}
885+
}
886+
887+
LOG_TOPIC("c91a4", ERR, Logger::STARTUP)
888+
<< "Database version check failed: "
889+
<< "the database directory seems to be from a future ArangoDB version. "
890+
<< "This is unsupported!";
891+
// let's continue, because maybe the database starts anyway for some
892+
// magic reasons...
893+
// FATAL_ERROR_EXIT_CODE(TRI_EXIT_VERSION_CHECK_FAILED);
894+
}
874895
}
875896
}
876897

0 commit comments

Comments
 (0)
0