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

Use parallel write to celldb (#1264)

* Parallel write in celldb

* Add TD_PERF_COUNTER to gc_cell and store_cell

* More error handling

* Tests for prepare_commit_async

* Install g++11 for ubuntu 20.04

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2024-10-11 15:31:59 +03:00 committed by GitHub
parent fd1735f6ec
commit d04cdfa0dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 582 additions and 127 deletions

View file

@ -30,6 +30,7 @@
#include "td/db/RocksDb.h"
#include <optional>
#include <queue>
namespace rocksdb {
class Statistics;
@ -136,6 +137,8 @@ class CellDbIn : public CellDbBase {
struct CellDbStatistics {
PercentileStats store_cell_time_;
PercentileStats store_cell_prepare_time_;
PercentileStats store_cell_write_time_;
PercentileStats gc_cell_time_;
td::Timestamp stats_start_time_ = td::Timestamp::now();
std::optional<double> in_memory_load_time_;
@ -153,6 +156,18 @@ class CellDbIn : public CellDbBase {
td::Timestamp statistics_flush_at_ = td::Timestamp::never();
BlockSeqno last_deleted_mc_state_ = 0;
bool db_busy_ = false;
std::queue<td::Promise<td::Unit>> action_queue_;
void release_db() {
db_busy_ = false;
while (!db_busy_ && !action_queue_.empty()) {
auto action = std::move(action_queue_.front());
action_queue_.pop();
action.set_value(td::Unit());
}
}
public:
class MigrationProxy : public td::actor::Actor {
public: