Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
0ad14f38
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 搜索 >>
提交
0ad14f38
编写于
2月 04, 2019
作者:
H
Heikki Linnakangas
提交者:
Jacob Champion
2月 04, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary schema OID from gpexpand status table.
It's not used for anything.
上级
41c919ce
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
29 deletion
+22
-29
gpMgmt/bin/gpexpand
gpMgmt/bin/gpexpand
+22
-29
未找到文件。
gpMgmt/bin/gpexpand
浏览文件 @
0ad14f38
...
...
@@ -282,7 +282,6 @@ status_table_sql = """CREATE TABLE gpexpand.status
status_detail_table_sql
=
"""CREATE TABLE gpexpand.status_detail
( dbname text,
fq_name text,
schema_oid oid,
table_oid oid,
root_partition_name text,
storage_options text,
...
...
@@ -1572,7 +1571,6 @@ Set PGDATABASE or use the -D option to specify the correct database to use.""" %
src_bytes_str
=
"0"
if
self
.
options
.
simple_progress
else
"pg_relation_size(quote_ident(n.nspname) || '.' || quote_ident(c.relname))"
sql
=
"""SELECT
quote_ident(n.nspname) || '.' || quote_ident(c.relname) as fq_name,
n.oid as schemaoid,
c.oid as tableoid,
now() as last_updated,
%s,
...
...
@@ -1601,15 +1599,14 @@ WHERE
fp
=
open
(
sql_file
,
'w'
)
for
row
in
rows
:
fqname
=
row
[
0
]
schema_oid
=
row
[
1
]
table_oid
=
row
[
2
]
rel_bytes
=
int
(
row
[
4
])
root_partition_name
=
row
[
5
]
table_oid
=
row
[
1
]
rel_bytes
=
int
(
row
[
3
])
root_partition_name
=
row
[
4
]
full_name
=
'%s.%s'
%
(
dbname
,
fqname
)
rank
=
1
if
self
.
unique_index_tables
.
has_key
(
full_name
)
else
2
fp
.
write
(
"""%s
\t
%s
\t
%s
\t
%s
\t
%s
\t
NULL
\t
%d
\t
%s
\t
NULL
\t
NULL
\t
%d
\n
"""
%
(
dbname
,
fqname
,
schema_oid
,
table_oid
,
fp
.
write
(
"""%s
\t
%s
\t
%s
\t
%s
\t
NULL
\t
%d
\t
%s
\t
NULL
\t
NULL
\t
%d
\n
"""
%
(
dbname
,
fqname
,
table_oid
,
root_partition_name
,
rank
,
undone_status
,
rel_bytes
))
except
Exception
,
e
:
raise
ExpansionError
(
e
)
...
...
@@ -1654,7 +1651,6 @@ WHERE
sql
=
"""
SELECT
quote_ident(n.nspname) || '.' || quote_ident(c.relname) as fq_name,
n.oid as schemaoid,
c.oid as tableoid,
now() as last_updated,
%s,
...
...
@@ -1683,15 +1679,14 @@ ORDER BY fq_name, tableoid desc;
for
row
in
rows
:
fqname
=
row
[
0
]
schema_oid
=
row
[
1
]
table_oid
=
row
[
2
]
rel_bytes
=
int
(
row
[
4
])
root_partition_name
=
row
[
5
]
table_oid
=
row
[
1
]
rel_bytes
=
int
(
row
[
3
])
root_partition_name
=
row
[
4
]
full_name
=
'%s.%s'
%
(
dbname
,
fqname
)
rank
=
1
if
self
.
unique_index_tables
.
has_key
(
full_name
)
else
2
fp
.
write
(
"""%s
\t
%s
\t
%s
\t
%s
\t
%s
\t
NULL
\t
%d
\t
%s
\t
NULL
\t
NULL
\t
%d
\n
"""
%
(
dbname
,
fqname
,
schema_oid
,
table_oid
,
fp
.
write
(
"""%s
\t
%s
\t
%s
\t
%s
\t
NULL
\t
%d
\t
%s
\t
NULL
\t
NULL
\t
%d
\n
"""
%
(
dbname
,
fqname
,
table_oid
,
root_partition_name
,
rank
,
undone_status
,
rel_bytes
))
except
Exception
:
raise
...
...
@@ -1932,7 +1927,7 @@ class ExpandTable():
self
.
options
=
options
self
.
is_root_partition
=
False
if
row
is
not
None
:
(
self
.
dbname
,
self
.
fq_name
,
self
.
schema_oid
,
self
.
table_oid
,
(
self
.
dbname
,
self
.
fq_name
,
self
.
table_oid
,
self
.
root_partition_name
,
self
.
storage_options
,
self
.
rank
,
self
.
status
,
self
.
expansion_started
,
self
.
expansion_finished
,
...
...
@@ -1942,9 +1937,9 @@ class ExpandTable():
def
add_table
(
self
,
conn
):
insertSQL
=
"""INSERT INTO gpexpand.status_detail
VALUES ('%s','%s',%s,
%s,
VALUES ('%s','%s',%s,
'%s','%s',%d,'%s','%s','%s',%d)
"""
%
(
self
.
dbname
,
self
.
fq_name
.
replace
(
"\'"
,
"\'\'"
),
self
.
schema_oid
,
self
.
table_oid
,
"""
%
(
self
.
dbname
,
self
.
fq_name
.
replace
(
"\'"
,
"\'\'"
),
self
.
table_oid
,
self
.
root_partition_name
,
self
.
storage_options
,
self
.
rank
,
self
.
status
,
self
.
expansion_started
,
self
.
expansion_finished
,
...
...
@@ -1965,10 +1960,10 @@ class ExpandTable():
sql
=
"""UPDATE gpexpand.status_detail
SET status = '%s', expansion_started='%s',
source_bytes = %d
WHERE dbname = '%s'
AND schema_oid = %s
WHERE dbname = '%s'
AND table_oid = %s """
%
(
start_status
,
start_time
,
src_bytes
,
self
.
dbname
,
self
.
schema_oid
,
self
.
table_oid
)
self
.
table_oid
)
logger
.
debug
(
"Mark Started: "
+
sql
.
decode
(
'utf-8'
))
dbconn
.
execSQL
(
status_conn
,
sql
)
...
...
@@ -1977,9 +1972,9 @@ class ExpandTable():
def
reset_started
(
self
,
status_conn
):
sql
=
"""UPDATE gpexpand.status_detail
SET status = '%s', expansion_started=NULL, expansion_finished=NULL
WHERE dbname = '%s'
AND schema_oid = %s
WHERE dbname = '%s'
AND table_oid = %s """
%
(
undone_status
,
self
.
dbname
,
self
.
schema_oid
,
self
.
table_oid
)
self
.
dbname
,
self
.
table_oid
)
logger
.
debug
(
'Resetting detailed_status: %s'
%
sql
.
decode
(
'utf-8'
))
dbconn
.
execSQL
(
status_conn
,
sql
)
...
...
@@ -2020,9 +2015,9 @@ class ExpandTable():
def
mark_finished
(
self
,
status_conn
,
start_time
,
finish_time
):
sql
=
"""UPDATE gpexpand.status_detail
SET status = '%s', expansion_started='%s', expansion_finished='%s'
WHERE dbname = '%s'
AND schema_oid = %s
WHERE dbname = '%s'
AND table_oid = %s """
%
(
done_status
,
start_time
,
finish_time
,
self
.
dbname
,
self
.
schema_oid
,
self
.
table_oid
)
self
.
dbname
,
self
.
table_oid
)
logger
.
debug
(
sql
.
decode
(
'utf-8'
))
dbconn
.
execSQL
(
status_conn
,
sql
)
status_conn
.
commit
()
...
...
@@ -2030,9 +2025,9 @@ class ExpandTable():
def
mark_does_not_exist
(
self
,
status_conn
,
finish_time
):
sql
=
"""UPDATE gpexpand.status_detail
SET status = '%s', expansion_finished='%s'
WHERE dbname = '%s'
AND schema_oid = %s
WHERE dbname = '%s'
AND table_oid = %s """
%
(
does_not_exist_status
,
finish_time
,
self
.
dbname
,
self
.
schema_oid
,
self
.
table_oid
)
self
.
dbname
,
self
.
table_oid
)
logger
.
debug
(
sql
.
decode
(
'utf-8'
))
dbconn
.
execSQL
(
status_conn
,
sql
)
status_conn
.
commit
()
...
...
@@ -2141,9 +2136,7 @@ class ExpandCommand(SQLCommand):
#
validate
table
hasn
't been dropped
start_time = None
try:
sql = """select * from pg_class c, pg_namespace n
where c.oid = %d and n.oid = c.relnamespace and n.oid=%d""" % (self.table.table_oid,
self.table.schema_oid)
sql = """select * from pg_class c where c.oid = %d """ % (self.table.table_oid)
cursor = dbconn.execSQL(table_conn, sql)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录