Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e61f372a
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看板
提交
e61f372a
编写于
4月 25, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into feature/tq
上级
9c510c90
93bf4fef
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
81 addition
and
19 deletion
+81
-19
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+11
-0
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+44
-7
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+3
-5
source/dnode/vnode/src/vnd/vnodeOpen.c
source/dnode/vnode/src/vnd/vnodeOpen.c
+11
-0
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+3
-1
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+1
-1
source/libs/scalar/src/scalar.c
source/libs/scalar/src/scalar.c
+3
-3
source/util/src/terror.c
source/util/src/terror.c
+3
-0
tools/shell/src/shellCommand.c
tools/shell/src/shellCommand.c
+1
-1
tools/shell/src/shellEngine.c
tools/shell/src/shellEngine.c
+1
-1
未找到文件。
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
e61f372a
...
...
@@ -202,6 +202,17 @@ int32_t vmProcessCreateVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pMsg) {
return
code
;
}
code
=
vnodeStart
(
pImpl
);
if
(
code
!=
0
)
{
tFreeSCreateVnodeReq
(
&
createReq
);
dError
(
"vgId:%d, failed to start sync since %s"
,
createReq
.
vgId
,
terrstr
());
vnodeClose
(
pImpl
);
vnodeDestroy
(
path
,
pMgmt
->
pTfs
);
terrno
=
code
;
return
code
;
}
code
=
vmWriteVnodesToFile
(
pMgmt
);
if
(
code
!=
0
)
{
tFreeSCreateVnodeReq
(
&
createReq
);
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
e61f372a
...
...
@@ -74,12 +74,6 @@ int32_t vmOpenVnode(SVnodesMgmt *pMgmt, SWrapperCfg *pCfg, SVnode *pImpl) {
return
-
1
;
}
// sync integration
vnodeSyncSetQ
(
pImpl
,
NULL
);
vnodeSyncSetRpc
(
pImpl
,
NULL
);
int32_t
ret
=
vnodeSyncStart
(
pImpl
);
assert
(
ret
==
0
);
taosWLockLatch
(
&
pMgmt
->
latch
);
int32_t
code
=
taosHashPut
(
pMgmt
->
hash
,
&
pVnode
->
vgId
,
sizeof
(
int32_t
),
&
pVnode
,
sizeof
(
SVnodeObj
*
));
taosWUnLockLatch
(
&
pMgmt
->
latch
);
...
...
@@ -153,6 +147,7 @@ static void *vmOpenVnodeFunc(void *param) {
pThread
->
failed
++
;
}
else
{
vmOpenVnode
(
pMgmt
,
pCfg
,
pImpl
);
//vnodeStart(pImpl);
dDebug
(
"vgId:%d, is opened by thread:%d"
,
pCfg
->
vgId
,
pThread
->
threadIndex
);
pThread
->
opened
++
;
}
...
...
@@ -364,10 +359,52 @@ static int32_t vmRequire(SMgmtWrapper *pWrapper, bool *required) {
return
0
;
}
static
int32_t
vmStart
(
SMgmtWrapper
*
pWrapper
)
{
dDebug
(
"vnode-mgmt start to run"
);
SVnodesMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
taosRLockLatch
(
&
pMgmt
->
latch
);
void
*
pIter
=
taosHashIterate
(
pMgmt
->
hash
,
NULL
);
while
(
pIter
)
{
SVnodeObj
**
ppVnode
=
pIter
;
if
(
ppVnode
==
NULL
||
*
ppVnode
==
NULL
)
continue
;
SVnodeObj
*
pVnode
=
*
ppVnode
;
vnodeStart
(
pVnode
->
pImpl
);
pIter
=
taosHashIterate
(
pMgmt
->
hash
,
pIter
);
}
taosRUnLockLatch
(
&
pMgmt
->
latch
);
return
0
;
}
static
void
vmStop
(
SMgmtWrapper
*
pWrapper
)
{
#if 0
dDebug("vnode-mgmt start to stop");
SVnodesMgmt *pMgmt = pWrapper->pMgmt;
taosRLockLatch(&pMgmt->latch);
void *pIter = taosHashIterate(pMgmt->hash, NULL);
while (pIter) {
SVnodeObj **ppVnode = pIter;
if (ppVnode == NULL || *ppVnode == NULL) continue;
SVnodeObj *pVnode = *ppVnode;
vnodeStop(pVnode->pImpl);
pIter = taosHashIterate(pMgmt->hash, pIter);
}
taosRUnLockLatch(&pMgmt->latch);
#endif
}
void
vmSetMgmtFp
(
SMgmtWrapper
*
pWrapper
)
{
SMgmtFp
mgmtFp
=
{
0
};
mgmtFp
.
openFp
=
vmInit
;
mgmtFp
.
closeFp
=
vmCleanup
;
mgmtFp
.
startFp
=
vmStart
;
mgmtFp
.
stopFp
=
vmStop
;
mgmtFp
.
requiredFp
=
vmRequire
;
vmInitMsgHandle
(
pWrapper
);
...
...
@@ -396,4 +433,4 @@ void vmGetVnodeLoads(SMgmtWrapper *pWrapper, SMonVloadInfo *pInfo) {
}
taosRUnLockLatch
(
&
pMgmt
->
latch
);
}
\ No newline at end of file
}
source/dnode/vnode/inc/vnode.h
浏览文件 @
e61f372a
...
...
@@ -61,6 +61,9 @@ int32_t vnodeSync(SVnode *pVnode);
int32_t
vnodeGetLoad
(
SVnode
*
pVnode
,
SVnodeLoad
*
pLoad
);
int
vnodeValidateTableHash
(
SVnodeCfg
*
pVnodeOptions
,
char
*
tableFName
);
int32_t
vnodeStart
(
SVnode
*
pVnode
);
void
vnodeStop
(
SVnode
*
pVnode
);
int64_t
vnodeGetSyncHandle
(
SVnode
*
pVnode
);
void
vnodeGetSnapshot
(
SVnode
*
pVnode
,
SSnapshot
*
pSnapshot
);
...
...
@@ -171,11 +174,6 @@ typedef struct {
uint64_t
uid
;
}
STableKeyInfo
;
// sync integration
void
vnodeSyncSetQ
(
SVnode
*
pVnode
,
void
*
qHandle
);
void
vnodeSyncSetRpc
(
SVnode
*
pVnode
,
void
*
rpcHandle
);
int32_t
vnodeSyncStart
(
SVnode
*
pVnode
);
#ifdef __cplusplus
}
#endif
...
...
source/dnode/vnode/src/vnd/vnodeOpen.c
浏览文件 @
e61f372a
...
...
@@ -14,6 +14,7 @@
*/
#include "vnodeInt.h"
#include "vnodeSync.h"
int
vnodeCreate
(
const
char
*
path
,
SVnodeCfg
*
pCfg
,
STfs
*
pTfs
)
{
SVnodeInfo
info
=
{
0
};
...
...
@@ -171,6 +172,16 @@ void vnodeClose(SVnode *pVnode) {
}
}
// start the sync timer after the queue is ready
int32_t
vnodeStart
(
SVnode
*
pVnode
)
{
vnodeSyncSetQ
(
pVnode
,
NULL
);
vnodeSyncSetRpc
(
pVnode
,
NULL
);
vnodeSyncStart
(
pVnode
);
return
0
;
}
void
vnodeStop
(
SVnode
*
pVnode
)
{}
int64_t
vnodeGetSyncHandle
(
SVnode
*
pVnode
)
{
return
pVnode
->
sync
;
}
void
vnodeGetSnapshot
(
SVnode
*
pVnode
,
SSnapshot
*
pSnapshot
)
{
pSnapshot
->
lastApplyIndex
=
pVnode
->
state
.
committed
;
}
\ No newline at end of file
source/libs/executor/src/executorimpl.c
浏览文件 @
e61f372a
...
...
@@ -268,7 +268,6 @@ SSDataBlock* createResDataBlock(SDataBlockDescNode* pNode) {
int32_t
numOfCols
=
LIST_LENGTH
(
pNode
->
pSlots
);
SSDataBlock
*
pBlock
=
taosMemoryCalloc
(
1
,
sizeof
(
SSDataBlock
));
pBlock
->
info
.
numOfCols
=
numOfCols
;
pBlock
->
pDataBlock
=
taosArrayInit
(
numOfCols
,
sizeof
(
SColumnInfoData
));
pBlock
->
info
.
blockId
=
pNode
->
dataBlockId
;
...
...
@@ -294,6 +293,7 @@ SSDataBlock* createResDataBlock(SDataBlockDescNode* pNode) {
taosArrayPush
(
pBlock
->
pDataBlock
,
&
idata
);
}
pBlock
->
info
.
numOfCols
=
taosArrayGetSize
(
pBlock
->
pDataBlock
);
return
pBlock
;
}
...
...
@@ -1032,6 +1032,8 @@ static int32_t doCreateConstantValColumnInfo(SInputColumnInfoData* pInput, SFunc
pColInfo
->
info
.
bytes
=
tDataTypes
[
type
].
bytes
;
pInput
->
pData
[
paramIndex
]
=
pColInfo
;
}
else
{
pColInfo
=
pInput
->
pData
[
paramIndex
];
}
ASSERT
(
!
IS_VAR_DATA_TYPE
(
type
));
...
...
source/libs/function/src/builtins.c
浏览文件 @
e61f372a
...
...
@@ -355,7 +355,7 @@ static int32_t translateToIso8601(SFunctionNode* pFunc, char* pErrBuf, int32_t l
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
pFunc
->
node
.
resType
=
(
SDataType
)
{
.
bytes
=
2
4
,
.
type
=
TSDB_DATA_TYPE_BINARY
};
pFunc
->
node
.
resType
=
(
SDataType
)
{
.
bytes
=
6
4
,
.
type
=
TSDB_DATA_TYPE_BINARY
};
return
TSDB_CODE_SUCCESS
;
}
...
...
source/libs/scalar/src/scalar.c
浏览文件 @
e61f372a
...
...
@@ -489,7 +489,7 @@ EDealRes sclRewriteFunction(SNode** pNode, SScalarCtx *ctx) {
if
(
fmIsUserDefinedFunc
(
node
->
funcId
))
{
return
DEAL_RES_CONTINUE
;
}
FOREACH
(
tnode
,
node
->
pParameterList
)
{
if
(
!
SCL_IS_CONST_NODE
(
tnode
))
{
return
DEAL_RES_CONTINUE
;
...
...
@@ -517,8 +517,8 @@ EDealRes sclRewriteFunction(SNode** pNode, SScalarCtx *ctx) {
res
->
node
.
resType
=
node
->
node
.
resType
;
int32_t
type
=
output
.
columnData
->
info
.
type
;
if
(
IS_VAR_DATA_TYPE
(
type
))
{
res
->
datum
.
p
=
output
.
columnData
->
pData
;
output
.
columnData
->
pData
=
NULL
;
res
->
datum
.
p
=
taosMemoryCalloc
(
res
->
node
.
resType
.
bytes
+
VARSTR_HEADER_SIZE
+
1
,
1
)
;
memcpy
(
res
->
datum
.
p
,
output
.
columnData
->
pData
,
varDataTLen
(
output
.
columnData
->
pData
))
;
}
else
{
memcpy
(
nodesGetValueFromNode
(
res
),
output
.
columnData
->
pData
,
tDataTypes
[
type
].
bytes
);
}
...
...
source/util/src/terror.c
浏览文件 @
e61f372a
...
...
@@ -403,6 +403,9 @@ TAOS_DEFINE_ERROR(TSDB_CODE_SYN_INVALID_CHECKSUM, "Invalid msg checksum"
TAOS_DEFINE_ERROR
(
TSDB_CODE_SYN_INVALID_MSGLEN
,
"Invalid msg length"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SYN_INVALID_MSGTYPE
,
"Invalid msg type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SYN_NOT_LEADER
,
"Sync not leader"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SYN_INTERNAL_ERROR
,
"Sync internal error"
)
// wal
TAOS_DEFINE_ERROR
(
TSDB_CODE_WAL_APP_ERROR
,
"Unexpected generic error in wal"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_WAL_FILE_CORRUPTED
,
"WAL file is corrupted"
)
...
...
tools/shell/src/shellCommand.c
浏览文件 @
e61f372a
...
...
@@ -395,7 +395,7 @@ void shellClearScreen(int32_t ecmd_pos, int32_t cursor_pos) {
void
shellShowOnScreen
(
SShellCmd
*
cmd
)
{
struct
winsize
w
;
if
(
ioctl
(
0
,
TIOCGWINSZ
,
&
w
)
<
0
||
w
.
ws_col
==
0
||
w
.
ws_row
==
0
)
{
fprintf
(
stderr
,
"No stream device
\n
"
);
//
fprintf(stderr, "No stream device\n");
w
.
ws_col
=
120
;
w
.
ws_row
=
30
;
}
...
...
tools/shell/src/shellEngine.c
浏览文件 @
e61f372a
...
...
@@ -750,7 +750,7 @@ void shellReadHistory() {
void
shellWriteHistory
()
{
SShellHistory
*
pHistory
=
&
shell
.
history
;
TdFilePtr
pFile
=
taosOpenFile
(
pHistory
->
file
,
TD_FILE_
WRITE
|
TD_FILE_STREAM
);
TdFilePtr
pFile
=
taosOpenFile
(
pHistory
->
file
,
TD_FILE_
CREATE
|
TD_FILE_WRITE
|
TD_FILE_STREAM
|
TD_FILE_APPEND
);
if
(
pFile
==
NULL
)
return
;
for
(
int32_t
i
=
pHistory
->
hstart
;
i
!=
pHistory
->
hend
;)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录