mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 07:01:59 +00:00
Rename fsync_tmp_directory to fsync_directories for Distributed engine
This commit is contained in:
parent
9cdb1d4ae6
commit
471deab63a
@ -29,7 +29,7 @@ Also it accept the following settings:
|
||||
|
||||
- `fsync_after_insert` - do the `fsync` for the file data after asynchronous insert to Distributed. Guarantees that the OS flushed the whole inserted data to a file **on the initiator node** disk.
|
||||
|
||||
- `fsync_tmp_directory` - do the `fsync` for directories. Guarantees that the OS refreshed directory metadata after operations related to asynchronous inserts on Distributed table (after insert, after sending the data to shard, etc).
|
||||
- `fsync_directories` - do the `fsync` for directories. Guarantees that the OS refreshed directory metadata after operations related to asynchronous inserts on Distributed table (after insert, after sending the data to shard, etc).
|
||||
|
||||
!!! note "Note"
|
||||
|
||||
@ -45,7 +45,7 @@ Example:
|
||||
Distributed(logs, default, hits[, sharding_key[, policy_name]])
|
||||
SETTINGS
|
||||
fsync_after_insert=0,
|
||||
fsync_tmp_directory=0;
|
||||
fsync_directories=0;
|
||||
```
|
||||
|
||||
Data will be read from all servers in the `logs` cluster, from the default.hits table located on every server in the cluster.
|
||||
|
@ -94,7 +94,7 @@ StorageDistributedDirectoryMonitor::StorageDistributedDirectoryMonitor(
|
||||
, relative_path(relative_path_)
|
||||
, path(disk->getPath() + relative_path + '/')
|
||||
, should_batch_inserts(storage.global_context.getSettingsRef().distributed_directory_monitor_batch_inserts)
|
||||
, dir_fsync(storage.getDistributedSettingsRef().fsync_tmp_directory)
|
||||
, dir_fsync(storage.getDistributedSettingsRef().fsync_directories)
|
||||
, min_batched_block_size_rows(storage.global_context.getSettingsRef().min_insert_block_size_rows)
|
||||
, min_batched_block_size_bytes(storage.global_context.getSettingsRef().min_insert_block_size_bytes)
|
||||
, current_batch_file_path(path + "current_batch.txt")
|
||||
|
@ -592,7 +592,7 @@ void DistributedBlockOutputStream::writeToShard(const Block & block, const std::
|
||||
const auto & distributed_settings = storage.getDistributedSettingsRef();
|
||||
|
||||
bool fsync = distributed_settings.fsync_after_insert;
|
||||
bool dir_fsync = distributed_settings.fsync_tmp_directory;
|
||||
bool dir_fsync = distributed_settings.fsync_directories;
|
||||
|
||||
std::string compression_method = Poco::toUpper(settings.network_compression_method.toString());
|
||||
std::optional<int> compression_level;
|
||||
|
@ -16,7 +16,7 @@ class ASTStorage;
|
||||
|
||||
#define LIST_OF_DISTRIBUTED_SETTINGS(M) \
|
||||
M(Bool, fsync_after_insert, false, "Do fsync for every inserted. Will decreases performance of inserts (only for async INSERT, i.e. insert_distributed_sync=false)", 0) \
|
||||
M(Bool, fsync_tmp_directory, false, "Do fsync for temporary directory (that is used for async INSERT only) after all part operations (writes, renames, etc.).", 0) \
|
||||
M(Bool, fsync_directories, false, "Do fsync for temporary directory (that is used for async INSERT only) after all part operations (writes, renames, etc.).", 0) \
|
||||
|
||||
DECLARE_SETTINGS_TRAITS(DistributedSettingsTraits, LIST_OF_DISTRIBUTED_SETTINGS)
|
||||
|
||||
|
@ -36,7 +36,7 @@ CREATE TABLE distributed (x UInt32) ENGINE = Distributed('test_cluster', 'defaul
|
||||
|
||||
remote.query("CREATE TABLE local2 (d Date, x UInt32, s String) ENGINE = MergeTree(d, x, 8192)")
|
||||
instance_test_inserts_batching.query('''
|
||||
CREATE TABLE distributed (d Date, x UInt32) ENGINE = Distributed('test_cluster', 'default', 'local2') SETTINGS fsync_after_insert=1, fsync_tmp_directory=1
|
||||
CREATE TABLE distributed (d Date, x UInt32) ENGINE = Distributed('test_cluster', 'default', 'local2') SETTINGS fsync_after_insert=1, fsync_directories=1
|
||||
''')
|
||||
|
||||
instance_test_inserts_local_cluster.query(
|
||||
|
@ -13,7 +13,7 @@ select sum(*) from dist_01643;
|
||||
drop table dist_01643;
|
||||
|
||||
select 'fsync';
|
||||
create table dist_01643 as data_01643 engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01643, key) settings fsync_after_insert=1, fsync_tmp_directory=1;
|
||||
create table dist_01643 as data_01643 engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01643, key) settings fsync_after_insert=1, fsync_directories=1;
|
||||
system stop distributed sends dist_01643;
|
||||
insert into dist_01643 select * from numbers(10) settings prefer_localhost_replica=0;
|
||||
select sum(*) from dist_01643;
|
||||
|
Loading…
Reference in New Issue
Block a user