diff --git a/src/Storages/MergeTree/MergeTask.cpp b/src/Storages/MergeTree/MergeTask.cpp index c32c4e32cd7..89fb27cc89c 100644 --- a/src/Storages/MergeTree/MergeTask.cpp +++ b/src/Storages/MergeTree/MergeTask.cpp @@ -241,9 +241,6 @@ bool MergeTask::ExecuteAndFinalizeHorizontalPart::prepare() global_ctx->merging_column_names, global_ctx->gathering_column_names); - if (global_ctx->data->getSettings()->fsync_part_directory) - global_ctx->sync_guard = ctx->disk->getDirectorySyncGuard(local_new_part_tmp_path); - break; } default : diff --git a/src/Storages/MergeTree/MergeTask.h b/src/Storages/MergeTree/MergeTask.h index aa64c4c2265..d3fc01980ea 100644 --- a/src/Storages/MergeTree/MergeTask.h +++ b/src/Storages/MergeTree/MergeTask.h @@ -155,7 +155,6 @@ private: QueryPipeline merged_pipeline; std::unique_ptr merging_executor; - SyncGuardPtr sync_guard{nullptr}; MergeTreeData::MutableDataPartPtr new_data_part{nullptr}; size_t rows_written{0}; diff --git a/src/Storages/MergeTree/MutateTask.cpp b/src/Storages/MergeTree/MutateTask.cpp index 4adb1e9563a..c001b319c99 100644 --- a/src/Storages/MergeTree/MutateTask.cpp +++ b/src/Storages/MergeTree/MutateTask.cpp @@ -520,7 +520,6 @@ struct MutationContext DiskPtr disk; String new_part_tmp_path; - SyncGuardPtr sync_guard; IMergedBlockOutputStreamPtr out{nullptr}; String mrk_extension; @@ -1305,9 +1304,6 @@ bool MutateTask::prepare() ctx->disk = ctx->new_data_part->volume->getDisk(); ctx->new_part_tmp_path = ctx->new_data_part->getFullRelativePath(); - if (ctx->data->getSettings()->fsync_part_directory) - ctx->sync_guard = ctx->disk->getDirectorySyncGuard(ctx->new_part_tmp_path); - /// Don't change granularity type while mutating subset of columns ctx->mrk_extension = ctx->source_part->index_granularity_info.is_adaptive ? getAdaptiveMrkExtension(ctx->new_data_part->getType()) : getNonAdaptiveMrkExtension(); diff --git a/tests/queries/0_stateless/01643_merge_tree_fsync_smoke.reference b/tests/queries/0_stateless/01643_merge_tree_fsync_smoke.reference index f57d5df6efd..613c455fc59 100644 --- a/tests/queries/0_stateless/01643_merge_tree_fsync_smoke.reference +++ b/tests/queries/0_stateless/01643_merge_tree_fsync_smoke.reference @@ -12,3 +12,4 @@ memory in_memory_parts_insert_sync 1 wide fsync_part_directory,vertical 1 +2 diff --git a/tests/queries/0_stateless/01643_merge_tree_fsync_smoke.sql b/tests/queries/0_stateless/01643_merge_tree_fsync_smoke.sql index 644cf063a33..598e1ef3c34 100644 --- a/tests/queries/0_stateless/01643_merge_tree_fsync_smoke.sql +++ b/tests/queries/0_stateless/01643_merge_tree_fsync_smoke.sql @@ -43,8 +43,10 @@ optimize table data_01643 final; drop table data_01643; select 'wide fsync_part_directory,vertical'; -create table data_01643 (key Int) engine=MergeTree() order by key settings min_bytes_for_wide_part=0, fsync_part_directory=1, enable_vertical_merge_algorithm=1, vertical_merge_algorithm_min_rows_to_activate=1, vertical_merge_algorithm_min_columns_to_activate=1; +create table data_01643 (key Int) engine=MergeTree() order by key settings min_bytes_for_wide_part=0, fsync_part_directory=1, enable_vertical_merge_algorithm=1, vertical_merge_algorithm_min_rows_to_activate=0, vertical_merge_algorithm_min_columns_to_activate=0; insert into data_01643 values (1); -select * from data_01643; -optimize table data_01643 final; +insert into data_01643 values (2); +select * from data_01643 order by key; +-- vertical merge does not supports deduplicate, hence no FINAL +optimize table data_01643; drop table data_01643;