Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
dc11aa28
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
dc11aa28
编写于
11月 04, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
11月 04, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4103 from taosdata/feature/wal
TD-1912
上级
cf98f82a
03d7e80d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
34 addition
and
31 deletion
+34
-31
src/os/inc/osFile.h
src/os/inc/osFile.h
+11
-7
src/os/inc/osSocket.h
src/os/inc/osSocket.h
+4
-4
src/os/src/detail/osFail.c
src/os/src/detail/osFail.c
+11
-11
src/os/src/detail/osFile.c
src/os/src/detail/osFile.c
+6
-2
src/tsdb/src/tsdbFile.c
src/tsdb/src/tsdbFile.c
+1
-3
src/tsdb/src/tsdbRWHelper.c
src/tsdb/src/tsdbRWHelper.c
+0
-2
src/util/src/tkvstore.c
src/util/src/tkvstore.c
+0
-2
src/wal/src/walWrite.c
src/wal/src/walWrite.c
+1
-0
未找到文件。
src/os/inc/osFile.h
浏览文件 @
dc11aa28
...
...
@@ -31,10 +31,14 @@ extern "C" {
} \
}
int64_t
taosRead
(
int32_t
fd
,
void
*
buf
,
int64_t
count
);
int64_t
taosWrite
(
int32_t
fd
,
void
*
buf
,
int64_t
count
);
int64_t
taosLSeek
(
int32_t
fd
,
int64_t
offset
,
int32_t
whence
);
int64_t
taosRead
Imp
(
int32_t
fd
,
void
*
buf
,
int64_t
count
);
int64_t
taosWrite
Imp
(
int32_t
fd
,
void
*
buf
,
int64_t
count
);
int64_t
taosLSeek
Imp
(
int32_t
fd
,
int64_t
offset
,
int32_t
whence
);
int32_t
taosRenameFile
(
char
*
fullPath
,
char
*
suffix
,
char
delimiter
,
char
**
dstPath
);
#define taosRead(fd, buf, count) taosReadImp(fd, buf, count)
#define taosWrite(fd, buf, count) taosWriteImp(fd, buf, count)
#define taosLSeek(fd, offset, whence) taosLSeekImp(fd, offset, whence)
#define taosClose(x) tclose(x)
// TAOS_OS_FUNC_FILE_SENDIFLE
...
...
@@ -42,12 +46,12 @@ int64_t taosSendFile(int32_t dfd, int32_t sfd, int64_t *offset, int64_t size);
int64_t
taosFSendFile
(
FILE
*
outfile
,
FILE
*
infile
,
int64_t
*
offset
,
int64_t
size
);
#ifdef TAOS_RANDOM_FILE_FAIL
void
taosSetRandomFileFailFactor
(
int
factor
);
void
taosSetRandomFileFailFactor
(
int
32_t
factor
);
void
taosSetRandomFileFailOutput
(
const
char
*
path
);
#ifdef TAOS_RANDOM_FILE_FAIL_TEST
ssize_t
taosReadFileRandomFail
(
int
fd
,
void
*
buf
,
size
_t
count
,
const
char
*
file
,
uint32_t
line
);
ssize_t
taosWriteFileRandomFail
(
int
fd
,
void
*
buf
,
size
_t
count
,
const
char
*
file
,
uint32_t
line
);
off_t
taosLSeekRandomFail
(
int
fd
,
off_t
offset
,
in
t
whence
,
const
char
*
file
,
uint32_t
line
);
int64_t
taosReadFileRandomFail
(
int32_t
fd
,
void
*
buf
,
int32
_t
count
,
const
char
*
file
,
uint32_t
line
);
int64_t
taosWriteFileRandomFail
(
int32_t
fd
,
void
*
buf
,
int32
_t
count
,
const
char
*
file
,
uint32_t
line
);
int64_t
taosLSeekRandomFail
(
int32_t
fd
,
int64_t
offset
,
int32_
t
whence
,
const
char
*
file
,
uint32_t
line
);
#undef taosRead
#undef taosWrite
#undef taosLSeek
...
...
src/os/inc/osSocket.h
浏览文件 @
dc11aa28
...
...
@@ -42,10 +42,10 @@ extern "C" {
#ifdef TAOS_RANDOM_NETWORK_FAIL
#ifdef TAOS_RANDOM_NETWORK_FAIL_TEST
ssize
_t
taosSendRandomFail
(
int32_t
sockfd
,
const
void
*
buf
,
size_t
len
,
int32_t
flags
);
ssize
_t
taosSendToRandomFail
(
int32_t
sockfd
,
const
void
*
buf
,
size_t
len
,
int32_t
flags
,
const
struct
sockaddr
*
dest_addr
,
socklen_t
addrlen
);
ssize
_t
taosReadSocketRandomFail
(
int32_t
fd
,
void
*
buf
,
size_t
count
);
ssize
_t
taosWriteSocketRandomFail
(
int32_t
fd
,
const
void
*
buf
,
size_t
count
);
int64
_t
taosSendRandomFail
(
int32_t
sockfd
,
const
void
*
buf
,
size_t
len
,
int32_t
flags
);
int64
_t
taosSendToRandomFail
(
int32_t
sockfd
,
const
void
*
buf
,
size_t
len
,
int32_t
flags
,
const
struct
sockaddr
*
dest_addr
,
socklen_t
addrlen
);
int64
_t
taosReadSocketRandomFail
(
int32_t
fd
,
void
*
buf
,
size_t
count
);
int64
_t
taosWriteSocketRandomFail
(
int32_t
fd
,
const
void
*
buf
,
size_t
count
);
#undef taosSend
#undef taosSendto
#undef taosReadSocket
...
...
src/os/src/detail/osFail.c
浏览文件 @
dc11aa28
...
...
@@ -20,7 +20,7 @@
#ifdef TAOS_RANDOM_NETWORK_FAIL
ssize
_t
taosSendRandomFail
(
int32_t
sockfd
,
const
void
*
buf
,
size_t
len
,
int32_t
flags
)
{
int64
_t
taosSendRandomFail
(
int32_t
sockfd
,
const
void
*
buf
,
size_t
len
,
int32_t
flags
)
{
if
(
rand
()
%
RANDOM_NETWORK_FAIL_FACTOR
==
0
)
{
errno
=
ECONNRESET
;
return
-
1
;
...
...
@@ -29,8 +29,8 @@ ssize_t taosSendRandomFail(int32_t sockfd, const void *buf, size_t len, int32_t
return
send
(
sockfd
,
buf
,
len
,
flags
);
}
ssize_t
taosSendToRandomFail
(
int32_t
sockfd
,
const
void
*
buf
,
size_t
len
,
int32_t
flags
,
const
struct
sockaddr
*
dest_addr
,
socklen_t
addrlen
)
{
int64_t
taosSendToRandomFail
(
int32_t
sockfd
,
const
void
*
buf
,
size_t
len
,
int32_t
flags
,
const
struct
sockaddr
*
dest_addr
,
socklen_t
addrlen
)
{
if
(
rand
()
%
RANDOM_NETWORK_FAIL_FACTOR
==
0
)
{
errno
=
ECONNRESET
;
return
-
1
;
...
...
@@ -39,7 +39,7 @@ ssize_t taosSendToRandomFail(int32_t sockfd, const void *buf, size_t len, int32_
return
sendto
(
sockfd
,
buf
,
len
,
flags
,
dest_addr
,
addrlen
);
}
ssize
_t
taosReadSocketRandomFail
(
int32_t
fd
,
void
*
buf
,
size_t
count
)
{
int64
_t
taosReadSocketRandomFail
(
int32_t
fd
,
void
*
buf
,
size_t
count
)
{
if
(
rand
()
%
RANDOM_NETWORK_FAIL_FACTOR
==
0
)
{
errno
=
ECONNRESET
;
return
-
1
;
...
...
@@ -48,7 +48,7 @@ ssize_t taosReadSocketRandomFail(int32_t fd, void *buf, size_t count) {
return
read
(
fd
,
buf
,
count
);
}
ssize
_t
taosWriteSocketRandomFail
(
int32_t
fd
,
const
void
*
buf
,
size_t
count
)
{
int64
_t
taosWriteSocketRandomFail
(
int32_t
fd
,
const
void
*
buf
,
size_t
count
)
{
if
(
rand
()
%
RANDOM_NETWORK_FAIL_FACTOR
==
0
)
{
errno
=
EINTR
;
return
-
1
;
...
...
@@ -105,7 +105,7 @@ void taosSetRandomFileFailOutput(const char *path) {
sigaction
(
SIGILL
,
&
act
,
NULL
);
}
ssize_t
taosReadFileRandomFail
(
int32_t
fd
,
void
*
buf
,
size
_t
count
,
const
char
*
file
,
uint32_t
line
)
{
int64_t
taosReadFileRandomFail
(
int32_t
fd
,
void
*
buf
,
int32
_t
count
,
const
char
*
file
,
uint32_t
line
)
{
if
(
random_file_fail_factor
>
0
)
{
if
(
rand
()
%
random_file_fail_factor
==
0
)
{
errno
=
EIO
;
...
...
@@ -113,10 +113,10 @@ ssize_t taosReadFileRandomFail(int32_t fd, void *buf, size_t count, const char *
}
}
return
taosRead
(
fd
,
buf
,
count
);
return
taosRead
Imp
(
fd
,
buf
,
count
);
}
ssize_t
taosWriteFileRandomFail
(
int32_t
fd
,
void
*
buf
,
size
_t
count
,
const
char
*
file
,
uint32_t
line
)
{
int64_t
taosWriteFileRandomFail
(
int32_t
fd
,
void
*
buf
,
int32
_t
count
,
const
char
*
file
,
uint32_t
line
)
{
if
(
random_file_fail_factor
>
0
)
{
if
(
rand
()
%
random_file_fail_factor
==
0
)
{
errno
=
EIO
;
...
...
@@ -124,10 +124,10 @@ ssize_t taosWriteFileRandomFail(int32_t fd, void *buf, size_t count, const char
}
}
return
taosWrite
(
fd
,
buf
,
count
);
return
taosWrite
Imp
(
fd
,
buf
,
count
);
}
off_t
taosLSeekRandomFail
(
int32_t
fd
,
off
_t
offset
,
int32_t
whence
,
const
char
*
file
,
uint32_t
line
)
{
int64_t
taosLSeekRandomFail
(
int32_t
fd
,
int64
_t
offset
,
int32_t
whence
,
const
char
*
file
,
uint32_t
line
)
{
if
(
random_file_fail_factor
>
0
)
{
if
(
rand
()
%
random_file_fail_factor
==
0
)
{
errno
=
EIO
;
...
...
@@ -135,7 +135,7 @@ off_t taosLSeekRandomFail(int32_t fd, off_t offset, int32_t whence, const char *
}
}
return
taosLSeek
(
fd
,
offset
,
whence
);
return
taosLSeek
Imp
(
fd
,
offset
,
whence
);
}
#endif //TAOS_RANDOM_FILE_FAIL
src/os/src/detail/osFile.c
浏览文件 @
dc11aa28
...
...
@@ -71,7 +71,7 @@ int32_t taosRenameFile(char *fullPath, char *suffix, char delimiter, char **dstP
return
rename
(
fullPath
,
*
dstPath
);
}
int64_t
taosRead
(
int32_t
fd
,
void
*
buf
,
int64_t
count
)
{
int64_t
taosRead
Imp
(
int32_t
fd
,
void
*
buf
,
int64_t
count
)
{
int64_t
leftbytes
=
count
;
int64_t
readbytes
;
char
*
tbuf
=
(
char
*
)
buf
;
...
...
@@ -95,7 +95,7 @@ int64_t taosRead(int32_t fd, void *buf, int64_t count) {
return
count
;
}
int64_t
taosWrite
(
int32_t
fd
,
void
*
buf
,
int64_t
n
)
{
int64_t
taosWrite
Imp
(
int32_t
fd
,
void
*
buf
,
int64_t
n
)
{
int64_t
nleft
=
n
;
int64_t
nwritten
=
0
;
char
*
tbuf
=
(
char
*
)
buf
;
...
...
@@ -115,6 +115,10 @@ int64_t taosWrite(int32_t fd, void *buf, int64_t n) {
return
n
;
}
int64_t
taosLSeekImp
(
int32_t
fd
,
int64_t
offset
,
int32_t
whence
)
{
return
(
int64_t
)
tlseek
(
fd
,
(
long
)
offset
,
whence
);
}
#ifndef TAOS_OS_FUNC_FILE_SENDIFLE
int64_t
taosSendFile
(
int32_t
dfd
,
int32_t
sfd
,
int64_t
*
offset
,
int64_t
size
)
{
...
...
src/tsdb/src/tsdbFile.c
浏览文件 @
dc11aa28
...
...
@@ -13,10 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include <regex.h>
#define TAOS_RANDOM_FILE_FAIL_TEST
#include <regex.h>
#include "os.h"
#include "talgo.h"
#include "tchecksum.h"
...
...
src/tsdb/src/tsdbRWHelper.c
浏览文件 @
dc11aa28
...
...
@@ -14,9 +14,7 @@
*/
#define _DEFAULT_SOURCE
#define TAOS_RANDOM_FILE_FAIL_TEST
#include "os.h"
#include "talgo.h"
#include "tchecksum.h"
...
...
src/util/src/tkvstore.c
浏览文件 @
dc11aa28
...
...
@@ -14,9 +14,7 @@
*/
#define _DEFAULT_SOURCE
#define TAOS_RANDOM_FILE_FAIL_TEST
#include "os.h"
#include "hash.h"
#include "taoserror.h"
...
...
src/wal/src/walWrite.c
浏览文件 @
dc11aa28
...
...
@@ -14,6 +14,7 @@
*/
#define _DEFAULT_SOURCE
#define TAOS_RANDOM_FILE_FAIL_TEST
#include "os.h"
#include "taoserror.h"
#include "tchecksum.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录