Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
09aab726
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,发现更多精彩内容 >>
提交
09aab726
编写于
1月 03, 2018
作者:
J
Jimmy Yih
提交者:
Xin Zhang
1月 12, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Bump up max_wal_senders, to fix src/test/walrep/ tests."
This reverts commit f38f024d7d314ae8ac100d862307a228b212c70e.
上级
081e7176
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
36 deletion
+18
-36
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+1
-5
src/backend/replication/gp_replication.c
src/backend/replication/gp_replication.c
+17
-31
未找到文件。
src/backend/postmaster/postmaster.c
浏览文件 @
09aab726
...
...
@@ -1142,12 +1142,8 @@ PostmasterMain(int argc, char *argv[])
/*
* This value of max_wal_senders will be inherited by all the child processes
* through fork(). This value is used by XLogIsNeeded().
*
* In a normal setup, each node only has one replica. But have some headroom,
* for other tools that want to use a replication connection, and for hung
* connections, etc.
*/
max_wal_senders
=
5
;
max_wal_senders
=
1
;
if
(
GpIdentity
.
numsegments
<
0
)
{
...
...
src/backend/replication/gp_replication.c
浏览文件 @
09aab726
...
...
@@ -26,12 +26,8 @@
* 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.
*/
void
GetMirrorStatus
(
FtsResponse
*
response
)
void
GetMirrorStatus
(
FtsResponse
*
response
)
{
int
i
;
pg_time_t
most_recent_marked_pid_zero_at_time
;
response
->
IsMirrorUp
=
false
;
response
->
IsInSync
=
false
;
response
->
RequestRetry
=
false
;
...
...
@@ -40,23 +36,31 @@ GetMirrorStatus(FtsResponse *response)
* Greenplum currently supports only ONE mirror per primary.
* If there are more mirrors, this logic in this function need to be revised.
*/
Assert
(
max_wal_senders
>
=
1
);
Assert
(
max_wal_senders
=
=
1
);
LWLockAcquire
(
SyncRepLock
,
LW_SHARED
);
most_recent_marked_pid_zero_at_time
=
0
;
for
(
i
=
0
;
i
<
max_wal_senders
;
i
++
)
for
(
int
i
=
0
;
i
<
max_wal_senders
;
i
++
)
{
/* use volatile pointer to prevent code rearrangement */
volatile
WalSnd
*
walsnd
=
&
WalSndCtl
->
walsnds
[
i
];
if
(
walsnd
->
pid
==
0
)
{
pg_time_t
marked_pid_zero_at_time
=
walsnd
->
marked_pid_zero_at_time
;
Assert
(
marked_pid_zero_at_time
);
if
(
most_recent_marked_pid_zero_at_time
>
marked_pid_zero_at_time
)
most_recent_marked_pid_zero_at_time
=
marked_pid_zero_at_time
;
Assert
(
walsnd
->
marked_pid_zero_at_time
);
pg_time_t
delta
=
((
pg_time_t
)
time
(
NULL
))
-
walsnd
->
marked_pid_zero_at_time
;
/*
* Report mirror as down, only if it didn't connect for below
* grace period to primary. This helps to avoid marking mirror
* down unnecessarily when restarting primary or due to small n/w
* glitch. During this period, request FTS to probe again.
*/
if
(
delta
<
FTS_MARKING_MIRROR_DOWN_GRACE_PERIOD
)
{
elog
(
LOG
,
"requesting fts retry as mirror didn't connect yet but in grace period "
INT64_FORMAT
,
delta
);
response
->
RequestRetry
=
true
;
}
}
else
{
...
...
@@ -70,24 +74,6 @@ GetMirrorStatus(FtsResponse *response)
}
}
if
(
i
==
max_wal_senders
)
{
pg_time_t
delta
=
((
pg_time_t
)
time
(
NULL
))
-
most_recent_marked_pid_zero_at_time
;
/*
* Report mirror as down, only if it didn't connect for below
* grace period to primary. This helps to avoid marking mirror
* down unnecessarily when restarting primary or due to small n/w
* glitch. During this period, request FTS to probe again.
*/
if
(
delta
<
FTS_MARKING_MIRROR_DOWN_GRACE_PERIOD
)
{
elog
(
LOG
,
"requesting fts retry as mirror didn't connect yet but in grace period "
INT64_FORMAT
,
delta
);
response
->
RequestRetry
=
true
;
}
}
response
->
IsSyncRepEnabled
=
WalSndCtl
->
sync_standbys_defined
;
LWLockRelease
(
SyncRepLock
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录