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:
parent
fd1735f6ec
commit
d04cdfa0dc
10 changed files with 582 additions and 127 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue