mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
Fix sticky mutations test (and extremely rare race condition)
This commit is contained in:
parent
381ab07e1b
commit
477b8f04b6
@ -599,7 +599,14 @@ void StorageMergeTree::mutate(const MutationCommands & commands, ContextPtr quer
|
||||
/// Validate partition IDs (if any) before starting mutation
|
||||
getPartitionIdsAffectedByCommands(commands, query_context);
|
||||
|
||||
Int64 version = startMutation(commands, query_context);
|
||||
Int64 version;
|
||||
{
|
||||
/// It's important to serialize order of mutations with alter queries because
|
||||
/// they can depend on each other.
|
||||
auto alter_lock = lockForAlter(query_context->getSettings().lock_acquire_timeout);
|
||||
version = startMutation(commands, query_context);
|
||||
}
|
||||
|
||||
if (query_context->getSettingsRef().mutations_sync > 0 || query_context->getCurrentTransaction())
|
||||
waitForMutation(version, false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user