Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
13476682
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看板
提交
13476682
编写于
7月 25, 2022
作者:
P
plum-lihui
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of github.com:taosdata/TDengine into 3.0
上级
64d74bff
23f3fb50
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
106 addition
and
18 deletion
+106
-18
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+1
-0
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+80
-9
source/dnode/vnode/src/vnd/vnodeSync.c
source/dnode/vnode/src/vnd/vnodeSync.c
+22
-7
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+1
-0
source/libs/executor/src/projectoperator.c
source/libs/executor/src/projectoperator.c
+1
-1
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+1
-1
未找到文件。
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
13476682
...
...
@@ -268,6 +268,7 @@ struct SVnode {
tsem_t
canCommit
;
int64_t
sync
;
int32_t
blockCount
;
bool
restored
;
tsem_t
syncSem
;
SQHandle
*
pQuery
;
};
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
13476682
...
...
@@ -1395,10 +1395,26 @@ void tsdbCalcColDataSMA(SColData *pColData, SColumnDataAgg *pColAgg) {
break
;
case
TSDB_DATA_TYPE_BOOL
:
break
;
case
TSDB_DATA_TYPE_TINYINT
:
case
TSDB_DATA_TYPE_TINYINT
:{
pColAgg
->
sum
+=
colVal
.
value
.
i8
;
if
(
pColAgg
->
min
>
colVal
.
value
.
i8
)
{
pColAgg
->
min
=
colVal
.
value
.
i8
;
}
if
(
pColAgg
->
max
<
colVal
.
value
.
i8
)
{
pColAgg
->
max
=
colVal
.
value
.
i8
;
}
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
}
case
TSDB_DATA_TYPE_SMALLINT
:{
pColAgg
->
sum
+=
colVal
.
value
.
i16
;
if
(
pColAgg
->
min
>
colVal
.
value
.
i16
)
{
pColAgg
->
min
=
colVal
.
value
.
i16
;
}
if
(
pColAgg
->
max
<
colVal
.
value
.
i16
)
{
pColAgg
->
max
=
colVal
.
value
.
i16
;
}
break
;
}
case
TSDB_DATA_TYPE_INT
:
{
pColAgg
->
sum
+=
colVal
.
value
.
i32
;
if
(
pColAgg
->
min
>
colVal
.
value
.
i32
)
{
...
...
@@ -1419,24 +1435,79 @@ void tsdbCalcColDataSMA(SColData *pColData, SColumnDataAgg *pColAgg) {
}
break
;
}
case
TSDB_DATA_TYPE_FLOAT
:
case
TSDB_DATA_TYPE_FLOAT
:{
pColAgg
->
sum
+=
colVal
.
value
.
f
;
if
(
pColAgg
->
min
>
colVal
.
value
.
f
)
{
pColAgg
->
min
=
colVal
.
value
.
f
;
}
if
(
pColAgg
->
max
<
colVal
.
value
.
f
)
{
pColAgg
->
max
=
colVal
.
value
.
f
;
}
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
}
case
TSDB_DATA_TYPE_DOUBLE
:{
pColAgg
->
sum
+=
colVal
.
value
.
d
;
if
(
pColAgg
->
min
>
colVal
.
value
.
d
)
{
pColAgg
->
min
=
colVal
.
value
.
d
;
}
if
(
pColAgg
->
max
<
colVal
.
value
.
d
)
{
pColAgg
->
max
=
colVal
.
value
.
d
;
}
break
;
}
case
TSDB_DATA_TYPE_VARCHAR
:
break
;
case
TSDB_DATA_TYPE_TIMESTAMP
:
case
TSDB_DATA_TYPE_TIMESTAMP
:{
if
(
pColAgg
->
min
>
colVal
.
value
.
i64
)
{
pColAgg
->
min
=
colVal
.
value
.
i64
;
}
if
(
pColAgg
->
max
<
colVal
.
value
.
i64
)
{
pColAgg
->
max
=
colVal
.
value
.
i64
;
}
break
;
}
case
TSDB_DATA_TYPE_NCHAR
:
break
;
case
TSDB_DATA_TYPE_UTINYINT
:
case
TSDB_DATA_TYPE_UTINYINT
:{
pColAgg
->
sum
+=
colVal
.
value
.
u8
;
if
(
pColAgg
->
min
>
colVal
.
value
.
u8
)
{
pColAgg
->
min
=
colVal
.
value
.
u8
;
}
if
(
pColAgg
->
max
<
colVal
.
value
.
u8
)
{
pColAgg
->
max
=
colVal
.
value
.
u8
;
}
break
;
case
TSDB_DATA_TYPE_USMALLINT
:
}
case
TSDB_DATA_TYPE_USMALLINT
:{
pColAgg
->
sum
+=
colVal
.
value
.
u16
;
if
(
pColAgg
->
min
>
colVal
.
value
.
u16
)
{
pColAgg
->
min
=
colVal
.
value
.
u16
;
}
if
(
pColAgg
->
max
<
colVal
.
value
.
u16
)
{
pColAgg
->
max
=
colVal
.
value
.
u16
;
}
break
;
case
TSDB_DATA_TYPE_UINT
:
}
case
TSDB_DATA_TYPE_UINT
:{
pColAgg
->
sum
+=
colVal
.
value
.
u32
;
if
(
pColAgg
->
min
>
colVal
.
value
.
u32
)
{
pColAgg
->
min
=
colVal
.
value
.
u32
;
}
if
(
pColAgg
->
max
<
colVal
.
value
.
u32
)
{
pColAgg
->
max
=
colVal
.
value
.
u32
;
}
break
;
case
TSDB_DATA_TYPE_UBIGINT
:
}
case
TSDB_DATA_TYPE_UBIGINT
:{
pColAgg
->
sum
+=
colVal
.
value
.
u64
;
if
(
pColAgg
->
min
>
colVal
.
value
.
u64
)
{
pColAgg
->
min
=
colVal
.
value
.
u64
;
}
if
(
pColAgg
->
max
<
colVal
.
value
.
u64
)
{
pColAgg
->
max
=
colVal
.
value
.
u64
;
}
break
;
}
case
TSDB_DATA_TYPE_JSON
:
break
;
case
TSDB_DATA_TYPE_VARBINARY
:
...
...
source/dnode/vnode/src/vnd/vnodeSync.c
浏览文件 @
13476682
...
...
@@ -224,9 +224,19 @@ void vnodeProposeWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs)
vGTrace
(
"vgId:%d, msg:%p get from vnode-write queue, weak:%d block:%d msg:%d:%d pos:%d, handle:%p"
,
vgId
,
pMsg
,
isWeak
,
isBlock
,
msg
,
numOfMsgs
,
arrayPos
,
pMsg
->
info
.
handle
);
if
(
!
pVnode
->
restored
)
{
vGError
(
"vgId:%d, msg:%p failed to process since not leader"
,
vgId
,
pMsg
);
terrno
=
TSDB_CODE_APP_NOT_READY
;
vnodeHandleProposeError
(
pVnode
,
pMsg
,
TSDB_CODE_APP_NOT_READY
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
continue
;
}
if
(
pMsgArr
==
NULL
||
pIsWeakArr
==
NULL
)
{
vGError
(
"vgId:%d, msg:%p failed to process since out of memory"
,
vgId
,
pMsg
);
vnodeHandleProposeError
(
pVnode
,
pMsg
,
TSDB_CODE_OUT_OF_MEMORY
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
vnodeHandleProposeError
(
pVnode
,
pMsg
,
terrno
);
rpcFreeCont
(
pMsg
->
pCont
);
taosFreeQitem
(
pMsg
);
continue
;
...
...
@@ -609,6 +619,12 @@ static void vnodeLeaderTransfer(struct SSyncFSM *pFsm, const SRpcMsg *pMsg, SFsm
SVnode
*
pVnode
=
pFsm
->
data
;
}
static
void
vnodeRestoreFinish
(
struct
SSyncFSM
*
pFsm
)
{
SVnode
*
pVnode
=
pFsm
->
data
;
pVnode
->
restored
=
true
;
vDebug
(
"vgId:%d, sync restore finished"
,
pVnode
->
config
.
vgId
);
}
static
SSyncFSM
*
vnodeSyncMakeFsm
(
SVnode
*
pVnode
)
{
SSyncFSM
*
pFsm
=
taosMemoryCalloc
(
1
,
sizeof
(
SSyncFSM
));
pFsm
->
data
=
pVnode
;
...
...
@@ -616,7 +632,7 @@ static SSyncFSM *vnodeSyncMakeFsm(SVnode *pVnode) {
pFsm
->
FpPreCommitCb
=
vnodeSyncPreCommitMsg
;
pFsm
->
FpRollBackCb
=
vnodeSyncRollBackMsg
;
pFsm
->
FpGetSnapshotInfo
=
vnodeSyncGetSnapshot
;
pFsm
->
FpRestoreFinishCb
=
NULL
;
pFsm
->
FpRestoreFinishCb
=
vnodeRestoreFinish
;
pFsm
->
FpLeaderTransferCb
=
vnodeLeaderTransfer
;
pFsm
->
FpReConfigCb
=
vnodeSyncReconfig
;
pFsm
->
FpSnapshotStartRead
=
vnodeSnapshotStartRead
;
...
...
@@ -670,11 +686,10 @@ bool vnodeIsLeader(SVnode *pVnode) {
return
false
;
}
// todo
// if (!pVnode->restored) {
// terrno = TSDB_CODE_APP_NOT_READY;
// return false;
// }
if
(
!
pVnode
->
restored
)
{
terrno
=
TSDB_CODE_APP_NOT_READY
;
return
false
;
}
return
true
;
}
\ No newline at end of file
source/libs/executor/src/executor.c
浏览文件 @
13476682
...
...
@@ -416,6 +416,7 @@ int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pRes, uint64_t* useconds) {
}
if
(
isTaskKilled
(
pTaskInfo
))
{
atomic_store_64
(
&
pTaskInfo
->
owner
,
0
);
qDebug
(
"%s already killed, abort"
,
GET_TASKID
(
pTaskInfo
));
return
TSDB_CODE_SUCCESS
;
}
...
...
source/libs/executor/src/projectoperator.c
浏览文件 @
13476682
...
...
@@ -69,7 +69,7 @@ SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhys
// todo remove it soon
if
(
pTaskInfo
->
execModel
==
OPTR_EXEC_MODEL_STREAM
)
{
pInfo
->
mergeDataBlocks
=
tru
e
;
pInfo
->
mergeDataBlocks
=
fals
e
;
}
int32_t
numOfRows
=
4096
;
...
...
source/libs/function/src/builtins.c
浏览文件 @
13476682
...
...
@@ -1532,7 +1532,7 @@ static int32_t translateDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
}
uint8_t
resType
;
if
(
IS_SIGNED_NUMERIC_TYPE
(
colType
)
||
TSDB_DATA_TYPE_BOOL
==
colType
)
{
if
(
IS_SIGNED_NUMERIC_TYPE
(
colType
)
||
TSDB_DATA_TYPE_BOOL
==
colType
||
TSDB_DATA_TYPE_TIMESTAMP
==
colType
)
{
resType
=
TSDB_DATA_TYPE_BIGINT
;
}
else
{
resType
=
TSDB_DATA_TYPE_DOUBLE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录