Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
aac0b27d
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
aac0b27d
编写于
8月 31, 2019
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed possible deadlock in distributed queries
上级
783df7a5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
15 addition
and
5 deletion
+15
-5
dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp
dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp
+1
-1
dbms/src/Functions/FunctionJoinGet.cpp
dbms/src/Functions/FunctionJoinGet.cpp
+1
-1
dbms/src/Interpreters/Context.cpp
dbms/src/Interpreters/Context.cpp
+6
-0
dbms/src/Interpreters/Context.h
dbms/src/Interpreters/Context.h
+4
-0
dbms/src/Interpreters/InterpreterDescribeQuery.cpp
dbms/src/Interpreters/InterpreterDescribeQuery.cpp
+1
-1
dbms/src/Interpreters/InterpreterInsertQuery.cpp
dbms/src/Interpreters/InterpreterInsertQuery.cpp
+1
-1
dbms/src/Interpreters/InterpreterSelectQuery.cpp
dbms/src/Interpreters/InterpreterSelectQuery.cpp
+1
-1
未找到文件。
dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp
浏览文件 @
aac0b27d
...
...
@@ -26,7 +26,7 @@ PushingToViewsBlockOutputStream::PushingToViewsBlockOutputStream(
* Although now any insertion into the table is done via PushingToViewsBlockOutputStream,
* but it's clear that here is not the best place for this functionality.
*/
addTableLock
(
storage
->
lockStructureForShare
(
true
,
context
.
get
Current
QueryId
()));
addTableLock
(
storage
->
lockStructureForShare
(
true
,
context
.
get
Initial
QueryId
()));
/// If the "root" table deduplactes blocks, there are no need to make deduplication for children
/// Moreover, deduplication for AggregatingMergeTree children could produce false positives due to low size of inserting blocks
...
...
dbms/src/Functions/FunctionJoinGet.cpp
浏览文件 @
aac0b27d
...
...
@@ -65,7 +65,7 @@ FunctionBasePtr FunctionBuilderJoinGet::buildImpl(const ColumnsWithTypeAndName &
auto
join
=
storage_join
->
getJoin
();
DataTypes
data_types
(
arguments
.
size
());
auto
table_lock
=
storage_join
->
lockStructureForShare
(
false
,
context
.
get
Current
QueryId
());
auto
table_lock
=
storage_join
->
lockStructureForShare
(
false
,
context
.
get
Initial
QueryId
());
for
(
size_t
i
=
0
;
i
<
arguments
.
size
();
++
i
)
data_types
[
i
]
=
arguments
[
i
].
type
;
...
...
dbms/src/Interpreters/Context.cpp
浏览文件 @
aac0b27d
...
...
@@ -1162,6 +1162,12 @@ String Context::getCurrentQueryId() const
}
String
Context
::
getInitialQueryId
()
const
{
return
client_info
.
initial_query_id
;
}
void
Context
::
setCurrentDatabase
(
const
String
&
name
)
{
auto
lock
=
getLock
();
...
...
dbms/src/Interpreters/Context.h
浏览文件 @
aac0b27d
...
...
@@ -264,6 +264,10 @@ public:
String
getCurrentDatabase
()
const
;
String
getCurrentQueryId
()
const
;
/// Id of initiating query for distributed queries; or current query id if it's not a distributed query.
String
getInitialQueryId
()
const
;
void
setCurrentDatabase
(
const
String
&
name
);
void
setCurrentQueryId
(
const
String
&
query_id
);
...
...
dbms/src/Interpreters/InterpreterDescribeQuery.cpp
浏览文件 @
aac0b27d
...
...
@@ -92,7 +92,7 @@ BlockInputStreamPtr InterpreterDescribeQuery::executeImpl()
table
=
context
.
getTable
(
database_name
,
table_name
);
}
auto
table_lock
=
table
->
lockStructureForShare
(
false
,
context
.
get
Current
QueryId
());
auto
table_lock
=
table
->
lockStructureForShare
(
false
,
context
.
get
Initial
QueryId
());
columns
=
table
->
getColumns
();
}
...
...
dbms/src/Interpreters/InterpreterInsertQuery.cpp
浏览文件 @
aac0b27d
...
...
@@ -100,7 +100,7 @@ BlockIO InterpreterInsertQuery::execute()
checkAccess
(
query
);
StoragePtr
table
=
getTable
(
query
);
auto
table_lock
=
table
->
lockStructureForShare
(
true
,
context
.
get
Current
QueryId
());
auto
table_lock
=
table
->
lockStructureForShare
(
true
,
context
.
get
Initial
QueryId
());
/// We create a pipeline of several streams, into which we will write data.
BlockOutputStreamPtr
out
;
...
...
dbms/src/Interpreters/InterpreterSelectQuery.cpp
浏览文件 @
aac0b27d
...
...
@@ -294,7 +294,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
}
if
(
storage
)
table_lock
=
storage
->
lockStructureForShare
(
false
,
context
.
get
Current
QueryId
());
table_lock
=
storage
->
lockStructureForShare
(
false
,
context
.
get
Initial
QueryId
());
syntax_analyzer_result
=
SyntaxAnalyzer
(
context
,
options
).
analyze
(
query_ptr
,
source_header
.
getNamesAndTypesList
(),
required_result_column_names
,
storage
,
NamesAndTypesList
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录