Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6e1da95b
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
6e1da95b
编写于
1月 06, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2640
上级
899f9089
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
6 deletion
+27
-6
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+4
-1
src/sync/src/syncRestore.c
src/sync/src/syncRestore.c
+5
-1
src/vnode/inc/vnodeStatus.h
src/vnode/inc/vnodeStatus.h
+1
-0
src/vnode/src/vnodeStatus.c
src/vnode/src/vnodeStatus.c
+12
-0
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+5
-4
未找到文件。
src/mnode/src/mnodeSdb.c
浏览文件 @
6e1da95b
...
@@ -1051,7 +1051,10 @@ static int32_t sdbWriteFwdToQueue(int32_t vgId, void *wparam, int32_t qtype, voi
...
@@ -1051,7 +1051,10 @@ static int32_t sdbWriteFwdToQueue(int32_t vgId, void *wparam, int32_t qtype, voi
memcpy
(
pRow
->
pHead
,
pHead
,
sizeof
(
SWalHead
)
+
pHead
->
len
);
memcpy
(
pRow
->
pHead
,
pHead
,
sizeof
(
SWalHead
)
+
pHead
->
len
);
pRow
->
rowData
=
pRow
->
pHead
->
cont
;
pRow
->
rowData
=
pRow
->
pHead
->
cont
;
return
sdbWriteToQueue
(
pRow
,
qtype
);
int32_t
code
=
sdbWriteToQueue
(
pRow
,
qtype
);
if
(
code
==
TSDB_CODE_MND_ACTION_IN_PROGRESS
)
code
=
0
;
return
code
;
}
}
static
int32_t
sdbWriteRowToQueue
(
SSdbRow
*
pInputRow
,
int32_t
action
)
{
static
int32_t
sdbWriteRowToQueue
(
SSdbRow
*
pInputRow
,
int32_t
action
)
{
...
...
src/sync/src/syncRestore.c
浏览文件 @
6e1da95b
...
@@ -195,7 +195,11 @@ static int32_t syncRestoreWal(SSyncPeer *pPeer, uint64_t *wver) {
...
@@ -195,7 +195,11 @@ static int32_t syncRestoreWal(SSyncPeer *pPeer, uint64_t *wver) {
}
}
lastVer
=
pHead
->
version
;
lastVer
=
pHead
->
version
;
(
*
pNode
->
writeToCache
)(
pNode
->
vgId
,
pHead
,
TAOS_QTYPE_WAL
,
NULL
);
ret
=
(
*
pNode
->
writeToCache
)(
pNode
->
vgId
,
pHead
,
TAOS_QTYPE_WAL
,
NULL
);
if
(
ret
!=
0
)
{
sError
(
"%s, failed to restore record since %s, hver:%"
PRIu64
,
pPeer
->
id
,
tstrerror
(
ret
),
pHead
->
version
);
break
;
}
}
}
if
(
code
<
0
)
{
if
(
code
<
0
)
{
...
...
src/vnode/inc/vnodeStatus.h
浏览文件 @
6e1da95b
...
@@ -37,6 +37,7 @@ bool vnodeSetResetStatus(SVnodeObj* pVnode);
...
@@ -37,6 +37,7 @@ bool vnodeSetResetStatus(SVnodeObj* pVnode);
bool
vnodeInInitStatus
(
SVnodeObj
*
pVnode
);
bool
vnodeInInitStatus
(
SVnodeObj
*
pVnode
);
bool
vnodeInReadyStatus
(
SVnodeObj
*
pVnode
);
bool
vnodeInReadyStatus
(
SVnodeObj
*
pVnode
);
bool
vnodeInReadyOrUpdatingStatus
(
SVnodeObj
*
pVnode
);
bool
vnodeInClosingStatus
(
SVnodeObj
*
pVnode
);
bool
vnodeInClosingStatus
(
SVnodeObj
*
pVnode
);
bool
vnodeInResetStatus
(
SVnodeObj
*
pVnode
);
bool
vnodeInResetStatus
(
SVnodeObj
*
pVnode
);
...
...
src/vnode/src/vnodeStatus.c
浏览文件 @
6e1da95b
...
@@ -135,6 +135,18 @@ bool vnodeInReadyStatus(SVnodeObj* pVnode) {
...
@@ -135,6 +135,18 @@ bool vnodeInReadyStatus(SVnodeObj* pVnode) {
return
in
;
return
in
;
}
}
bool
vnodeInReadyOrUpdatingStatus
(
SVnodeObj
*
pVnode
)
{
bool
in
=
false
;
pthread_mutex_lock
(
&
pVnode
->
statusMutex
);
if
(
pVnode
->
status
==
TAOS_VN_STATUS_READY
||
pVnode
->
status
==
TAOS_VN_STATUS_UPDATING
)
{
in
=
true
;
}
pthread_mutex_unlock
(
&
pVnode
->
statusMutex
);
return
in
;
}
bool
vnodeInClosingStatus
(
SVnodeObj
*
pVnode
)
{
bool
vnodeInClosingStatus
(
SVnodeObj
*
pVnode
)
{
bool
in
=
false
;
bool
in
=
false
;
pthread_mutex_lock
(
&
pVnode
->
statusMutex
);
pthread_mutex_lock
(
&
pVnode
->
statusMutex
);
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
6e1da95b
...
@@ -242,17 +242,18 @@ static int32_t vnodeWriteToWQueueImp(SVWriteMsg *pWrite) {
...
@@ -242,17 +242,18 @@ static int32_t vnodeWriteToWQueueImp(SVWriteMsg *pWrite) {
if
(
pWrite
->
qtype
==
TAOS_QTYPE_RPC
)
{
if
(
pWrite
->
qtype
==
TAOS_QTYPE_RPC
)
{
int32_t
code
=
vnodeCheckWrite
(
pVnode
);
int32_t
code
=
vnodeCheckWrite
(
pVnode
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
vError
(
"vgId:%d, failed to write into vwqueue since %s"
,
pVnode
->
vgId
,
tstrerror
(
code
));
taosFreeQitem
(
pWrite
);
taosFreeQitem
(
pWrite
);
vnodeRelease
(
pVnode
);
vnodeRelease
(
pVnode
);
return
code
;
return
code
;
}
}
}
}
if
(
!
vnodeInReadyStatus
(
pVnode
))
{
if
(
!
vnodeInReady
OrUpdating
Status
(
pVnode
))
{
v
Debug
(
"vgId:%d, vnode status is %s, refCount:%d pVnode:%p"
,
pVnode
->
vgId
,
vnodeStatus
[
pVnode
->
status
]
,
v
Error
(
"vgId:%d, failed to write into vwqueue, vstatus is %s, refCount:%d pVnode:%p"
,
pVnode
->
vgId
,
pVnode
->
refCount
,
pVnode
);
vnodeStatus
[
pVnode
->
status
],
pVnode
->
refCount
,
pVnode
);
taosFreeQitem
(
pWrite
);
taosFreeQitem
(
pWrite
);
vnodeRelease
(
pVnode
);
vnodeRelease
(
pVnode
);
return
TSDB_CODE_APP_NOT_READY
;
return
TSDB_CODE_APP_NOT_READY
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录