Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
0d5e8b6e
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
0d5e8b6e
编写于
4月 27, 2018
作者:
N
Ning Yu
提交者:
GitHub
4月 27, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
resgroup: dump memory_auditor in pg_dumpall.
Dump the new capability resgroup memory_auditor in pg_dumpall.
上级
0b8c5f21
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
20 deletion
+36
-20
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_dumpall.c
+36
-20
未找到文件。
src/bin/pg_dump/pg_dumpall.c
浏览文件 @
0d5e8b6e
...
@@ -629,30 +629,24 @@ dumpResGroups(PGconn *conn)
...
@@ -629,30 +629,24 @@ dumpResGroups(PGconn *conn)
i_concurrency
,
i_concurrency
,
i_memory_limit
,
i_memory_limit
,
i_memory_shared_quota
,
i_memory_shared_quota
,
i_memory_spill_ratio
;
i_memory_spill_ratio
,
i_memory_auditor
;
printfPQExpBuffer
(
buf
,
"SELECT g.rsgname AS groupname, "
printfPQExpBuffer
(
buf
,
"SELECT g.rsgname AS groupname, "
"t1.value AS concurrency, "
"t1.value AS concurrency, "
"t2.value AS cpu_rate_limit, "
"t2.value AS cpu_rate_limit, "
"t3.value AS memory_limit, "
"t3.value AS memory_limit, "
"t4.value AS memory_shared_quota, "
"t4.value AS memory_shared_quota, "
"t5.value AS memory_spill_ratio "
"t5.value AS memory_spill_ratio, "
"FROM pg_resgroup g, "
"t6.value AS memory_auditor "
"pg_resgroupcapability t1, "
"FROM pg_resgroup g "
"pg_resgroupcapability t2, "
" JOIN pg_resgroupcapability t1 ON g.oid = t1.resgroupid AND t1.reslimittype = 1 "
"pg_resgroupcapability t3, "
" JOIN pg_resgroupcapability t2 ON g.oid = t2.resgroupid AND t2.reslimittype = 2 "
"pg_resgroupcapability t4, "
" JOIN pg_resgroupcapability t3 ON g.oid = t3.resgroupid AND t3.reslimittype = 3 "
"pg_resgroupcapability t5 "
" JOIN pg_resgroupcapability t4 ON g.oid = t4.resgroupid AND t4.reslimittype = 4 "
"WHERE g.oid = t1.resgroupid AND "
" JOIN pg_resgroupcapability t5 ON g.oid = t5.resgroupid AND t5.reslimittype = 5 "
"g.oid = t2.resgroupid AND "
"LEFT JOIN pg_resgroupcapability t6 ON g.oid = t6.resgroupid AND t6.reslimittype = 6 "
"g.oid = t3.resgroupid AND "
";"
);
"g.oid = t4.resgroupid AND "
"g.oid = t5.resgroupid AND "
"t1.reslimittype = 1 AND "
"t2.reslimittype = 2 AND "
"t3.reslimittype = 3 AND "
"t4.reslimittype = 4 AND "
"t5.reslimittype = 5;"
);
res
=
executeQuery
(
conn
,
buf
->
data
);
res
=
executeQuery
(
conn
,
buf
->
data
);
...
@@ -662,6 +656,7 @@ dumpResGroups(PGconn *conn)
...
@@ -662,6 +656,7 @@ dumpResGroups(PGconn *conn)
i_memory_limit
=
PQfnumber
(
res
,
"memory_limit"
);
i_memory_limit
=
PQfnumber
(
res
,
"memory_limit"
);
i_memory_shared_quota
=
PQfnumber
(
res
,
"memory_shared_quota"
);
i_memory_shared_quota
=
PQfnumber
(
res
,
"memory_shared_quota"
);
i_memory_spill_ratio
=
PQfnumber
(
res
,
"memory_spill_ratio"
);
i_memory_spill_ratio
=
PQfnumber
(
res
,
"memory_spill_ratio"
);
i_memory_auditor
=
PQfnumber
(
res
,
"memory_auditor"
);
if
(
PQntuples
(
res
)
>
0
)
if
(
PQntuples
(
res
)
>
0
)
fprintf
(
OPF
,
"--
\n
-- Resource Group
\n
--
\n\n
"
);
fprintf
(
OPF
,
"--
\n
-- Resource Group
\n
--
\n\n
"
);
...
@@ -683,6 +678,7 @@ dumpResGroups(PGconn *conn)
...
@@ -683,6 +678,7 @@ dumpResGroups(PGconn *conn)
const
char
*
memory_limit
;
const
char
*
memory_limit
;
const
char
*
memory_shared_quota
;
const
char
*
memory_shared_quota
;
const
char
*
memory_spill_ratio
;
const
char
*
memory_spill_ratio
;
const
char
*
memory_auditor
;
groupname
=
fmtId
(
PQgetvalue
(
res
,
i
,
i_groupname
));
groupname
=
fmtId
(
PQgetvalue
(
res
,
i
,
i_groupname
));
cpu_rate_limit
=
PQgetvalue
(
res
,
i
,
i_cpu_rate_limit
);
cpu_rate_limit
=
PQgetvalue
(
res
,
i
,
i_cpu_rate_limit
);
...
@@ -690,12 +686,18 @@ dumpResGroups(PGconn *conn)
...
@@ -690,12 +686,18 @@ dumpResGroups(PGconn *conn)
memory_limit
=
PQgetvalue
(
res
,
i
,
i_memory_limit
);
memory_limit
=
PQgetvalue
(
res
,
i
,
i_memory_limit
);
memory_shared_quota
=
PQgetvalue
(
res
,
i
,
i_memory_shared_quota
);
memory_shared_quota
=
PQgetvalue
(
res
,
i
,
i_memory_shared_quota
);
memory_spill_ratio
=
PQgetvalue
(
res
,
i
,
i_memory_spill_ratio
);
memory_spill_ratio
=
PQgetvalue
(
res
,
i
,
i_memory_spill_ratio
);
memory_auditor
=
PQgetvalue
(
res
,
i
,
i_memory_auditor
);
resetPQExpBuffer
(
buf
);
resetPQExpBuffer
(
buf
);
/* DROP or CREATE default group, so ALTER it */
/* DROP or CREATE default group, so ALTER it */
if
(
0
==
strcmp
(
groupname
,
"default_group"
)
||
0
==
strcmp
(
groupname
,
"admin_group"
))
if
(
0
==
strcmp
(
groupname
,
"default_group"
)
||
0
==
strcmp
(
groupname
,
"admin_group"
))
{
{
/*
* Default resource groups must have memory_auditor == "vmtracker",
* no need to ALTER it, and we do not support ALTER memory_auditor
* at all.
*/
appendPQExpBuffer
(
buf
,
"ALTER RESOURCE GROUP %s SET concurrency %s;
\n
"
,
appendPQExpBuffer
(
buf
,
"ALTER RESOURCE GROUP %s SET concurrency %s;
\n
"
,
groupname
,
concurrency
);
groupname
,
concurrency
);
appendPQExpBuffer
(
buf
,
"ALTER RESOURCE GROUP %s SET cpu_rate_limit %s;
\n
"
,
appendPQExpBuffer
(
buf
,
"ALTER RESOURCE GROUP %s SET cpu_rate_limit %s;
\n
"
,
...
@@ -709,13 +711,27 @@ dumpResGroups(PGconn *conn)
...
@@ -709,13 +711,27 @@ dumpResGroups(PGconn *conn)
}
}
else
else
{
{
const
char
*
memory_auditor_name
;
/*
* Possible values of memory_auditor:
* - "1": cgroup;
* - "0": vmtracker;
* - "": not set, e.g. created on an older version which does not
* support memory_auditor yet, consider it as vmtracker;
*/
if
(
strcmp
(
memory_auditor
,
"1"
)
==
0
)
memory_auditor_name
=
"cgroup"
;
else
memory_auditor_name
=
"vmtracker"
;
printfPQExpBuffer
(
buf
,
"CREATE RESOURCE GROUP %s WITH ("
printfPQExpBuffer
(
buf
,
"CREATE RESOURCE GROUP %s WITH ("
"concurrency=%s, cpu_rate_limit=%s, "
"concurrency=%s, cpu_rate_limit=%s, "
"memory_limit=%s, memory_shared_quota=%s, "
"memory_limit=%s, memory_shared_quota=%s, "
"memory_spill_ratio=%s);
\n
"
,
"memory_spill_ratio=%s
, memory_auditor=%s
);
\n
"
,
groupname
,
concurrency
,
cpu_rate_limit
,
groupname
,
concurrency
,
cpu_rate_limit
,
memory_limit
,
memory_shared_quota
,
memory_limit
,
memory_shared_quota
,
memory_spill_ratio
);
memory_spill_ratio
,
memory_auditor_name
);
}
}
fprintf
(
OPF
,
"%s"
,
buf
->
data
);
fprintf
(
OPF
,
"%s"
,
buf
->
data
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录