未验证 提交 8d1bf002 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #21716 from azat/concurrent-OPTIMIZE-DROP-fix

[RFC] Fix concurrent OPTIMIZE and DROP for ReplicatedMergeTree
......@@ -4151,6 +4151,10 @@ bool StorageReplicatedMergeTree::optimize(
const Names & deduplicate_by_columns,
const Context & query_context)
{
/// NOTE: exclusive lock cannot be used here, since this may lead to deadlock (see comments below),
/// but it should be safe to use non-exclusive to avoid dropping parts that may be required for processing queue.
auto table_lock = lockForShare(query_context.getCurrentQueryId(), query_context.getSettingsRef().lock_acquire_timeout);
assertNotReadonly();
if (!is_leader)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册