Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9f45a66a
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9f45a66a
编写于
6月 23, 2020
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into regressionupdate
上级
cbe722d9
4ac333b3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
38 addition
and
27 deletion
+38
-27
src/common/src/tglobal.c
src/common/src/tglobal.c
+1
-3
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+5
-0
src/util/inc/tutil.h
src/util/inc/tutil.h
+1
-0
src/util/src/tutil.c
src/util/src/tutil.c
+6
-0
src/wal/src/walMain.c
src/wal/src/walMain.c
+24
-22
tests/pytest/alter/alter_table_crash.py
tests/pytest/alter/alter_table_crash.py
+1
-2
未找到文件。
src/common/src/tglobal.c
浏览文件 @
9f45a66a
...
...
@@ -1183,9 +1183,7 @@ bool taosCheckGlobalCfg() {
taosGetFqdn
(
tsLocalFqdn
);
}
strcpy
(
tsLocalEp
,
tsLocalFqdn
);
snprintf
(
tsLocalEp
+
strlen
(
tsLocalEp
),
sizeof
(
tsLocalEp
),
":%d"
,
tsServerPort
);
snprintf
(
tsLocalEp
,
sizeof
(
tsLocalEp
),
"%s:%d"
,
tsLocalFqdn
,
tsServerPort
);
uPrint
(
"localEp is: %s"
,
tsLocalEp
);
if
(
tsFirst
[
0
]
==
0
)
{
...
...
src/rpc/src/rpcMain.c
浏览文件 @
9f45a66a
...
...
@@ -434,6 +434,7 @@ void rpcSendResponse(const SRpcMsg *pRsp) {
pConn
->
rspMsgLen
=
msgLen
;
if
(
pMsg
->
code
==
TSDB_CODE_RPC_ACTION_IN_PROGRESS
)
pConn
->
inTranId
--
;
// stop the progress timer
taosTmrStopA
(
&
pConn
->
pTimer
);
// set the idle timer to monitor the activity
...
...
@@ -1021,7 +1022,11 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
if
(
rpcIsReq
(
pHead
->
msgType
)
)
{
rpcMsg
.
handle
=
pConn
;
rpcAddRef
(
pRpc
);
// add the refCount for requests
// start the progress timer to monitor the response from server app
pConn
->
pTimer
=
taosTmrStart
(
rpcProcessProgressTimer
,
tsProgressTimer
,
pConn
,
pRpc
->
tmrCtrl
);
// notify the server app
(
*
(
pRpc
->
cfp
))(
&
rpcMsg
,
NULL
);
}
else
{
// it's a response
...
...
src/util/inc/tutil.h
浏览文件 @
9f45a66a
...
...
@@ -183,6 +183,7 @@ char *taosIpStr(uint32_t ipInt);
uint32_t
ip2uint
(
const
char
*
const
ip_addr
);
void
taosRemoveDir
(
char
*
rootDir
);
int
tmkdir
(
const
char
*
pathname
,
mode_t
mode
);
#define TAOS_ALLOC_MODE_DEFAULT 0
#define TAOS_ALLOC_MODE_RANDOM_FAIL 1
...
...
src/util/src/tutil.c
浏览文件 @
9f45a66a
...
...
@@ -793,3 +793,9 @@ void taosRemoveDir(char *rootDir) {
uPrint
(
"dir:%s is removed"
,
rootDir
);
}
int
tmkdir
(
const
char
*
path
,
mode_t
mode
)
{
int
code
=
mkdir
(
path
,
0755
);
if
(
code
<
0
&&
errno
==
EEXIST
)
code
=
0
;
return
code
;
}
src/wal/src/walMain.c
浏览文件 @
9f45a66a
...
...
@@ -71,14 +71,12 @@ void *walOpen(const char *path, const SWalCfg *pCfg) {
tstrncpy
(
pWal
->
path
,
path
,
sizeof
(
pWal
->
path
));
pthread_mutex_init
(
&
pWal
->
mutex
,
NULL
);
if
(
access
(
path
,
F_OK
)
!=
0
)
{
if
(
mkdir
(
path
,
0755
)
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
wError
(
"wal:%s, failed to create directory(%s)"
,
path
,
strerror
(
errno
));
pthread_mutex_destroy
(
&
pWal
->
mutex
);
free
(
pWal
);
pWal
=
NULL
;
}
if
(
tmkdir
(
path
,
0755
)
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
wError
(
"wal:%s, failed to create directory(%s)"
,
path
,
strerror
(
errno
));
pthread_mutex_destroy
(
&
pWal
->
mutex
);
free
(
pWal
);
pWal
=
NULL
;
}
if
(
pCfg
->
keep
==
1
)
return
pWal
;
...
...
@@ -86,16 +84,15 @@ void *walOpen(const char *path, const SWalCfg *pCfg) {
if
(
walHandleExistingFiles
(
path
)
==
0
)
walRenew
(
pWal
);
if
(
pWal
->
fd
<
0
)
{
if
(
pWal
&&
pWal
->
fd
<
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
wError
(
"wal:%s, failed to open(%s)"
,
path
,
strerror
(
errno
));
pthread_mutex_destroy
(
&
pWal
->
mutex
);
free
(
pWal
);
pWal
=
NULL
;
}
else
{
wTrace
(
"wal:%s, it is open, level:%d"
,
path
,
pWal
->
level
);
}
}
if
(
pWal
)
wTrace
(
"wal:%s, it is open, level:%d"
,
path
,
pWal
->
level
);
return
pWal
;
}
...
...
@@ -218,10 +215,13 @@ int walRestore(void *handle, void *pVnode, int (*writeFp)(void *, void *, int))
if
(
pWal
->
keep
==
0
)
strcpy
(
opath
+
slen
,
"/old"
);
// is there old directory?
if
(
access
(
opath
,
F_OK
))
return
0
;
DIR
*
dir
=
opendir
(
opath
);
if
(
dir
==
NULL
&&
errno
==
ENOENT
)
return
0
;
if
(
dir
==
NULL
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
return
terrno
;
}
while
((
ent
=
readdir
(
dir
))
!=
NULL
)
{
if
(
strncmp
(
ent
->
d_name
,
walPrefix
,
plen
)
==
0
)
{
index
=
atol
(
ent
->
d_name
+
plen
);
...
...
@@ -379,12 +379,10 @@ int walHandleExistingFiles(const char *path) {
if
(
strncmp
(
ent
->
d_name
,
walPrefix
,
plen
)
==
0
)
{
snprintf
(
oname
,
sizeof
(
oname
),
"%s/%s"
,
path
,
ent
->
d_name
);
snprintf
(
nname
,
sizeof
(
nname
),
"%s/old/%s"
,
path
,
ent
->
d_name
);
if
(
access
(
opath
,
F_OK
)
!=
0
)
{
if
(
mkdir
(
opath
,
0755
)
!=
0
)
{
wError
(
"wal:%s, failed to create directory:%s(%s)"
,
oname
,
opath
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
break
;
}
if
(
tmkdir
(
opath
,
0755
)
!=
0
)
{
wError
(
"wal:%s, failed to create directory:%s(%s)"
,
oname
,
opath
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
break
;
}
if
(
rename
(
oname
,
nname
)
<
0
)
{
...
...
@@ -409,10 +407,14 @@ static int walRemoveWalFiles(const char *path) {
char
name
[
TSDB_FILENAME_LEN
*
3
];
terrno
=
0
;
if
(
access
(
path
,
F_OK
)
!=
0
)
return
0
;
struct
dirent
*
ent
;
DIR
*
dir
=
opendir
(
path
);
if
(
dir
==
NULL
&&
errno
==
ENOENT
)
return
0
;
if
(
dir
==
NULL
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
return
terrno
;
}
while
((
ent
=
readdir
(
dir
))
!=
NULL
)
{
if
(
strncmp
(
ent
->
d_name
,
walPrefix
,
plen
)
==
0
)
{
...
...
tests/pytest/alter/alter_table_crash.py
浏览文件 @
9f45a66a
...
...
@@ -47,7 +47,6 @@ class TDTestCase:
tdSql
.
query
(
"select * from st"
)
tdSql
.
checkRows
(
1
)
print
(
"==============Case 2: keep adding columns, restart taosd"
)
tdSql
.
execute
(
"create table dt(ts timestamp, tbcol1 tinyint) tags(tgcol1 tinyint)"
)
...
...
@@ -76,7 +75,7 @@ class TDTestCase:
tdSql
.
checkRows
(
0
)
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录