Skip to content

Incorrect mutation can easily produce inifinite CPU usage in a loop of retries #36987

@alexey-milovidov

Description

@alexey-milovidov
CREATE TABLE test (x Float64) ENGINE = MergeTree ORDER BY tuple();
INSERT INTO test VALUES (nan);
ALTER TABLE test MODIFY COLUMN x Decimal64(10)

Although the exception message is totally correct:

Code: 341. DB::Exception: Received from localhost:9000. DB::Exception: Exception happened during execution of mutation 'mutation_2.txt' with part 'all_1_1_0' reason: 'Code: 407. DB::Exception: Decimal convert overflow. Cannot convert infinity or NaN to decimal: while executing 'FUNCTION _CAST(x :: 0, 'Decimal(18, 10)' :: 1) -> _CAST(x, 'Decimal(18, 10)') Decimal(18, 10) : 2': (while reading from part /var/lib/clickhouse/store/18e/18ed6da2-dc26-4f52-8fad-1055ad9fde93/all_1_1_0/): While executing MergeTreeInOrder. (DECIMAL_OVERFLOW) (version 22.4.1.2286 (official build))'. This error maybe retryable or not. In case of unretryable error, mutation can be killed with KILL MUTATION query. (UNFINISHED)

It even advices to do "KILL MUTATION".

But if you don't do you get this: https://pastila.nl/?04dc0c99/992b03c0a6365999767a79ea415a44f4

This is a usability issue. People will get 100% infinite CPU usage too easily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    unexpected behaviourResult is unexpected, but not entirely wrong at the same time.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions