Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
7f558913
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 搜索 >>
提交
7f558913
编写于
11月 09, 2020
作者:
H
Hubert Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "ic-proxy: refresh peers on demand"
This reverts commit
9265ea6a
.
上级
aef99680
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
122 deletion
+0
-122
src/backend/cdb/motion/ic_proxy_main.c
src/backend/cdb/motion/ic_proxy_main.c
+0
-100
src/backend/cdb/motion/ic_proxy_peer.c
src/backend/cdb/motion/ic_proxy_peer.c
+0
-21
src/backend/cdb/motion/ic_proxy_server.h
src/backend/cdb/motion/ic_proxy_server.h
+0
-1
未找到文件。
src/backend/cdb/motion/ic_proxy_main.c
浏览文件 @
7f558913
...
...
@@ -27,8 +27,6 @@
#include <unistd.h>
static
void
ic_proxy_server_peer_listener_init
(
uv_loop_t
*
loop
);
static
uv_loop_t
ic_proxy_server_loop
;
static
uv_signal_t
ic_proxy_server_signal_hup
;
static
uv_signal_t
ic_proxy_server_signal_int
;
...
...
@@ -38,7 +36,6 @@ static uv_timer_t ic_proxy_server_timer;
static
uv_tcp_t
ic_proxy_peer_listener
;
static
bool
ic_proxy_peer_listening
;
static
bool
ic_proxy_peer_relistening
;
static
uv_pipe_t
ic_proxy_client_listener
;
static
bool
ic_proxy_client_listening
;
...
...
@@ -58,13 +55,6 @@ ic_proxy_server_peer_listener_on_closed(uv_handle_t *handle)
/* A new peer listener will be created on the next timer callback */
ic_proxy_peer_listening
=
false
;
/* If relisten is requested, do it now */
if
(
ic_proxy_peer_relistening
)
{
ic_proxy_peer_relistening
=
false
;
ic_proxy_server_peer_listener_init
(
handle
->
loop
);
}
}
/*
...
...
@@ -210,40 +200,6 @@ ic_proxy_server_peer_listener_init(uv_loop_t *loop)
ic_proxy_peer_listening
=
true
;
}
/*
* Reinit the peer listener.
*/
static
void
ic_proxy_server_peer_listener_reinit
(
uv_loop_t
*
loop
)
{
const
ICProxyAddr
*
myaddr
=
ic_proxy_get_my_addr
();
if
(
ic_proxy_peer_relistening
)
return
;
if
(
ic_proxy_peer_listening
)
{
/*
* We are listening already, so must first close the current one, we
* keep the ic_proxy_peer_listening as true during the process to
* prevent double connect.
*/
ic_proxy_log
(
LOG
,
"ic-proxy-server: closing the legacy peer listener"
);
/* Only recreate a new listener if an address is assigned to us */
ic_proxy_peer_relistening
=
!!
myaddr
;
uv_close
((
uv_handle_t
*
)
&
ic_proxy_peer_listener
,
ic_proxy_server_peer_listener_on_closed
);
}
else
if
(
myaddr
)
{
/* Otherwise simply establish a new one */
ic_proxy_peer_relistening
=
false
;
ic_proxy_server_peer_listener_init
(
loop
);
}
}
/*
* The client listener is closed.
*/
...
...
@@ -397,57 +353,6 @@ ic_proxy_server_ensure_peers(uv_loop_t *loop)
}
}
/*
* Drop legacy peers.
*
* The list ic_proxy_removed_addrs contains both removed and updated addresses,
* the corresponding peers must be disconnected before taking further actions.
*/
static
void
ic_proxy_server_drop_legacy_peers
(
uv_loop_t
*
loop
)
{
ListCell
*
cell
;
const
ICProxyAddr
*
myaddr
=
ic_proxy_get_my_addr
();
/*
* Also take the chance to check the peer listener.
*
* If myaddr cannot be found at all, the address must have been removed,
* close the current listener.
*/
if
(
!
myaddr
)
ic_proxy_server_peer_listener_reinit
(
loop
);
foreach
(
cell
,
ic_proxy_removed_addrs
)
{
ICProxyAddr
*
addr
=
lfirst
(
cell
);
ICProxyPeer
*
peer
;
/*
* Also take the chance to check the peer listener.
*
* If myaddr appears in the removed list, then the address must have
* been changed or removed, no need to compare the sockaddrs again.
*/
if
(
myaddr
&&
myaddr
->
dbid
==
addr
->
dbid
)
ic_proxy_server_peer_listener_reinit
(
loop
);
/*
* Refer to ic_proxy_server_ensure_peers() on why we need below checks.
*/
if
(
addr
->
content
>=
GpIdentity
.
segindex
)
continue
;
if
(
addr
->
dbid
==
GpIdentity
.
dbid
)
continue
;
/* do not connect to my primary / mirror */
peer
=
ic_proxy_peer_lookup
(
addr
->
content
,
addr
->
dbid
);
if
(
!
peer
)
continue
;
ic_proxy_peer_disconnect
(
peer
);
}
}
/*
* Timer handler.
*
...
...
@@ -478,7 +383,6 @@ ic_proxy_server_on_signal(uv_signal_t *handle, int signum)
ProcessConfigFile
(
PGC_SIGHUP
);
ic_proxy_reload_addresses
(
handle
->
loop
);
ic_proxy_server_drop_legacy_peers
(
handle
->
loop
);
ic_proxy_server_peer_listener_init
(
handle
->
loop
);
ic_proxy_server_ensure_peers
(
handle
->
loop
);
...
...
@@ -530,7 +434,6 @@ ic_proxy_server_main(void)
ic_proxy_client_table_init
();
ic_proxy_peer_listening
=
false
;
ic_proxy_peer_relistening
=
false
;
ic_proxy_client_listening
=
false
;
uv_signal_init
(
&
ic_proxy_server_loop
,
&
ic_proxy_server_signal_hup
);
...
...
@@ -607,9 +510,6 @@ ic_proxy_server_quit(uv_loop_t *loop, bool relaunch)
*/
if
(
ic_proxy_peer_listening
)
{
/* cancel pending relistening request */
ic_proxy_peer_relistening
=
false
;
uv_unref
((
uv_handle_t
*
)
&
ic_proxy_peer_listener
);
uv_close
((
uv_handle_t
*
)
&
ic_proxy_peer_listener
,
NULL
);
}
...
...
src/backend/cdb/motion/ic_proxy_peer.c
浏览文件 @
7f558913
...
...
@@ -813,27 +813,6 @@ ic_proxy_peer_connect(ICProxyPeer *peer, struct sockaddr_in *dest)
ic_proxy_peer_on_connected
);
}
/*
* Disconnect a peer.
*
* The peer can be in any state, the caller only needs to ensure not to call
* this function from a peer callback.
*/
void
ic_proxy_peer_disconnect
(
ICProxyPeer
*
peer
)
{
/* No such a peer yet */
if
(
!
peer
)
return
;
/* No connection is made or being made */
if
(
!
(
peer
->
state
&
IC_PROXY_PEER_STATE_CONNECTING
))
return
;
ic_proxy_log
(
LOG
,
"%s: disconnecting"
,
peer
->
name
);
ic_proxy_peer_shutdown
(
peer
);
}
/*
* Send a packet to a remote peer.
*/
...
...
src/backend/cdb/motion/ic_proxy_server.h
浏览文件 @
7f558913
...
...
@@ -127,7 +127,6 @@ extern ICProxyPeer *ic_proxy_peer_new(uv_loop_t *loop,
extern
void
ic_proxy_peer_free
(
ICProxyPeer
*
peer
);
extern
void
ic_proxy_peer_read_hello
(
ICProxyPeer
*
peer
);
extern
void
ic_proxy_peer_connect
(
ICProxyPeer
*
peer
,
struct
sockaddr_in
*
dest
);
extern
void
ic_proxy_peer_disconnect
(
ICProxyPeer
*
peer
);
extern
void
ic_proxy_peer_route_data
(
ICProxyPeer
*
peer
,
ICProxyPkt
*
pkt
,
ic_proxy_sent_cb
callback
,
void
*
opaque
);
extern
ICProxyPeer
*
ic_proxy_peer_lookup
(
int16
content
,
uint16
dbid
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录