Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
fdfbefa7
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,发现更多精彩内容 >>
提交
fdfbefa7
编写于
3月 16, 2018
作者:
A
Ashwin Agrawal
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Introduce GUC to control fts mirror down grace period.
上级
4c39375c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
25 deletion
+23
-25
src/backend/cdb/cdbvars.c
src/backend/cdb/cdbvars.c
+4
-10
src/backend/replication/gp_replication.c
src/backend/replication/gp_replication.c
+3
-9
src/backend/replication/test/gp_replication_test.c
src/backend/replication/test/gp_replication_test.c
+5
-5
src/backend/utils/misc/guc_gp.c
src/backend/utils/misc/guc_gp.c
+10
-0
src/include/cdb/cdbvars.h
src/include/cdb/cdbvars.h
+1
-1
未找到文件。
src/backend/cdb/cdbvars.c
浏览文件 @
fdfbefa7
...
...
@@ -134,17 +134,11 @@ int gp_fts_probe_timeout = 20;
int
gp_fts_probe_interval
=
60
;
/*
* Number of threads to use for probe of segments (it is a good idea to have this
* larger than the number of segments per host.
* If mirror disconnects and re-connects between this period, or just takes
* this much time during initial connection of cluster start, it will not get
* reported as down to FTS.
*/
int
gp_fts_probe_threadcount
=
16
;
/* The number of retries to request a segment state transition. */
int
gp_fts_transition_retries
=
5
;
/* Timeout to request a segment state transition. */
int
gp_fts_transition_timeout
=
3600
;
int
gp_fts_mark_mirror_down_grace_period
=
30
;
/*
* When we have certain types of failures during gang creation which indicate
...
...
src/backend/replication/gp_replication.c
浏览文件 @
fdfbefa7
...
...
@@ -13,6 +13,7 @@
#include "postgres.h"
#include "pgtime.h"
#include "cdb/cdbvars.h"
#include "replication/gp_replication.h"
#include "replication/walreceiver.h"
#include "replication/walsender_private.h"
...
...
@@ -21,13 +22,6 @@
/* Set at database system is ready to accept connections */
extern
pg_time_t
PMAcceptingConnectionsStartTime
;
/*
* If mirror disconnects and re-connects between this period, or just takes
* this much time during initial connection of cluster start, it will not get
* reported as down to FTS.
*/
#define FTS_MARKING_MIRROR_DOWN_GRACE_PERIOD 30
/* secs */
/*
* Check the WalSndCtl to obtain if mirror is up or down, if the wal sender is
* in streaming, and if synchronous replication is enabled or not.
...
...
@@ -71,11 +65,11 @@ GetMirrorStatus(FtsResponse *response)
* glitch. During this period, request FTS to probe again.
*
* If the delta is negative, then it's overflowed, meaning it's
* over
FTS_MARKING_MIRROR_DOWN_GRACE_PERIOD
since either last
* over
gp_fts_mark_mirror_down_grace_period
since either last
* database accepting connections or last time wal sender
* died. Then, we can safely mark the mirror is down.
*/
if
(
delta
<
FTS_MARKING_MIRROR_DOWN_GRACE_PERIOD
&&
delta
>=
0
)
if
(
delta
<
gp_fts_mark_mirror_down_grace_period
&&
delta
>=
0
)
{
ereport
(
LOG
,
(
errmsg
(
"requesting fts retry as mirror didn't connect yet but in grace period: "
INT64_FORMAT
,
delta
),
...
...
src/backend/replication/test/gp_replication_test.c
浏览文件 @
fdfbefa7
...
...
@@ -79,7 +79,7 @@ test_GetMirrorStatus_Pid_Zero(void **state)
* duration is taken into account.
*/
data
.
walsnds
[
0
].
marked_pid_zero_at_time
=
((
pg_time_t
)
time
(
NULL
))
-
FTS_MARKING_MIRROR_DOWN_GRACE_PERIOD
;
((
pg_time_t
)
time
(
NULL
))
-
gp_fts_mark_mirror_down_grace_period
;
/*
* Ensure the recovery finished before wal sender died.
...
...
@@ -107,12 +107,12 @@ test_GetMirrorStatus_RequestRetry(void **state)
* Make the pid zero time within the grace period.
*/
data
.
walsnds
[
0
].
marked_pid_zero_at_time
=
((
pg_time_t
)
time
(
NULL
))
-
FTS_MARKING_MIRROR_DOWN_GRACE_PERIOD
/
2
;
((
pg_time_t
)
time
(
NULL
))
-
gp_fts_mark_mirror_down_grace_period
/
2
;
/*
* Ensure recovery finished before wal sender died.
*/
PMAcceptingConnectionsStartTime
=
data
.
walsnds
[
0
].
marked_pid_zero_at_time
-
FTS_MARKING_MIRROR_DOWN_GRACE_PERIOD
;
PMAcceptingConnectionsStartTime
=
data
.
walsnds
[
0
].
marked_pid_zero_at_time
-
gp_fts_mark_mirror_down_grace_period
;
expect_lwlock
(
LW_SHARED
);
expect_ereport
();
...
...
@@ -138,14 +138,14 @@ test_GetMirrorStatus_Delayed_AcceptingConnectionsStartTime(void **state)
* Mirror will be marked down, and no retry.
*/
data
.
walsnds
[
0
].
marked_pid_zero_at_time
=
((
pg_time_t
)
time
(
NULL
))
-
FTS_MARKING_MIRROR_DOWN_GRACE_PERIOD
;
((
pg_time_t
)
time
(
NULL
))
-
gp_fts_mark_mirror_down_grace_period
;
/*
* However the database was in recovery, hence
* we are still within the grace period, and
* we should retry.
*/
PMAcceptingConnectionsStartTime
=
((
pg_time_t
)
time
(
NULL
))
-
FTS_MARKING_MIRROR_DOWN_GRACE_PERIOD
/
2
;
PMAcceptingConnectionsStartTime
=
((
pg_time_t
)
time
(
NULL
))
-
gp_fts_mark_mirror_down_grace_period
/
2
;
expect_lwlock
(
LW_SHARED
);
expect_ereport
();
...
...
src/backend/utils/misc/guc_gp.c
浏览文件 @
fdfbefa7
...
...
@@ -3502,6 +3502,16 @@ struct config_int ConfigureNamesInt_gp[] =
60
,
10
,
3600
,
NULL
,
NULL
},
{
{
"gp_fts_mark_mirror_down_grace_period"
,
PGC_SIGHUP
,
GP_ARRAY_TUNING
,
gettext_noop
(
"Time (in seconds) allowed to mirror after disconnection, to reconnect before being marked as down in configuration by FTS."
),
gettext_noop
(
"Used by the fts-probe process."
),
GUC_UNIT_S
},
&
gp_fts_mark_mirror_down_grace_period
,
30
,
0
,
3600
,
NULL
,
NULL
},
{
{
"gp_gang_creation_retry_count"
,
PGC_USERSET
,
GP_ARRAY_TUNING
,
gettext_noop
(
"After a gang-creation fails, retry the number of times if failure is retryable."
),
...
...
src/include/cdb/cdbvars.h
浏览文件 @
fdfbefa7
...
...
@@ -346,7 +346,7 @@ extern int gp_snapshotadd_timeout; /* GUC var - timeout specifier for snapshot-c
extern
int
gp_fts_probe_retries
;
/* GUC var - specifies probe number of retries for FTS */
extern
int
gp_fts_probe_timeout
;
/* GUC var - specifies probe timeout for FTS */
extern
int
gp_fts_probe_interval
;
/* GUC var - specifies polling interval for FTS */
extern
int
gp_fts_probe_threadcount
;
/* GUC var - specifies number of threads to use for FTS probes */
extern
int
gp_fts_mark_mirror_down_grace_period
;
extern
int
gp_gang_creation_retry_count
;
/* How many retries ? */
extern
int
gp_gang_creation_retry_timer
;
/* How long between retries */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录