Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bf85790e
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看板
未验证
提交
bf85790e
编写于
12月 09, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
12月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18830 from taosdata/fix/td-21076
Fix: vnode snapshot problem
上级
bff80478
291750b9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
9 deletion
+26
-9
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
+21
-7
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+1
-1
source/libs/sync/src/syncSnapshot.c
source/libs/sync/src/syncSnapshot.c
+4
-1
未找到文件。
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
浏览文件 @
bf85790e
...
...
@@ -155,7 +155,7 @@ static int32_t tsdbSnapReadOpenFile(STsdbSnapReader* pReader) {
if
(
rowVer
>=
pReader
->
sver
&&
rowVer
<=
pReader
->
ever
)
{
pIter
->
rInfo
.
suid
=
pIter
->
bData
.
suid
;
pIter
->
rInfo
.
uid
=
pIter
->
bData
.
uid
;
pIter
->
rInfo
.
uid
=
pIter
->
bData
.
uid
?
pIter
->
bData
.
uid
:
pIter
->
bData
.
aUid
[
pIter
->
iRow
]
;
pIter
->
rInfo
.
row
=
tsdbRowFromBlockData
(
&
pIter
->
bData
,
pIter
->
iRow
);
goto
_add_iter
;
}
...
...
@@ -179,16 +179,14 @@ _err:
return
code
;
}
static
SRowInfo
*
tsdbSnapGetRow
(
STsdbSnapReader
*
pReader
)
{
return
pReader
->
pIter
?
&
pReader
->
pIter
->
rInfo
:
NULL
;
}
static
int32_t
tsdbSnapNextRow
(
STsdbSnapReader
*
pReader
)
{
int32_t
code
=
0
;
if
(
pReader
->
pIter
)
{
SFDataIter
*
pIter
=
pReader
->
pIter
;
SFDataIter
*
pIter
=
NULL
;
while
(
true
)
{
_find_row:
pIter
=
pReader
->
pIter
;
for
(
pIter
->
iRow
++
;
pIter
->
iRow
<
pIter
->
bData
.
nRow
;
pIter
->
iRow
++
)
{
int64_t
rowVer
=
pIter
->
bData
.
aVersion
[
pIter
->
iRow
];
...
...
@@ -224,6 +222,7 @@ static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) {
}
pReader
->
pIter
=
NULL
;
break
;
}
else
if
(
pIter
->
type
==
SNAP_STT_FILE_ITER
)
{
for
(
pIter
->
iSttBlk
++
;
pIter
->
iSttBlk
<
taosArrayGetSize
(
pIter
->
aSttBlk
);
pIter
->
iSttBlk
++
)
{
SSttBlk
*
pSttBlk
=
(
SSttBlk
*
)
taosArrayGet
(
pIter
->
aSttBlk
,
pIter
->
iSttBlk
);
...
...
@@ -238,6 +237,7 @@ static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) {
}
pReader
->
pIter
=
NULL
;
break
;
}
else
{
ASSERT
(
0
);
}
...
...
@@ -269,6 +269,20 @@ _err:
return
code
;
}
static
SRowInfo
*
tsdbSnapGetRow
(
STsdbSnapReader
*
pReader
)
{
if
(
pReader
->
pIter
)
{
return
&
pReader
->
pIter
->
rInfo
;
}
else
{
tsdbSnapNextRow
(
pReader
);
if
(
pReader
->
pIter
)
{
return
&
pReader
->
pIter
->
rInfo
;
}
else
{
return
NULL
;
}
}
}
static
int32_t
tsdbSnapCmprData
(
STsdbSnapReader
*
pReader
,
uint8_t
**
ppData
)
{
int32_t
code
=
0
;
...
...
@@ -1356,7 +1370,7 @@ _exit:
taosMemoryFree
(
pWriter
);
}
}
else
{
tsdb
Debug
(
"vgId:%d, tsdb snapshot writer open for %s succeed"
,
TD_VID
(
pTsdb
->
pVnode
),
pTsdb
->
path
);
tsdb
Info
(
"vgId:%d %s done"
,
TD_VID
(
pTsdb
->
pVnode
),
__func__
);
*
ppWriter
=
pWriter
;
}
return
code
;
...
...
@@ -1421,7 +1435,7 @@ int32_t tsdbSnapWriterClose(STsdbSnapWriter** ppWriter, int8_t rollback) {
for
(
int32_t
iBuf
=
0
;
iBuf
<
sizeof
(
pWriter
->
aBuf
)
/
sizeof
(
uint8_t
*
);
iBuf
++
)
{
tFree
(
pWriter
->
aBuf
[
iBuf
]);
}
tsdbInfo
(
"vgId:%d
, vnode snapshot tsdb writer close for %s"
,
TD_VID
(
pWriter
->
pTsdb
->
pVnode
),
pWriter
->
pTsdb
->
path
);
tsdbInfo
(
"vgId:%d
%s done"
,
TD_VID
(
pWriter
->
pTsdb
->
pVnode
),
__func__
);
taosMemoryFree
(
pWriter
);
*
ppWriter
=
NULL
;
return
code
;
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
bf85790e
...
...
@@ -151,7 +151,7 @@ int32_t syncReconfig(int64_t rid, SSyncCfg* pNewCfg) {
}
syncNodeStartHeartbeatTimer
(
pSyncNode
);
syncNodeReplicate
(
pSyncNode
);
//
syncNodeReplicate(pSyncNode);
}
syncNodeRelease
(
pSyncNode
);
...
...
source/libs/sync/src/syncSnapshot.c
浏览文件 @
bf85790e
...
...
@@ -345,6 +345,8 @@ bool snapshotReceiverIsStart(SSyncSnapshotReceiver *pReceiver) { return pReceive
void
snapshotReceiverForceStop
(
SSyncSnapshotReceiver
*
pReceiver
)
{
// force close, abandon incomplete data
if
(
pReceiver
->
pWriter
!=
NULL
)
{
// event log
sRTrace
(
pReceiver
,
"snapshot receiver force stop"
);
int32_t
ret
=
pReceiver
->
pSyncNode
->
pFsm
->
FpSnapshotStopWrite
(
pReceiver
->
pSyncNode
->
pFsm
,
pReceiver
->
pWriter
,
false
,
&
(
pReceiver
->
snapshot
));
ASSERT
(
ret
==
0
);
...
...
@@ -354,7 +356,7 @@ void snapshotReceiverForceStop(SSyncSnapshotReceiver *pReceiver) {
pReceiver
->
start
=
false
;
// event log
sRTrace
(
pReceiver
,
"snapshot receiver force stop"
);
//
sRTrace(pReceiver, "snapshot receiver force stop");
}
int32_t
snapshotReceiverStartWriter
(
SSyncSnapshotReceiver
*
pReceiver
,
SyncSnapshotSend
*
pBeginMsg
)
{
...
...
@@ -675,6 +677,7 @@ static int32_t syncNodeOnSnapshotEnd(SSyncNode *pSyncNode, SyncSnapshotSend *pMs
sNTrace
(
pSyncNode
,
"snapshot receiver finish waitting for true time, now:%"
PRId64
", stime:%"
PRId64
,
timeNow
,
pMsg
->
startTime
);
taosMsleep
(
10
);
timeNow
=
taosGetTimestampMs
();
}
int32_t
code
=
snapshotReceiverFinish
(
pReceiver
,
pMsg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录