Merge pull request #17878 from ClickHouse/fix-bad-code

Fix bad code
This commit is contained in:
alesapin 2020-12-08 10:20:29 +03:00 committed by GitHub
commit 44c7fa5788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 37 additions and 31 deletions

View File

@ -4,11 +4,13 @@
#include <Interpreters/Context.h>
#include <Poco/File.h>
#include <Common/StringUtils/StringUtils.h>
#include <common/logger_useful.h>
#include "DictionarySourceFactory.h"
#include "DictionaryStructure.h"
#include "registerDictionaries.h"
#include "DictionarySourceHelpers.h"
namespace DB
{
static const UInt64 max_block_size = 8192;

View File

@ -8,8 +8,10 @@
#include <IO/createReadBufferFromFileBase.h>
#include <IO/createWriteBufferFromFileBase.h>
#include <common/logger_useful.h>
#include <unistd.h>
namespace DB
{

View File

@ -3,6 +3,7 @@
#include <IO/S3Common.h>
#include <IO/WriteHelpers.h>
#include <Interpreters/Context.h>
#include <common/logger_useful.h>
#include "DiskS3.h"
#include "Disks/DiskCacheWrapper.h"
#include "Disks/DiskFactory.h"
@ -10,6 +11,7 @@
#include "ProxyListConfiguration.h"
#include "ProxyResolverConfiguration.h"
namespace DB
{
namespace ErrorCodes

View File

@ -16,7 +16,6 @@
#include <Common/ThreadPool.h>
#include <Common/UInt128.h>
#include <Common/LRUCache.h>
#include <Common/ColumnsHashing.h>
#include <Common/assert_cast.h>
#include <Common/filesystemHelpers.h>

View File

@ -10,7 +10,6 @@
#include <Interpreters/DatabaseCatalog.h>
#include <Parsers/IAST_fwd.h>
#include <Access/RowPolicy.h>
#include <Common/LRUCache.h>
#include <Common/MultiVersion.h>
#include <Common/ThreadPool.h>
#include <Common/OpenTelemetryTraceContext.h>

View File

@ -14,6 +14,7 @@
#include <Poco/DirectoryIterator.h>
#include <Common/renameat2.h>
#include <Common/CurrentMetrics.h>
#include <common/logger_useful.h>
#include <filesystem>

View File

@ -7,7 +7,6 @@
#include <Columns/ColumnConst.h>
#include <Columns/ColumnNullable.h>
#include <Columns/ColumnVector.h>
#include <Common/LRUCache.h>
#include <Common/typeid_cast.h>
#include <Common/assert_cast.h>
#include <Common/ProfileEvents.h>

View File

@ -7,6 +7,8 @@
#include <Core/Defines.h>
#include <Core/Field.h>
#include <Common/LRUCache.h>
#include <IO/Operators.h>
#include <IO/ReadHelpers.h>
#include <IO/HTTPCommon.h>

View File

@ -1,9 +1,9 @@
############################
### emulate normal feature operation - merges are distributed between replicas
############################
### emulate execute_merges_on_single_replica_time_threshold timeout
############################
### timeout not exceeded, r1 waits for r2
****************************
*** emulate normal feature operation - merges are distributed between replicas
****************************
*** emulate execute_merges_on_single_replica_time_threshold timeout
****************************
*** timeout not exceeded, r1 waits for r2
Row 1:
──────
table: execute_on_single_replica_r1
@ -19,8 +19,8 @@ type: MERGE_PARTS
new_part_name: all_0_0_5
has_postpones: 0
postpone_reason:
############################
### timeout exceeded, r1 failed to get the merged part from r2 and did the merge by its own
****************************
*** timeout exceeded, r1 failed to get the merged part from r2 and did the merge by its own
Row 1:
──────
table: execute_on_single_replica_r2
@ -28,12 +28,12 @@ type: MERGE_PARTS
new_part_name: all_0_0_5
has_postpones: 0
postpone_reason:
############################
### queue unfreeze
############################
### disable the feature
############################
### part_log
****************************
*** queue unfreeze
****************************
*** disable the feature
****************************
*** part_log
Row 1:
──────
part_name: all_0_0_1

View File

@ -10,8 +10,8 @@ SYSTEM SYNC REPLICA execute_on_single_replica_r2;
SET optimize_throw_if_noop=1;
SELECT '############################';
SELECT '### emulate normal feature operation - merges are distributed between replicas';
SELECT '****************************';
SELECT '*** emulate normal feature operation - merges are distributed between replicas';
/* all_0_0_1 - will be merged by r1, and downloaded by r2 */
OPTIMIZE TABLE execute_on_single_replica_r1 FINAL;
@ -29,8 +29,8 @@ SYSTEM SYNC REPLICA execute_on_single_replica_r2;
OPTIMIZE TABLE execute_on_single_replica_r2 FINAL;
SYSTEM SYNC REPLICA execute_on_single_replica_r1;
SELECT '############################';
SELECT '### emulate execute_merges_on_single_replica_time_threshold timeout';
SELECT '****************************';
SELECT '*** emulate execute_merges_on_single_replica_time_threshold timeout';
SYSTEM STOP REPLICATION QUEUES execute_on_single_replica_r2;
@ -40,8 +40,8 @@ OPTIMIZE TABLE execute_on_single_replica_r1 FINAL SETTINGS replication_alter_par
/* if we will check immediately we can find the log entry unchecked */
SELECT * FROM numbers(4) where sleepEachRow(1);
SELECT '############################';
SELECT '### timeout not exceeded, r1 waits for r2';
SELECT '****************************';
SELECT '*** timeout not exceeded, r1 waits for r2';
/* we can now check that r1 waits for r2 */
SELECT
@ -59,8 +59,8 @@ FORMAT Vertical;
/* we have execute_merges_on_single_replica_time_threshold exceeded */
SELECT * FROM numbers(10) where sleepEachRow(1);
SELECT '############################';
SELECT '### timeout exceeded, r1 failed to get the merged part from r2 and did the merge by its own';
SELECT '****************************';
SELECT '*** timeout exceeded, r1 failed to get the merged part from r2 and did the merge by its own';
SELECT
table,
@ -77,8 +77,8 @@ FORMAT Vertical;
SYSTEM START REPLICATION QUEUES execute_on_single_replica_r2;
SYSTEM SYNC REPLICA execute_on_single_replica_r2;
SELECT '############################';
SELECT '### queue unfreeze';
SELECT '****************************';
SELECT '*** queue unfreeze';
SELECT
table,
@ -92,8 +92,8 @@ AND database = currentDatabase()
ORDER BY table
FORMAT Vertical;
SELECT '############################';
SELECT '### disable the feature';
SELECT '****************************';
SELECT '*** disable the feature';
ALTER TABLE execute_on_single_replica_r1 MODIFY SETTING execute_merges_on_single_replica_time_threshold=0;
ALTER TABLE execute_on_single_replica_r2 MODIFY SETTING execute_merges_on_single_replica_time_threshold=0;
@ -108,8 +108,8 @@ SYSTEM SYNC REPLICA execute_on_single_replica_r2;
SYSTEM FLUSH LOGS;
SELECT '############################';
SELECT '### part_log';
SELECT '****************************';
SELECT '*** part_log';
SELECT
part_name,
arraySort(groupArrayIf(table, event_type = 'MergeParts')) AS mergers,