Skip to content

Race condition when doing various ALTERs in a system under a heavy load #24134

@vzakaznikov

Description

@vzakaznikov

Describe the bug
New stress 01900_alter_race_condition_stress that can be found in #24132 fails when server is run with thread fuzzer enabled. This test was created based on the fails seen in RBAC TestFlows module (https://github.com/ClickHouse/ClickHouse/blob/master/tests/testflows/rbac/tests/privileges/alter/alter_column.py).

Does it reproduce on recent release?
Yes.

How to reproduce
Enable thread fuzzer in current environment

export THREAD_FUZZER_CPU_TIME_PERIOD_US=1000
export THREAD_FUZZER_SLEEP_PROBABILITY=0.1
export THREAD_FUZZER_SLEEP_TIME_US=100000

export THREAD_FUZZER_pthread_mutex_lock_BEFORE_MIGRATE_PROBABILITY=1
export THREAD_FUZZER_pthread_mutex_lock_AFTER_MIGRATE_PROBABILITY=1
export THREAD_FUZZER_pthread_mutex_unlock_BEFORE_MIGRATE_PROBABILITY=1
export THREAD_FUZZER_pthread_mutex_unlock_AFTER_MIGRATE_PROBABILITY=1

export THREAD_FUZZER_pthread_mutex_lock_BEFORE_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_lock_AFTER_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_unlock_BEFORE_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_unlock_AFTER_SLEEP_PROBABILITY=0.001
export THREAD_FUZZER_pthread_mutex_lock_BEFORE_SLEEP_TIME_US=10000
export THREAD_FUZZER_pthread_mutex_lock_AFTER_SLEEP_TIME_US=10000
export THREAD_FUZZER_pthread_mutex_unlock_BEFORE_SLEEP_TIME_US=10000
export THREAD_FUZZER_pthread_mutex_unlock_AFTER_SLEEP_TIME_US=10000

start server so that it gets all the environment variables

sudo -E -u clickhouse ./build/programs/clickhouse-server --config-file=/etc/clickhouse-server/config.xml

repeatedly run new tests until fail

tests/clickhouse-test -b build/programs/clickhouse  -c build/programs/clickhouse-client --queries tests/queries/ 01900_alter_race_condition

Expected behavior
Test should not fail with thread fuzzer enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fuzzProblem found by one of the fuzzers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions