Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
f3cad0a7
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,发现更多精彩内容 >>
提交
f3cad0a7
编写于
1月 03, 2018
作者:
H
Heikki Linnakangas
提交者:
Xin Zhang
1月 12, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove obsolete filespace stuff from gpactivatestandby
上级
34d22eb8
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
0 addition
and
54 deletion
+0
-54
gpMgmt/bin/gpactivatestandby
gpMgmt/bin/gpactivatestandby
+0
-54
未找到文件。
gpMgmt/bin/gpactivatestandby
浏览文件 @
f3cad0a7
...
...
@@ -31,7 +31,6 @@ try:
from
gppylib
import
gparray
from
gppylib.userinput
import
ask_yesno
from
gppylib.gp_dbid
import
GpDbidFile
,
writeGpDbidFile
from
gppylib.operations.filespace
import
GP_TRANSACTION_FILES_FILESPACE
,
GP_TEMPORARY_FILES_FILESPACE
except
ImportError
,
e_
:
sys
.
exit
(
'ERROR: Cannot import modules. Please check that you '
'have sourced greenplum_path.sh. Detail: '
+
str
(
e_
))
...
...
@@ -246,47 +245,6 @@ def get_config():
return
array
#-------------------------------------------------------------------------
def
update_flat_file
(
datadir
,
flat_file
,
old_dbid
,
new_dbid
):
"""
If the transaction/temporary filespaces have
ever been moved, we need to update the flat file.
The filespace directories are copied by the
copy_master_filespaces method.
"""
flat_file_location
=
os
.
path
.
join
(
datadir
,
flat_file
)
if
not
os
.
path
.
exists
(
flat_file_location
):
return
logger
.
debug
(
'flat file location for filespace files = %s'
%
flat_file_location
)
# The flat file looks like this:
# <BOF>
# {filespace_oid}
# {dbid} {path to filespace}
# {dbid} {path to filespace}
# <EOF>
with
open
(
flat_file_location
)
as
read_file
:
lines_to_write
=
''
for
line
in
read_file
:
tokens
=
line
.
split
()
if
len
(
tokens
)
!=
2
:
lines_to_write
+=
line
elif
tokens
[
0
]
==
str
(
old_dbid
):
lines_to_write
+=
str
(
new_dbid
)
+
' '
+
tokens
[
1
]
+
'
\n
'
temp_flat_file
=
os
.
path
.
join
(
flat_file_location
+
'.tmp'
)
try
:
with
open
(
temp_flat_file
,
'w'
)
as
write_file
:
write_file
.
write
(
lines_to_write
)
#Rewrite the master flat file to include the standby information
shutil
.
move
(
temp_flat_file
,
flat_file_location
)
except
Exception
,
e
:
raise
Exception
(
'Failed to update flat file'
)
#-------------------------------------------------------------------------
def
update_gpdbid_file
(
options
,
new_dbid
):
"""Updates to gp_dbid file in the data directory to reflect the standby masters dbid."""
...
...
@@ -406,18 +364,6 @@ try:
old_dbid
=
dbidfile
.
dbid
requires_restart
=
not
check_or_start_standby
(
options_
)
# We update flat files before promote because postmaster reads
# the new value on the promote procedure. Unfortunately at this
# point we don't know what is the new dbid as it is only in catalog,
# but for now we assume it's 1.
logger
.
info
(
'Updating transaction files filespace flat files...'
)
update_flat_file
(
options_
.
master_data_dir
,
GP_TRANSACTION_FILES_FILESPACE
,
old_dbid
,
1
)
logger
.
info
(
'Updating temporary files filespace flat files...'
)
update_flat_file
(
options_
.
master_data_dir
,
GP_TEMPORARY_FILES_FILESPACE
,
old_dbid
,
1
)
# promote standby, only if the standby is running in recovery
if
not
requires_restart
:
res
=
promote_standby
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录