Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
807e181b
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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看板
未验证
提交
807e181b
编写于
11月 13, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
11月 13, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4217 from taosdata/feature/wal
Feature/wal
上级
a2114b22
66f104bb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
15 deletion
+32
-15
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+7
-5
src/inc/tsdb.h
src/inc/tsdb.h
+2
-2
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+1
-1
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+22
-7
未找到文件。
src/dnode/src/dnodeVWrite.c
浏览文件 @
807e181b
...
...
@@ -212,7 +212,7 @@ static void *dnodeProcessVWriteQueue(void *param) {
pWrite
->
code
=
vnodeProcessWrite
(
pVnode
,
pWrite
->
pHead
,
qtype
,
&
pWrite
->
rspRet
);
if
(
pWrite
->
code
<=
0
)
pWrite
->
processedCount
=
1
;
if
(
pWrite
->
pHead
->
msgType
!=
TSDB_MSG_TYPE_SUBMIT
)
forceFsync
=
true
;
if
(
pWrite
->
code
==
0
&&
pWrite
->
pHead
->
msgType
!=
TSDB_MSG_TYPE_SUBMIT
)
forceFsync
=
true
;
dTrace
(
"msg:%p is processed in vwrite queue, result:%s"
,
pWrite
,
tstrerror
(
pWrite
->
code
));
}
...
...
@@ -225,11 +225,13 @@ static void *dnodeProcessVWriteQueue(void *param) {
taosGetQitem
(
pWorker
->
qall
,
&
qtype
,
(
void
**
)
&
pWrite
);
if
(
qtype
==
TAOS_QTYPE_RPC
)
{
dnodeSendRpcVWriteRsp
(
pVnode
,
pWrite
,
pWrite
->
code
);
}
else
if
(
qtype
==
TAOS_QTYPE_FWD
)
{
vnodeConfirmForward
(
pVnode
,
pWrite
->
pHead
->
version
,
0
);
taosFreeQitem
(
pWrite
);
vnodeRelease
(
pVnode
);
}
else
{
if
(
qtype
==
TAOS_QTYPE_FWD
)
{
vnodeConfirmForward
(
pVnode
,
pWrite
->
pHead
->
version
,
0
);
}
if
(
pWrite
->
rspRet
.
rsp
)
{
rpcFreeCont
(
pWrite
->
rspRet
.
rsp
);
}
taosFreeQitem
(
pWrite
);
vnodeRelease
(
pVnode
);
}
...
...
src/inc/tsdb.h
浏览文件 @
807e181b
...
...
@@ -126,7 +126,7 @@ uint32_t tsdbGetFileInfo(TSDB_REPO_T *repo, char *name, uint32_t *index, uint32_
// the TSDB repository info
typedef
struct
STsdbRepoInfo
{
STsdbCfg
tsdbCfg
;
int64_t
version
;
// version of the repository
uint64_t
version
;
// version of the repository
int64_t
tsdbTotalDataSize
;
// the original inserted data size
int64_t
tsdbTotalDiskSize
;
// the total disk size taken by this TSDB repository
// TODO: Other informations to add
...
...
@@ -136,7 +136,7 @@ STsdbRepoInfo *tsdbGetStatus(TSDB_REPO_T *pRepo);
// the meter information report structure
typedef
struct
{
STableCfg
tableCfg
;
int64_t
version
;
uint64_t
version
;
int64_t
tableTotalDataSize
;
// In bytes
int64_t
tableTotalDiskSize
;
// In bytes
}
STableInfo
;
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
807e181b
...
...
@@ -71,7 +71,7 @@ typedef struct _SSdbTable {
typedef
struct
{
ESyncRole
role
;
ESdbStatus
status
;
int64_t
version
;
uint64_t
version
;
int64_t
sync
;
void
*
wal
;
SSyncCfg
cfg
;
...
...
src/sync/src/syncMain.c
浏览文件 @
807e181b
...
...
@@ -498,7 +498,7 @@ static SSyncPeer *syncAddPeer(SSyncNode *pNode, const SNodeInfo *pInfo) {
int32_t
ret
=
strcmp
(
pPeer
->
fqdn
,
tsNodeFqdn
);
if
(
pPeer
->
nodeId
==
0
||
(
ret
>
0
)
||
(
ret
==
0
&&
pPeer
->
port
>
tsSyncPort
))
{
int32_t
checkMs
=
100
+
(
pNode
->
vgId
*
10
)
%
100
;
if
(
pNode
->
vgId
>
1
)
checkMs
=
tsStatusInterval
*
2
000
+
checkMs
;
if
(
pNode
->
vgId
>
1
)
checkMs
=
tsStatusInterval
*
1
000
+
checkMs
;
sDebug
(
"%s, start to check peer connection after %d ms"
,
pPeer
->
id
,
checkMs
);
taosTmrReset
(
syncCheckPeerConnection
,
checkMs
,
pPeer
,
tsSyncTmrCtrl
,
&
pPeer
->
timer
);
}
...
...
@@ -575,6 +575,17 @@ static void syncChooseMaster(SSyncNode *pNode) {
if
(
index
==
pNode
->
selfIndex
)
{
sInfo
(
"vgId:%d, start to work as master"
,
pNode
->
vgId
);
nodeRole
=
TAOS_SYNC_ROLE_MASTER
;
#if 0
for (int32_t i = 0; i < pNode->replica; ++i) {
pPeer = pNode->peerInfo[i];
if (pPeer->version == nodeVersion) {
pPeer->role = TAOS_SYNC_ROLE_SLAVE;
pPeer->sstatus = TAOS_SYNC_STATUS_CACHE;
sInfo("%s, it shall work as slave", pPeer->id);
}
}
#endif
syncResetFlowCtrl
(
pNode
);
(
*
pNode
->
notifyRole
)(
pNode
->
ahandle
,
nodeRole
);
}
else
{
...
...
@@ -1209,13 +1220,17 @@ static int32_t syncForwardToPeerImpl(SSyncNode *pNode, void *data, void *mhandle
int32_t
fwdLen
;
int32_t
code
=
0
;
if
(
nodeRole
==
TAOS_SYNC_ROLE_SLAVE
&&
pWalHead
->
version
!=
nodeVersion
+
1
)
{
sError
(
"vgId:%d, received ver:%"
PRIu64
", inconsistent with last ver:%"
PRIu64
", restart connection"
,
pNode
->
vgId
,
pWalHead
->
version
,
nodeVersion
);
for
(
int32_t
i
=
0
;
i
<
pNode
->
replica
;
++
i
)
{
pPeer
=
pNode
->
peerInfo
[
i
];
syncRestartConnection
(
pPeer
);
if
(
pWalHead
->
version
>
nodeVersion
+
1
)
{
sError
(
"vgId:%d, hver:%"
PRIu64
", inconsistent with ver:%"
PRIu64
,
pNode
->
vgId
,
pWalHead
->
version
,
nodeVersion
);
if
(
nodeRole
==
TAOS_SYNC_ROLE_SLAVE
)
{
sInfo
(
"vgId:%d, restart connection"
,
pNode
->
vgId
);
for
(
int32_t
i
=
0
;
i
<
pNode
->
replica
;
++
i
)
{
pPeer
=
pNode
->
peerInfo
[
i
];
syncRestartConnection
(
pPeer
);
}
}
return
TSDB_CODE_SYN_INVALID_VERSION
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录