Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
04832fde
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
04832fde
编写于
11月 17, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
11月 17, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4260 from taosdata/feature/wal
[TD-2051]<fix>: taosd will crash if there a hostame not exist #4249
上级
3ff617af
33012d3d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
24 addition
and
8 deletion
+24
-8
src/inc/taoserror.h
src/inc/taoserror.h
+1
-1
src/sync/inc/syncInt.h
src/sync/inc/syncInt.h
+1
-0
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+12
-1
src/sync/src/syncRestore.c
src/sync/src/syncRestore.c
+2
-2
src/util/src/tsocket.c
src/util/src/tsocket.c
+3
-3
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+5
-1
未找到文件。
src/inc/taoserror.h
浏览文件 @
04832fde
...
...
@@ -201,7 +201,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_VND_NO_SUCH_FILE_OR_DIR, 0, 0x0507, "Missing da
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_OUT_OF_MEMORY
,
0
,
0x0508
,
"Out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_APP_ERROR
,
0
,
0x0509
,
"Unexpected generic error in vnode"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_INVALID_VRESION_FILE
,
0
,
0x050A
,
"Invalid version file"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_IS_FULL
,
0
,
0x050B
,
"Vnode memory is full
for commit is
failed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_IS_FULL
,
0
,
0x050B
,
"Vnode memory is full
because commit
failed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NOT_SYNCED
,
0
,
0x0511
,
"Database suspended"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VND_NO_WRITE_AUTH
,
0
,
0x0512
,
"Write operation denied"
)
...
...
src/sync/inc/syncInt.h
浏览文件 @
04832fde
...
...
@@ -36,6 +36,7 @@ extern "C" {
#define TAOS_SMSG_STATUS 7
#define SYNC_MAX_SIZE (TSDB_MAX_WAL_SIZE + sizeof(SWalHead) + sizeof(SSyncHead) + 16)
#define SYNC_RECV_BUFFER_SIZE (5*1024*1024)
#define nodeRole pNode->peerInfo[pNode->selfIndex]->role
#define nodeVersion pNode->peerInfo[pNode->selfIndex]->version
...
...
src/sync/src/syncMain.c
浏览文件 @
04832fde
...
...
@@ -179,6 +179,13 @@ int64_t syncStart(const SSyncInfo *pInfo) {
for
(
int32_t
i
=
0
;
i
<
pCfg
->
replica
;
++
i
)
{
const
SNodeInfo
*
pNodeInfo
=
pCfg
->
nodeInfo
+
i
;
pNode
->
peerInfo
[
i
]
=
syncAddPeer
(
pNode
,
pNodeInfo
);
if
(
pNode
->
peerInfo
[
i
]
==
NULL
)
{
sError
(
"vgId:%d, node:%d fqdn:%s port:%u is not configured, stop taosd"
,
pNode
->
vgId
,
pNodeInfo
->
nodeId
,
pNodeInfo
->
nodeFqdn
,
pNodeInfo
->
nodePort
);
syncStop
(
pNode
->
rid
);
exit
(
1
);
}
if
((
strcmp
(
pNodeInfo
->
nodeFqdn
,
tsNodeFqdn
)
==
0
)
&&
(
pNodeInfo
->
nodePort
==
tsSyncPort
))
{
pNode
->
selfIndex
=
i
;
}
...
...
@@ -476,7 +483,11 @@ static void syncRemovePeer(SSyncPeer *pPeer) {
static
SSyncPeer
*
syncAddPeer
(
SSyncNode
*
pNode
,
const
SNodeInfo
*
pInfo
)
{
uint32_t
ip
=
taosGetIpFromFqdn
(
pInfo
->
nodeFqdn
);
if
(
ip
==
-
1
)
return
NULL
;
if
(
ip
==
0xFFFFFFFF
)
{
sError
(
"failed to add peer, can resolve fqdn:%s since %s"
,
pInfo
->
nodeFqdn
,
strerror
(
errno
));
terrno
=
TSDB_CODE_RPC_FQDN_ERROR
;
return
NULL
;
}
SSyncPeer
*
pPeer
=
calloc
(
1
,
sizeof
(
SSyncPeer
));
if
(
pPeer
==
NULL
)
return
NULL
;
...
...
src/sync/src/syncRestore.c
浏览文件 @
04832fde
...
...
@@ -136,7 +136,7 @@ static int32_t syncRestoreWal(SSyncPeer *pPeer) {
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
int32_t
ret
,
code
=
-
1
;
void
*
buffer
=
calloc
(
1024000
,
1
);
// size for one record
void
*
buffer
=
calloc
(
SYNC_MAX_SIZE
,
1
);
// size for one record
if
(
buffer
==
NULL
)
return
-
1
;
SWalHead
*
pHead
=
(
SWalHead
*
)
buffer
;
...
...
@@ -237,7 +237,7 @@ static int32_t syncOpenRecvBuffer(SSyncNode *pNode) {
SRecvBuffer
*
pRecv
=
calloc
(
sizeof
(
SRecvBuffer
),
1
);
if
(
pRecv
==
NULL
)
return
-
1
;
pRecv
->
bufferSize
=
5000000
;
pRecv
->
bufferSize
=
SYNC_RECV_BUFFER_SIZE
;
pRecv
->
buffer
=
malloc
(
pRecv
->
bufferSize
);
if
(
pRecv
->
buffer
==
NULL
)
{
free
(
pRecv
);
...
...
src/util/src/tsocket.c
浏览文件 @
04832fde
...
...
@@ -58,13 +58,13 @@ uint32_t taosGetIpFromFqdn(const char *fqdn) {
}
else
{
#ifdef EAI_SYSTEM
if
(
ret
==
EAI_SYSTEM
)
{
uError
(
"failed to get the ip address, fqdn:%s,
code:%d, reason:%s"
,
fqdn
,
ret
,
strerror
(
errno
));
uError
(
"failed to get the ip address, fqdn:%s,
since:%s"
,
fqdn
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
}
else
{
uError
(
"failed to get the ip address, fqdn:%s,
code:%d, reason:%s"
,
fqdn
,
ret
,
gai_strerror
(
ret
));
uError
(
"failed to get the ip address, fqdn:%s,
since:%s"
,
fqdn
,
gai_strerror
(
ret
));
}
#else
uError
(
"failed to get the ip address, fqdn:%s,
code:%d, reason:%s"
,
fqdn
,
ret
,
gai_strerror
(
ret
));
uError
(
"failed to get the ip address, fqdn:%s,
since:%s"
,
fqdn
,
gai_strerror
(
ret
));
#endif
return
0xFFFFFFFF
;
}
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
04832fde
...
...
@@ -419,7 +419,11 @@ void vnodeRelease(void *pVnodeRaw) {
}
if
(
pVnode
->
wal
)
{
if
(
code
==
0
)
walRemoveAllOldFiles
(
pVnode
->
wal
);
if
(
code
!=
0
)
{
vError
(
"vgId:%d, failed to commit while close tsdb repo, keep wal"
,
pVnode
->
vgId
);
}
else
{
walRemoveAllOldFiles
(
pVnode
->
wal
);
}
walClose
(
pVnode
->
wal
);
pVnode
->
wal
=
NULL
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录