ClickHouse/programs
Azat Khuzhin ff324fe81a Fix fault injection in copier (wrong query syntax)
There are very frequent flakiness of `test_cluster_copier` test, here is
an example of copier failures on CI [1]:

    AssertionError: Instance: s0_1_0 (172.16.29.9). Info: {'ID': '5d68dcb46fdb4b0c54b7c7ba1ddde83b8f34d483bbb32abcb0c52b966444ce82', 'Running': False, 'ExitCode': 85, 'ProcessConfig': {'tty': False, 'entrypoint': '/usr/bin/clickhouse', 'arguments': ['copier', '--config', '/etc/clickhouse-server/config-copier.xml', '--task-path', '/clickhouse-copier/task_simple_4DFWYTDD49', '--task-file', '/task0_description.xml', '--task-upload-force', 'true', '--base-dir', '/var/log/clickhouse-server/copier', '--copy-fault-probability', '0.2', '--experimental-use-sample-offset', '1'], 'privileged': False, 'user': '0'}, 'OpenStdin': False, 'OpenStderr': True, 'OpenStdout': True, 'CanRemove': False, 'ContainerID': 'f356df6694b3cc09ee9830c623681626f8e8d999677c188b9fe911aa702784ca', 'DetachKeys': '', 'Pid': 84332}
    assert 85 == 0

But let's look what the error it is, apparently it is UNFINISHED:

    SELECT
        name,
        code
    FROM system.errors
    WHERE ((code % 256) = 85) AND (NOT remote)
    SETTINGS system_events_show_zero_values = 1

    ┌─name─────────────────────────────┬─code─┐
    │ FORMAT_IS_NOT_SUITABLE_FOR_INPUT │   85 │
    │ UNFINISHED                       │  341 │
    │ NO_SUCH_ERROR_CODE               │  597 │
    └──────────────────────────────────┴──────┘

Let's verify:

    $ grep -r UNFINISHED ./test_cluster_copier/_instances_0/s0_1_0/logs/copier/clickhouse-copier_*
    ./test_cluster_copier/_instances_0/s0_1_0/logs/copier/clickhouse-copier_20230206220846_368/log.log:2023.02.06 22:09:19.015251 [ 368 ] {} <Error> : virtual int DB::ClusterCopierApp::main(const std::vector<std::string> &): Code: 341. DB::Exception: Too many tries to process table cluster1.default.hits. Abort remaining execution. (UNFINISHED), Stack trace (when copying this message, always include the lines below):

And apparently that it is due to query error with fault injection:

    2023.02.06 22:09:15.654724 [ 368 ] {} <Error> Application: An error occurred while processing partition 0: Code: 62. DB::Exception: Syntax error (Query): failed at position 168 ('Native'): Native. Expected one of: token, Dot, OR, AND, BETWEEN, NOT BETWEEN, LIKE, ILIKE, NOT LIKE, NOT ILIKE, IN, NOT IN, GLOBAL IN, GLOBAL NOT IN, MOD, DIV, IS NULL, IS NOT NULL, alias, AS, Comma, OFFSET, WITH TIES, BY, LIMIT, SETTINGS, UNION, EXCEPT, INTERSECT, INTO OUTFILE, FORMAT, end of query. (SYNTAX_ERROR), Stack trace (when copying this message, always include the lines below):

Example:

    select x from x limit  1FORMAT Native

    Syntax error: failed at position 32 ('Native'):

So fixing this should fix test_cluster_copier flakiness.

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/46045/bd4170e03c6af583a51d12d2c39fa775dcb9997b/integration_tests__release__[4/4].html

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-07 17:01:06 +01:00
..
bash-completion Update available formats for bash completion 2022-08-28 17:22:32 +02:00
benchmark Parallel replicas. Part [2] (#43772) 2023-02-03 14:34:18 +01:00
client Merge pull request #38983 from CurtizJ/randomize-mt-settings 2023-02-04 02:59:52 +01:00
compressor Better formatting for exception messages (#45449) 2023-01-24 00:13:58 +03:00
copier Fix fault injection in copier (wrong query syntax) 2023-02-07 17:01:06 +01:00
diagnostics fix: typo 2022-11-25 10:09:32 +01:00
disks Better formatting for exception messages (#45449) 2023-01-24 00:13:58 +03:00
extract-from-config Remove dlopen 2022-09-17 03:02:34 +02:00
format forbid old ctor of Exception 2023-01-23 22:18:05 +01:00
git-import Better formatting for exception messages (#45449) 2023-01-24 00:13:58 +03:00
install Better diagnostics on stop 2022-12-26 12:15:58 +01:00
keeper Create "coordination" directory in keeper if does not exist 2023-02-03 12:16:19 +01:00
keeper-converter Remove dlopen 2022-09-17 03:02:34 +02:00
library-bridge fix 2023-01-24 15:29:19 +01:00
local fix memory leak in azure sdk 2023-01-31 01:01:10 +00:00
obfuscator Better formatting for exception messages (#45449) 2023-01-24 00:13:58 +03:00
odbc-bridge Merge branch 'master' into ncb/odbc-connection-pool-fixes 2023-01-24 21:27:20 -08:00
self-extracting add native build for cross-compilation 2022-07-20 23:09:05 -04:00
server Merge remote-tracking branch 'origin/master' into qc-max_cache_size 2023-02-05 16:47:02 +00:00
static-files-disk-uploader Fix integration tests 2022-09-26 12:49:20 +02:00
su Better formatting for exception messages (#45449) 2023-01-24 00:13:58 +03:00
CMakeLists.txt What happens if I remove 156 lines of code? 2023-01-03 18:51:16 +00:00
config_tools.h.in Make comment consistent accross generated files 2022-09-28 08:11:09 +00:00
embed_binary.S.in Adds a better way to include binary resources 2021-06-09 14:03:30 -07:00
main.cpp What happens if I remove these 139 lines of code? 2023-01-03 18:35:31 +00:00