Skip to content

Commit

Permalink
ttl compact
Browse files Browse the repository at this point in the history
  • Loading branch information
VCgege committed Dec 12, 2024
1 parent bac92b8 commit 30b056b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -3085,7 +3085,7 @@ standardConfig configs[] = {
createULongLongConfig("rocksdb.data.blob_file_size", "rocksdb.blob_file_size", MODIFIABLE_CONFIG, 0, ULLONG_MAX, server.rocksdb_data_blob_file_size, 256*1024*1024, MEMORY_CONFIG, NULL, updateRocksdbDataBlobFileSize),
createULongLongConfig("rocksdb.meta.blob_file_size", NULL, MODIFIABLE_CONFIG, 0, ULLONG_MAX, server.rocksdb_meta_blob_file_size, 256*1024*1024, MEMORY_CONFIG, NULL, updateRocksdbMetaBlobFileSize),
createULongLongConfig("swap-repl-rordb-max-write-bps", NULL, MODIFIABLE_CONFIG, 0, LLONG_MAX, server.swap_repl_rordb_max_write_bps, 200*1024*1024, MEMORY_CONFIG, NULL, NULL),
createULongLongConfig("swap-ttl-compact-period", NULL, MODIFIABLE_CONFIG, 1, 3600*24, server.swap_ttl_compact_period, 60*8, INTEGER_CONFIG, NULL, NULL),
createULongLongConfig("swap-ttl-compact-period", NULL, MODIFIABLE_CONFIG, 1, 3600*24, server.swap_ttl_compact_period, 60, INTEGER_CONFIG, NULL, NULL),
createULongLongConfig("swap-sst-age-limit-refresh-period", NULL, MODIFIABLE_CONFIG, 1, 3600*24, server.swap_sst_age_limit_refresh_period, 60, INTEGER_CONFIG, NULL, NULL),
createULongLongConfig("swap-swap-info-slave-period", NULL, MODIFIABLE_CONFIG, 1, 3600*24, server.swap_swap_info_slave_period, 60, INTEGER_CONFIG, NULL, NULL),

Expand Down
4 changes: 2 additions & 2 deletions src/ctrip_swap_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ void swapRequestExecuteUtil_CompactRange(swapRequest *req) {
long size_after = get_dir_size(dir);
serverLog(LL_WARNING, "[rocksdb compact range after] dir(%s) size(%ld)", dir, size_after);

if (server.swap_ttl_compact_ctx && task->compact_type == TYPE_TTL_COMPACT) {
atomicIncr(server.swap_ttl_compact_ctx->stat_compacted_data_size, size_after - size_before);
if (server.swap_ttl_compact_ctx && task->compact_type == TYPE_TTL_COMPACT && size_before > size_after) {
atomicIncr(server.swap_ttl_compact_ctx->stat_compacted_data_size, size_before - size_after);
}
serverRocksUnlock(rocks);
}
Expand Down

0 comments on commit 30b056b

Please sign in to comment.