Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
af8dc9c2
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
af8dc9c2
编写于
8月 11, 2017
作者:
J
Jacob Champion
提交者:
Xin Zhang
8月 18, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add assert checking to "UnderLock" functions
Signed-off-by:
N
Taylor Vesely
<
tvesely@pivotal.io
>
上级
677c3eac
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
18 addition
and
6 deletion
+18
-6
src/backend/cdb/cdbpersistentfilespace.c
src/backend/cdb/cdbpersistentfilespace.c
+6
-0
src/backend/cdb/cdbpersistenttablespace.c
src/backend/cdb/cdbpersistenttablespace.c
+12
-6
未找到文件。
src/backend/cdb/cdbpersistentfilespace.c
浏览文件 @
af8dc9c2
...
@@ -129,6 +129,8 @@ PersistentFilespace_FindDirUnderLock(
...
@@ -129,6 +129,8 @@ PersistentFilespace_FindDirUnderLock(
FilespaceDirEntryKey
key
;
FilespaceDirEntryKey
key
;
Assert
(
LWLockHeldByMe
(
FilespaceHashLock
));
if
(
persistentFilespaceSharedHashTable
==
NULL
)
if
(
persistentFilespaceSharedHashTable
==
NULL
)
elog
(
PANIC
,
"Persistent filespace information shared-memory not setup"
);
elog
(
PANIC
,
"Persistent filespace information shared-memory not setup"
);
...
@@ -156,6 +158,8 @@ PersistentFilespace_CreateDirUnderLock(
...
@@ -156,6 +158,8 @@ PersistentFilespace_CreateDirUnderLock(
FilespaceDirEntryKey
key
;
FilespaceDirEntryKey
key
;
Assert
(
LWLockHeldByMe
(
FilespaceHashLock
));
if
(
persistentFilespaceSharedHashTable
==
NULL
)
if
(
persistentFilespaceSharedHashTable
==
NULL
)
elog
(
PANIC
,
"Persistent filespace information shared-memory not setup"
);
elog
(
PANIC
,
"Persistent filespace information shared-memory not setup"
);
...
@@ -184,6 +188,8 @@ PersistentFilespace_RemoveDirUnderLock(
...
@@ -184,6 +188,8 @@ PersistentFilespace_RemoveDirUnderLock(
{
{
FilespaceDirEntry
removeFilespaceDirEntry
;
FilespaceDirEntry
removeFilespaceDirEntry
;
Assert
(
LWLockHeldByMe
(
FilespaceHashLock
));
if
(
persistentFilespaceSharedHashTable
==
NULL
)
if
(
persistentFilespaceSharedHashTable
==
NULL
)
elog
(
PANIC
,
"Persistent filespace information shared-memory not setup"
);
elog
(
PANIC
,
"Persistent filespace information shared-memory not setup"
);
...
...
src/backend/cdb/cdbpersistenttablespace.c
浏览文件 @
af8dc9c2
...
@@ -105,6 +105,8 @@ PersistentTablespace_FindEntryUnderLock(
...
@@ -105,6 +105,8 @@ PersistentTablespace_FindEntryUnderLock(
TablespaceDirEntryKey
key
;
TablespaceDirEntryKey
key
;
Assert
(
LWLockHeldByMe
(
TablespaceHashLock
));
if
(
persistentTablespaceSharedHashTable
==
NULL
)
if
(
persistentTablespaceSharedHashTable
==
NULL
)
elog
(
PANIC
,
"Persistent tablespace information shared-memory not setup"
);
elog
(
PANIC
,
"Persistent tablespace information shared-memory not setup"
);
...
@@ -134,6 +136,8 @@ PersistentTablespace_CreateEntryUnderLock(
...
@@ -134,6 +136,8 @@ PersistentTablespace_CreateEntryUnderLock(
TablespaceDirEntryKey
key
;
TablespaceDirEntryKey
key
;
Assert
(
LWLockHeldByMe
(
TablespaceHashLock
));
if
(
persistentTablespaceSharedHashTable
==
NULL
)
if
(
persistentTablespaceSharedHashTable
==
NULL
)
elog
(
PANIC
,
"Persistent tablespace information shared-memory not setup"
);
elog
(
PANIC
,
"Persistent tablespace information shared-memory not setup"
);
...
@@ -164,6 +168,8 @@ PersistentTablespace_RemoveEntryUnderLock(
...
@@ -164,6 +168,8 @@ PersistentTablespace_RemoveEntryUnderLock(
{
{
TablespaceDirEntry
removeTablespaceDirEntry
;
TablespaceDirEntry
removeTablespaceDirEntry
;
Assert
(
LWLockHeldByMe
(
TablespaceHashLock
));
if
(
persistentTablespaceSharedHashTable
==
NULL
)
if
(
persistentTablespaceSharedHashTable
==
NULL
)
elog
(
PANIC
,
"Persistent tablespace information shared-memory not setup"
);
elog
(
PANIC
,
"Persistent tablespace information shared-memory not setup"
);
...
@@ -847,12 +853,7 @@ PersistentTablespace_RemoveSegment(int16 dbid, bool ismirror)
...
@@ -847,12 +853,7 @@ PersistentTablespace_RemoveSegment(int16 dbid, bool ismirror)
WRITE_PERSISTENT_STATE_ORDERED_LOCK
;
WRITE_PERSISTENT_STATE_ORDERED_LOCK
;
/*
LWLockAcquire
(
TablespaceHashLock
,
LW_SHARED
);
* Writes to the shared tablespace hash table are protected by
* PersistentObjLock, which is held at this point. The tablespace hash
* therefore, can be read without acquiring TablespaceHashLock because we
* are not making any change to the hash table in this function.
*/
while
((
tablespaceDirEntry
=
hash_seq_search
(
&
hstat
))
!=
NULL
)
while
((
tablespaceDirEntry
=
hash_seq_search
(
&
hstat
))
!=
NULL
)
{
{
PersistentFileSysObjName
fsObjName
;
PersistentFileSysObjName
fsObjName
;
...
@@ -862,6 +863,8 @@ PersistentTablespace_RemoveSegment(int16 dbid, bool ismirror)
...
@@ -862,6 +863,8 @@ PersistentTablespace_RemoveSegment(int16 dbid, bool ismirror)
tablespaceDirEntry
=
PersistentTablespace_FindEntryUnderLock
(
tblspc
);
tablespaceDirEntry
=
PersistentTablespace_FindEntryUnderLock
(
tblspc
);
LWLockRelease
(
TablespaceHashLock
);
if
(
tablespaceDirEntry
==
NULL
)
if
(
tablespaceDirEntry
==
NULL
)
elog
(
ERROR
,
"Did not find persistent tablespace entry %u"
,
elog
(
ERROR
,
"Did not find persistent tablespace entry %u"
,
tblspc
);
tblspc
);
...
@@ -876,7 +879,10 @@ PersistentTablespace_RemoveSegment(int16 dbid, bool ismirror)
...
@@ -876,7 +879,10 @@ PersistentTablespace_RemoveSegment(int16 dbid, bool ismirror)
dbid
,
dbid
,
ismirror
,
ismirror
,
/* flushToXlog */
false
);
/* flushToXlog */
false
);
LWLockAcquire
(
TablespaceHashLock
,
LW_SHARED
);
}
}
LWLockRelease
(
TablespaceHashLock
);
WRITE_PERSISTENT_STATE_ORDERED_UNLOCK
;
WRITE_PERSISTENT_STATE_ORDERED_UNLOCK
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录