Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Turbo码先生
redis
提交
caf7c504
R
redis
项目概览
Turbo码先生
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
caf7c504
编写于
5月 26, 2020
作者:
S
Salvatore Sanfilippo
提交者:
GitHub
5月 26, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7328 from oranagra/daily_tls_test
avoid using sendfile if tls-replication is enabled
上级
091fb646
1965c009
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
27 deletion
+49
-27
.github/workflows/daily.yml
.github/workflows/daily.yml
+15
-0
src/replication.c
src/replication.c
+34
-27
未找到文件。
.github/workflows/daily.yml
浏览文件 @
caf7c504
...
@@ -49,6 +49,21 @@ jobs:
...
@@ -49,6 +49,21 @@ jobs:
-
name
:
module api test
-
name
:
module api test
run
:
./runtest-moduleapi --verbose
run
:
./runtest-moduleapi --verbose
test-tls
:
runs-on
:
ubuntu-latest
steps
:
-
uses
:
actions/checkout@v1
-
name
:
make
run
:
|
make BUILD_TLS=yes
-
name
:
test
run
:
|
sudo apt-get install tcl8.5 tcl-tls
./utils/gen-test-certs.sh
./runtest --accurate --verbose --tls
-
name
:
module api test
run
:
./runtest-moduleapi --verbose --tls
test-valgrind
:
test-valgrind
:
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
timeout-minutes
:
14400
timeout-minutes
:
14400
...
...
src/replication.c
浏览文件 @
caf7c504
...
@@ -1032,39 +1032,46 @@ void sendBulkToSlave(connection *conn) {
...
@@ -1032,39 +1032,46 @@ void sendBulkToSlave(connection *conn) {
}
}
}
}
/* If the preamble was already transferred, send the RDB bulk data. */
/* If the preamble was already transferred, send the RDB bulk data.
* try to use sendfile system call if supported, unless tls is enabled.
* fallback to normal read+write otherwise. */
nwritten
=
0
;
#if HAVE_SENDFILE
#if HAVE_SENDFILE
if
((
nwritten
=
redis_sendfile
(
conn
->
fd
,
slave
->
repldbfd
,
if
(
!
server
.
tls_replication
)
{
slave
->
repldboff
,
PROTO_IOBUF_LEN
))
==
-
1
)
if
((
nwritten
=
redis_sendfile
(
conn
->
fd
,
slave
->
repldbfd
,
{
slave
->
repldboff
,
PROTO_IOBUF_LEN
))
==
-
1
)
if
(
errno
!=
EAGAIN
)
{
{
serverLog
(
LL_WARNING
,
"Sendfile error sending DB to replica: %s"
,
if
(
errno
!=
EAGAIN
)
{
strerror
(
errno
));
serverLog
(
LL_WARNING
,
"Sendfile error sending DB to replica: %s"
,
freeClient
(
slave
);
strerror
(
errno
));
freeClient
(
slave
);
}
return
;
}
}
return
;
}
}
#else
#endif
ssize_t
buflen
;
if
(
!
nwritten
)
{
char
buf
[
PROTO_IOBUF_LEN
];
ssize_t
buflen
;
char
buf
[
PROTO_IOBUF_LEN
];
lseek
(
slave
->
repldbfd
,
slave
->
repldboff
,
SEEK_SET
);
buflen
=
read
(
slave
->
repldbfd
,
buf
,
PROTO_IOBUF_LEN
);
lseek
(
slave
->
repldbfd
,
slave
->
repldboff
,
SEEK_SET
);
if
(
buflen
<=
0
)
{
buflen
=
read
(
slave
->
repldbfd
,
buf
,
PROTO_IOBUF_LEN
);
serverLog
(
LL_WARNING
,
"Read error sending DB to replica: %s"
,
if
(
buflen
<=
0
)
{
(
buflen
==
0
)
?
"premature EOF"
:
strerror
(
errno
));
serverLog
(
LL_WARNING
,
"Read error sending DB to replica: %s"
,
freeClient
(
slave
);
(
buflen
==
0
)
?
"premature EOF"
:
strerror
(
errno
));
return
;
}
if
((
nwritten
=
connWrite
(
conn
,
buf
,
buflen
))
==
-
1
)
{
if
(
connGetState
(
conn
)
!=
CONN_STATE_CONNECTED
)
{
serverLog
(
LL_WARNING
,
"Write error sending DB to replica: %s"
,
connGetLastError
(
conn
));
freeClient
(
slave
);
freeClient
(
slave
);
return
;
}
if
((
nwritten
=
connWrite
(
conn
,
buf
,
buflen
))
==
-
1
)
{
if
(
connGetState
(
conn
)
!=
CONN_STATE_CONNECTED
)
{
serverLog
(
LL_WARNING
,
"Write error sending DB to replica: %s"
,
connGetLastError
(
conn
));
freeClient
(
slave
);
}
return
;
}
}
return
;
}
}
#endif
slave
->
repldboff
+=
nwritten
;
slave
->
repldboff
+=
nwritten
;
server
.
stat_net_output_bytes
+=
nwritten
;
server
.
stat_net_output_bytes
+=
nwritten
;
if
(
slave
->
repldboff
==
slave
->
repldbsize
)
{
if
(
slave
->
repldboff
==
slave
->
repldbsize
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录