Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
Signed-off-by: hehechen <awd123456sss@gmail.com>
  • Loading branch information
hehechen committed May 24, 2022
1 parent 59b3958 commit 1fa80da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions dbms/src/Server/tests/gtest_server_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ dt_page_gc_low_write_prob = 0.2
std::unique_ptr<StoragePathPool> path_pool = std::make_unique<StoragePathPool>(global_ctx.getPathPool().withTable("test", "t1", false));
std::unique_ptr<DM::StoragePool> storage_pool = std::make_unique<DM::StoragePool>(global_ctx, /*ns_id*/ 100, *path_pool, "test.t1");

auto verify_storage_pool_reload_config = [&global_ctx](std::unique_ptr<DM::StoragePool> & storage_pool) {
auto verify_storage_pool_reload_config = [&](std::unique_ptr<DM::StoragePool> & storage_pool) {
DB::Settings & settings = global_ctx.getSettingsRef();

auto cfg = storage_pool->data_storage_v2->getSettings();
auto cfg = storage_pool->data_storage_v3->getSettings();
EXPECT_NE(cfg.gc_min_files, settings.dt_storage_pool_data_gc_min_file_num);
EXPECT_NE(cfg.gc_min_legacy_num, settings.dt_storage_pool_data_gc_min_legacy_num);
EXPECT_NE(cfg.gc_min_bytes, settings.dt_storage_pool_data_gc_min_bytes);
Expand All @@ -384,9 +384,9 @@ dt_page_gc_low_write_prob = 0.2
EXPECT_NE(cfg.open_file_max_idle_time, settings.dt_open_file_max_idle_seconds);
EXPECT_NE(cfg.prob_do_gc_when_write_is_low, settings.dt_page_gc_low_write_prob * 1000);

storage_pool->gc(settings, DM::StoragePool::Seconds(0));
global_ctx.getGlobalStoragePool()->gc();

cfg = storage_pool->data_storage_v2->getSettings();
cfg = storage_pool->data_storage_v3->getSettings();
EXPECT_EQ(cfg.gc_min_files, settings.dt_storage_pool_data_gc_min_file_num);
EXPECT_EQ(cfg.gc_min_legacy_num, settings.dt_storage_pool_data_gc_min_legacy_num);
EXPECT_EQ(cfg.gc_min_bytes, settings.dt_storage_pool_data_gc_min_bytes);
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Storages/DeltaMerge/StoragePool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void GlobalStoragePool::restore()

bool GlobalStoragePool::gc()
{
return gc(Settings(), true, DELTA_MERGE_GC_PERIOD);
return gc(global_context.getSettingsRef(), true, DELTA_MERGE_GC_PERIOD);
}

bool GlobalStoragePool::gc(const Settings & settings, bool immediately, const Seconds & try_gc_period)
Expand Down

0 comments on commit 1fa80da

Please sign in to comment.