1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

celldb: version 2

- thread safe cache
- parallel commit
- multiple optimizations
- support of key-value merge operations
- improved tests and benchmarks
- in-memory version won't read from key value after start - uses vector in-memory table now
- use rocksdb::WALRecoveryMode::kTolerateCorruptedTailRecords - do not silently ignore errors during recovery
This commit is contained in:
birydrad 2024-12-11 14:48:48 +03:00
parent 1b70e48327
commit c863c42ed1
32 changed files with 3276 additions and 318 deletions

View file

@ -1414,6 +1414,9 @@ td::Status ValidatorEngine::load_global_config() {
if (zero_state.root_hash.is_zero() || zero_state.file_hash.is_zero()) {
return td::Status::Error(ton::ErrorCode::error, "[validator] section contains incomplete [zero_state]");
}
if (celldb_in_memory_ && celldb_v2_) {
return td::Status::Error(ton::ErrorCode::error, "at most one of --celldb-in-memory --celldb-v2 could be used");
}
ton::BlockIdExt init_block;
if (!conf.validator_->init_block_) {
@ -1461,11 +1464,12 @@ td::Status ValidatorEngine::load_global_config() {
if (!session_logs_file_.empty()) {
validator_options_.write().set_session_logs_file(session_logs_file_);
}
if (celldb_in_memory_) {
if (celldb_in_memory_ || celldb_v2_) {
celldb_compress_depth_ = 0;
}
validator_options_.write().set_celldb_compress_depth(celldb_compress_depth_);
validator_options_.write().set_celldb_in_memory(celldb_in_memory_);
validator_options_.write().set_celldb_v2(celldb_v2_);
validator_options_.write().set_max_open_archive_files(max_open_archive_files_);
validator_options_.write().set_archive_preload_period(archive_preload_period_);
validator_options_.write().set_disable_rocksdb_stats(disable_rocksdb_stats_);
@ -4526,6 +4530,12 @@ int main(int argc, char *argv[]) {
[&]() {
acts.push_back([&x]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_in_memory, true); });
});
p.add_option(
'\0', "celldb-v2",
"use new version off celldb",
[&]() {
acts.push_back([&x]() { td::actor::send_closure(x, &ValidatorEngine::set_celldb_v2, true); });
});
p.add_checked_option(
'\0', "catchain-max-block-delay", "delay before creating a new catchain block, in seconds (default: 0.4)",
[&](td::Slice s) -> td::Status {