Skip to content

Commit 8e77996

Browse files
authored
Merge pull request #4952 from driftluo/change-secondary-db-options
chore: change secondary db options
2 parents 7a3d92e + b21cc92 commit 8e77996

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

util/app-config/src/configs/indexer.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ pub struct IndexerSyncConfig {
113113
pub poll_interval: u64,
114114
/// Whether to index the pending txs in the ckb tx-pool
115115
pub index_tx_pool: bool,
116-
/// Maximal db info log files to be kept.
117-
#[serde(default)]
118-
pub db_keep_log_file_num: Option<NonZeroUsize>,
119116
}
120117

121118
impl From<&IndexerConfig> for IndexerSyncConfig {
@@ -124,7 +121,6 @@ impl From<&IndexerConfig> for IndexerSyncConfig {
124121
secondary_path: config.secondary_path.clone(),
125122
poll_interval: config.poll_interval,
126123
index_tx_pool: config.index_tx_pool,
127-
db_keep_log_file_num: config.db_keep_log_file_num,
128124
}
129125
}
130126
}

util/indexer-sync/src/lib.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ use ckb_types::{
2828
core::{self, BlockNumber, BlockView},
2929
packed::Byte32,
3030
};
31-
use rocksdb::prelude::*;
31+
use rocksdb::{LogLevel, prelude::*};
3232

3333
use std::marker::Send;
34-
use std::num::NonZeroUsize;
3534
use std::sync::{Arc, RwLock};
3635
use std::thread::sleep;
3736
use std::time::Duration;
3837

39-
const DEFAULT_LOG_KEEP_NUM: usize = 1;
4038
const INDEXER_NODE_TIP_GAP: u64 = 10;
4139

4240
/// Trait for an indexer's synchronization interface
@@ -64,7 +62,7 @@ pub fn new_secondary_db(ckb_db_config: &DBConfig, config: &IndexerSyncConfig) ->
6462
COLUMN_BLOCK_PROPOSAL_IDS,
6563
COLUMN_BLOCK_EXTENSION,
6664
];
67-
let secondary_opts = indexer_secondary_options(config);
65+
let secondary_opts = indexer_secondary_options();
6866
SecondaryDB::open_cf(
6967
&secondary_opts,
7068
&ckb_db_config.path,
@@ -301,15 +299,10 @@ impl IndexerSyncService {
301299
}
302300
}
303301

304-
fn indexer_secondary_options(config: &IndexerSyncConfig) -> Options {
302+
fn indexer_secondary_options() -> Options {
305303
let mut opts = Options::default();
306304
opts.create_if_missing(true);
307305
opts.create_missing_column_families(true);
308-
opts.set_keep_log_file_num(
309-
config
310-
.db_keep_log_file_num
311-
.map(NonZeroUsize::get)
312-
.unwrap_or(DEFAULT_LOG_KEEP_NUM),
313-
);
306+
opts.set_log_level(LogLevel::Warn);
314307
opts
315308
}

0 commit comments

Comments
 (0)