Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
294acc9e
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
294acc9e
编写于
7月 08, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into fix/tsdb_merge_bug
上级
1e4f7e3a
1711d646
变更
72
展开全部
隐藏空白更改
内联
并排
Showing
72 changed file
with
758 addition
and
1214 deletion
+758
-1214
include/common/tcommon.h
include/common/tcommon.h
+0
-2
include/libs/sync/sync.h
include/libs/sync/sync.h
+0
-3
include/util/tlog.h
include/util/tlog.h
+1
-1
source/client/src/TMQConnector.c
source/client/src/TMQConnector.c
+2
-4
source/client/src/TSDBJNIConnector.c
source/client/src/TSDBJNIConnector.c
+1
-2
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+21
-7
source/common/src/tglobal.c
source/common/src/tglobal.c
+4
-4
source/dnode/mgmt/exe/dmMain.c
source/dnode/mgmt/exe/dmMain.c
+1
-1
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+2
-2
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
+1
-1
source/dnode/mnode/impl/src/mndSync.c
source/dnode/mnode/impl/src/mndSync.c
+1
-1
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-1
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+2
-0
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+7
-2
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+97
-24
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+7
-0
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+261
-657
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
+5
-2
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+18
-2
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+5
-5
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+12
-7
source/libs/function/inc/fnLog.h
source/libs/function/inc/fnLog.h
+8
-6
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+28
-23
source/libs/sync/inc/syncOnMessage.h
source/libs/sync/inc/syncOnMessage.h
+0
-72
source/libs/sync/src/syncAppendEntries.c
source/libs/sync/src/syncAppendEntries.c
+88
-267
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+6
-4
source/libs/sync/src/syncOnMessage.c
source/libs/sync/src/syncOnMessage.c
+0
-56
source/libs/sync/src/syncRaftLog.c
source/libs/sync/src/syncRaftLog.c
+16
-0
source/libs/sync/src/syncReplication.c
source/libs/sync/src/syncReplication.c
+5
-10
source/libs/sync/test/CMakeLists.txt
source/libs/sync/test/CMakeLists.txt
+14
-0
source/libs/sync/test/syncLogStoreTest.cpp
source/libs/sync/test/syncLogStoreTest.cpp
+1
-0
source/libs/sync/test/syncRestoreFromSnapshot.cpp
source/libs/sync/test/syncRestoreFromSnapshot.cpp
+78
-0
source/util/src/tlog.c
source/util/src/tlog.c
+2
-2
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+2
-2
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+6
-2
tests/script/tsim/sync/vnodesnapshot.sim
tests/script/tsim/sync/vnodesnapshot.sim
+19
-6
tests/system-test/0-others/cachelast.py
tests/system-test/0-others/cachelast.py
+1
-1
tests/system-test/2-query/abs.py
tests/system-test/2-query/abs.py
+1
-1
tests/system-test/2-query/and_or_for_byte.py
tests/system-test/2-query/and_or_for_byte.py
+1
-1
tests/system-test/2-query/arccos.py
tests/system-test/2-query/arccos.py
+1
-1
tests/system-test/2-query/arcsin.py
tests/system-test/2-query/arcsin.py
+1
-1
tests/system-test/2-query/arctan.py
tests/system-test/2-query/arctan.py
+1
-1
tests/system-test/2-query/avg.py
tests/system-test/2-query/avg.py
+1
-1
tests/system-test/2-query/ceil.py
tests/system-test/2-query/ceil.py
+1
-1
tests/system-test/2-query/check_tsdb.py
tests/system-test/2-query/check_tsdb.py
+1
-1
tests/system-test/2-query/cos.py
tests/system-test/2-query/cos.py
+1
-1
tests/system-test/2-query/distribute_agg_apercentile.py
tests/system-test/2-query/distribute_agg_apercentile.py
+1
-1
tests/system-test/2-query/distribute_agg_avg.py
tests/system-test/2-query/distribute_agg_avg.py
+1
-1
tests/system-test/2-query/distribute_agg_count.py
tests/system-test/2-query/distribute_agg_count.py
+1
-1
tests/system-test/2-query/distribute_agg_max.py
tests/system-test/2-query/distribute_agg_max.py
+1
-1
tests/system-test/2-query/distribute_agg_min.py
tests/system-test/2-query/distribute_agg_min.py
+1
-1
tests/system-test/2-query/distribute_agg_spread.py
tests/system-test/2-query/distribute_agg_spread.py
+1
-1
tests/system-test/2-query/distribute_agg_stddev.py
tests/system-test/2-query/distribute_agg_stddev.py
+1
-1
tests/system-test/2-query/distribute_agg_sum.py
tests/system-test/2-query/distribute_agg_sum.py
+1
-1
tests/system-test/2-query/floor.py
tests/system-test/2-query/floor.py
+1
-1
tests/system-test/2-query/function_null.py
tests/system-test/2-query/function_null.py
+1
-1
tests/system-test/2-query/function_stateduration.py
tests/system-test/2-query/function_stateduration.py
+1
-1
tests/system-test/2-query/irate.py
tests/system-test/2-query/irate.py
+1
-1
tests/system-test/2-query/log.py
tests/system-test/2-query/log.py
+1
-1
tests/system-test/2-query/max.py
tests/system-test/2-query/max.py
+1
-1
tests/system-test/2-query/nestedQuery.py
tests/system-test/2-query/nestedQuery.py
+1
-1
tests/system-test/2-query/nestedQuery_str.py
tests/system-test/2-query/nestedQuery_str.py
+1
-1
tests/system-test/2-query/pow.py
tests/system-test/2-query/pow.py
+1
-1
tests/system-test/2-query/round.py
tests/system-test/2-query/round.py
+1
-1
tests/system-test/2-query/sin.py
tests/system-test/2-query/sin.py
+1
-1
tests/system-test/2-query/sqrt.py
tests/system-test/2-query/sqrt.py
+1
-1
tests/system-test/2-query/statecount.py
tests/system-test/2-query/statecount.py
+1
-1
tests/system-test/2-query/tail.py
tests/system-test/2-query/tail.py
+1
-1
tests/system-test/2-query/tan.py
tests/system-test/2-query/tan.py
+1
-1
tests/system-test/2-query/twa.py
tests/system-test/2-query/twa.py
+1
-1
tests/system-test/2-query/unique.py
tests/system-test/2-query/unique.py
+1
-1
tools/taosadapter
tools/taosadapter
+1
-1
未找到文件。
include/common/tcommon.h
浏览文件 @
294acc9e
...
@@ -88,8 +88,6 @@ typedef struct {
...
@@ -88,8 +88,6 @@ typedef struct {
#pragma pack(push, 1)
#pragma pack(push, 1)
typedef
struct
SColumnDataAgg
{
typedef
struct
SColumnDataAgg
{
int16_t
colId
;
int16_t
colId
;
int16_t
minIndex
;
int16_t
maxIndex
;
int16_t
numOfNull
;
int16_t
numOfNull
;
int64_t
sum
;
int64_t
sum
;
int64_t
max
;
int64_t
max
;
...
...
include/libs/sync/sync.h
浏览文件 @
294acc9e
...
@@ -163,9 +163,6 @@ typedef struct SSyncLogStore {
...
@@ -163,9 +163,6 @@ typedef struct SSyncLogStore {
// return commit index of log
// return commit index of log
SyncIndex
(
*
getCommitIndex
)(
struct
SSyncLogStore
*
pLogStore
);
SyncIndex
(
*
getCommitIndex
)(
struct
SSyncLogStore
*
pLogStore
);
// refactor, log[0 .. n] ==> log[m .. n]
// int32_t (*syncLogSetBeginIndex)(struct SSyncLogStore* pLogStore, SyncIndex beginIndex);
SyncIndex
(
*
syncLogBeginIndex
)(
struct
SSyncLogStore
*
pLogStore
);
SyncIndex
(
*
syncLogBeginIndex
)(
struct
SSyncLogStore
*
pLogStore
);
SyncIndex
(
*
syncLogEndIndex
)(
struct
SSyncLogStore
*
pLogStore
);
SyncIndex
(
*
syncLogEndIndex
)(
struct
SSyncLogStore
*
pLogStore
);
bool
(
*
syncLogIsEmpty
)(
struct
SSyncLogStore
*
pLogStore
);
bool
(
*
syncLogIsEmpty
)(
struct
SSyncLogStore
*
pLogStore
);
...
...
include/util/tlog.h
浏览文件 @
294acc9e
...
@@ -60,7 +60,7 @@ extern int32_t tsdbDebugFlag;
...
@@ -60,7 +60,7 @@ extern int32_t tsdbDebugFlag;
extern
int32_t
tqDebugFlag
;
extern
int32_t
tqDebugFlag
;
extern
int32_t
fsDebugFlag
;
extern
int32_t
fsDebugFlag
;
extern
int32_t
metaDebugFlag
;
extern
int32_t
metaDebugFlag
;
extern
int32_t
fn
DebugFlag
;
extern
int32_t
udf
DebugFlag
;
extern
int32_t
smaDebugFlag
;
extern
int32_t
smaDebugFlag
;
extern
int32_t
idxDebugFlag
;
extern
int32_t
idxDebugFlag
;
...
...
source/client/src/TMQConnector.c
浏览文件 @
294acc9e
...
@@ -324,9 +324,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_fetchRawBlockImp(
...
@@ -324,9 +324,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_fetchRawBlockImp(
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetNumOfRowsFp
,
(
jint
)
numOfRows
);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetNumOfRowsFp
,
(
jint
)
numOfRows
);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetNumOfColsFp
,
(
jint
)
numOfFields
);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetNumOfColsFp
,
(
jint
)
numOfFields
);
char
*
chars
=
(
char
*
)
data
;
int32_t
len
=
*
(
int32_t
*
)
data
;
int32_t
len
=
chars
[
0
]
+
(
chars
[
1
]
<<
8
)
+
(
chars
[
2
]
<<
16
)
+
(
chars
[
3
]
<<
24
);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetByteArrayFp
,
jniFromNCharToByteArray
(
env
,
(
char
*
)
data
,
len
));
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetByteArrayFp
,
len
,
jniFromNCharToByteArray
(
env
,
(
char
*
)
data
,
len
));
return
JNI_SUCCESS
;
return
JNI_SUCCESS
;
}
}
source/client/src/TSDBJNIConnector.c
浏览文件 @
294acc9e
...
@@ -592,8 +592,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchBlockImp(JNI
...
@@ -592,8 +592,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchBlockImp(JNI
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetNumOfRowsFp
,
(
jint
)
numOfRows
);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetNumOfRowsFp
,
(
jint
)
numOfRows
);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetNumOfColsFp
,
(
jint
)
numOfFields
);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetNumOfColsFp
,
(
jint
)
numOfFields
);
char
*
chars
=
(
char
*
)
data
;
int32_t
len
=
*
(
int32_t
*
)
data
;
int32_t
len
=
chars
[
0
]
+
(
chars
[
1
]
<<
8
)
+
(
chars
[
2
]
<<
16
)
+
(
chars
[
3
]
<<
24
);
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetByteArrayFp
,
jniFromNCharToByteArray
(
env
,
(
char
*
)
data
,
len
));
(
*
env
)
->
CallVoidMethod
(
env
,
rowobj
,
g_blockdataSetByteArrayFp
,
jniFromNCharToByteArray
(
env
,
(
char
*
)
data
,
len
));
return
JNI_SUCCESS
;
return
JNI_SUCCESS
;
...
...
source/client/test/clientTests.cpp
浏览文件 @
294acc9e
...
@@ -750,7 +750,6 @@ TEST(testCase, projection_query_stables) {
...
@@ -750,7 +750,6 @@ TEST(testCase, projection_query_stables) {
taos_close(pConn);
taos_close(pConn);
}
}
TEST(testCase, agg_query_tables) {
TEST(testCase, agg_query_tables) {
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
ASSERT_NE(pConn, nullptr);
ASSERT_NE(pConn, nullptr);
...
@@ -763,7 +762,7 @@ TEST(testCase, agg_query_tables) {
...
@@ -763,7 +762,7 @@ TEST(testCase, agg_query_tables) {
}
}
taos_free_result(pRes);
taos_free_result(pRes);
pRes = taos_query(pConn, "show table distributed
st1
");
pRes = taos_query(pConn, "show table distributed
tup
");
if (taos_errno(pRes) != 0) {
if (taos_errno(pRes) != 0) {
printf("failed to select from table, reason:%s\n", taos_errstr(pRes));
printf("failed to select from table, reason:%s\n", taos_errstr(pRes));
taos_free_result(pRes);
taos_free_result(pRes);
...
@@ -822,13 +821,29 @@ TEST(testCase, async_api_test) {
...
@@ -822,13 +821,29 @@ TEST(testCase, async_api_test) {
}
}
#endif
#endif
TEST
(
testCase
,
update_test
)
{
TEST
(
testCase
,
update_test
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
ASSERT_NE
(
pConn
,
nullptr
);
ASSERT_NE
(
pConn
,
nullptr
);
taos_query
(
pConn
,
"use abc1"
);
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"create database if not exists abc1"
);
if
(
taos_errno
(
pRes
)
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"failed to create database, code:%s"
,
taos_errstr
(
pRes
));
taos_free_result
(
pRes
);
return
;
}
taos_free_result
(
pRes
);
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"create table tup (ts timestamp, k int);"
);
pRes
=
taos_query
(
pConn
,
"use abc1"
);
if
(
taos_errno
(
pRes
)
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"failed to use db, code:%s"
,
taos_errstr
(
pRes
));
taos_free_result
(
pRes
);
return
;
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table tup (ts timestamp, k int);"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create table, reason:%s"
,
taos_errstr
(
pRes
));
printf
(
"failed to create table, reason:%s"
,
taos_errstr
(
pRes
));
}
}
...
@@ -836,11 +851,10 @@ TEST(testCase, update_test) {
...
@@ -836,11 +851,10 @@ TEST(testCase, update_test) {
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
char
s
[
256
]
=
{
0
};
char
s
[
256
]
=
{
0
};
for
(
int32_t
i
=
0
;
i
<
7000
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
1
7000
;
++
i
)
{
sprintf
(
s
,
"insert into tup values(
'2020-1-1 1:1:1', %d)"
,
i
);
sprintf
(
s
,
"insert into tup values(
now+%da, %d)"
,
i
,
i
);
pRes
=
taos_query
(
pConn
,
s
);
pRes
=
taos_query
(
pConn
,
s
);
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
}
}
}
}
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
source/common/src/tglobal.c
浏览文件 @
294acc9e
...
@@ -314,7 +314,7 @@ static int32_t taosAddServerLogCfg(SConfig *pCfg) {
...
@@ -314,7 +314,7 @@ static int32_t taosAddServerLogCfg(SConfig *pCfg) {
if
(
cfgAddInt32
(
pCfg
,
"tsdbDebugFlag"
,
tsdbDebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"tsdbDebugFlag"
,
tsdbDebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"tqDebugFlag"
,
tqDebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"tqDebugFlag"
,
tqDebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"fsDebugFlag"
,
fsDebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"fsDebugFlag"
,
fsDebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"
fnDebugFlag"
,
fn
DebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"
udfDebugFlag"
,
udf
DebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"smaDebugFlag"
,
smaDebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"smaDebugFlag"
,
smaDebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"idxDebugFlag"
,
idxDebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"idxDebugFlag"
,
idxDebugFlag
,
0
,
255
,
0
)
!=
0
)
return
-
1
;
return
0
;
return
0
;
...
@@ -504,7 +504,7 @@ static void taosSetServerLogCfg(SConfig *pCfg) {
...
@@ -504,7 +504,7 @@ static void taosSetServerLogCfg(SConfig *pCfg) {
tsdbDebugFlag
=
cfgGetItem
(
pCfg
,
"tsdbDebugFlag"
)
->
i32
;
tsdbDebugFlag
=
cfgGetItem
(
pCfg
,
"tsdbDebugFlag"
)
->
i32
;
tqDebugFlag
=
cfgGetItem
(
pCfg
,
"tqDebugFlag"
)
->
i32
;
tqDebugFlag
=
cfgGetItem
(
pCfg
,
"tqDebugFlag"
)
->
i32
;
fsDebugFlag
=
cfgGetItem
(
pCfg
,
"fsDebugFlag"
)
->
i32
;
fsDebugFlag
=
cfgGetItem
(
pCfg
,
"fsDebugFlag"
)
->
i32
;
fnDebugFlag
=
cfgGetItem
(
pCfg
,
"fn
DebugFlag"
)
->
i32
;
udfDebugFlag
=
cfgGetItem
(
pCfg
,
"udf
DebugFlag"
)
->
i32
;
smaDebugFlag
=
cfgGetItem
(
pCfg
,
"smaDebugFlag"
)
->
i32
;
smaDebugFlag
=
cfgGetItem
(
pCfg
,
"smaDebugFlag"
)
->
i32
;
idxDebugFlag
=
cfgGetItem
(
pCfg
,
"idxDebugFlag"
)
->
i32
;
idxDebugFlag
=
cfgGetItem
(
pCfg
,
"idxDebugFlag"
)
->
i32
;
}
}
...
@@ -715,8 +715,6 @@ int32_t taosSetCfg(SConfig *pCfg, char* name) {
...
@@ -715,8 +715,6 @@ int32_t taosSetCfg(SConfig *pCfg, char* name) {
cfgSetItem
(
pCfg
,
"firstEp"
,
tsFirst
,
pFirstEpItem
->
stype
);
cfgSetItem
(
pCfg
,
"firstEp"
,
tsFirst
,
pFirstEpItem
->
stype
);
}
else
if
(
strcasecmp
(
"fsDebugFlag"
,
name
)
==
0
)
{
}
else
if
(
strcasecmp
(
"fsDebugFlag"
,
name
)
==
0
)
{
fsDebugFlag
=
cfgGetItem
(
pCfg
,
"fsDebugFlag"
)
->
i32
;
fsDebugFlag
=
cfgGetItem
(
pCfg
,
"fsDebugFlag"
)
->
i32
;
}
else
if
(
strcasecmp
(
"fnDebugFlag"
,
name
)
==
0
)
{
fnDebugFlag
=
cfgGetItem
(
pCfg
,
"fnDebugFlag"
)
->
i32
;
}
}
break
;
break
;
}
}
...
@@ -817,6 +815,8 @@ int32_t taosSetCfg(SConfig *pCfg, char* name) {
...
@@ -817,6 +815,8 @@ int32_t taosSetCfg(SConfig *pCfg, char* name) {
case
'u'
:
{
case
'u'
:
{
if
(
strcasecmp
(
"multiProcess"
,
name
)
==
0
)
{
if
(
strcasecmp
(
"multiProcess"
,
name
)
==
0
)
{
tsMultiProcess
=
cfgGetItem
(
pCfg
,
"multiProcess"
)
->
bval
;
tsMultiProcess
=
cfgGetItem
(
pCfg
,
"multiProcess"
)
->
bval
;
}
else
if
(
strcasecmp
(
"udfDebugFlag"
,
name
)
==
0
)
{
udfDebugFlag
=
cfgGetItem
(
pCfg
,
"udfDebugFlag"
)
->
i32
;
}
}
break
;
break
;
}
}
...
...
source/dnode/mgmt/exe/dmMain.c
浏览文件 @
294acc9e
...
@@ -216,7 +216,7 @@ int main(int argc, char const *argv[]) {
...
@@ -216,7 +216,7 @@ int main(int argc, char const *argv[]) {
return
-
1
;
return
-
1
;
}
}
dInfo
(
"start to
open dnod
e"
);
dInfo
(
"start to
init servic
e"
);
dmSetSignalHandle
();
dmSetSignalHandle
();
int32_t
code
=
dmRun
();
int32_t
code
=
dmRun
();
dInfo
(
"shutting down the service"
);
dInfo
(
"shutting down the service"
);
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
294acc9e
...
@@ -173,7 +173,7 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) {
...
@@ -173,7 +173,7 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) {
pThread
->
pCfgs
[
pThread
->
vnodeNum
++
]
=
pCfgs
[
v
];
pThread
->
pCfgs
[
pThread
->
vnodeNum
++
]
=
pCfgs
[
v
];
}
}
dInfo
(
"
start %d threads to open %d vnodes"
,
threadNum
,
numOfVnodes
);
dInfo
(
"
open %d vnodes with %d threads"
,
numOfVnodes
,
threadNum
);
for
(
int32_t
t
=
0
;
t
<
threadNum
;
++
t
)
{
for
(
int32_t
t
=
0
;
t
<
threadNum
;
++
t
)
{
SVnodeThread
*
pThread
=
&
threads
[
t
];
SVnodeThread
*
pThread
=
&
threads
[
t
];
...
@@ -204,7 +204,7 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) {
...
@@ -204,7 +204,7 @@ static int32_t vmOpenVnodes(SVnodeMgmt *pMgmt) {
dError
(
"there are total vnodes:%d, opened:%d"
,
pMgmt
->
state
.
totalVnodes
,
pMgmt
->
state
.
openVnodes
);
dError
(
"there are total vnodes:%d, opened:%d"
,
pMgmt
->
state
.
totalVnodes
,
pMgmt
->
state
.
openVnodes
);
return
-
1
;
return
-
1
;
}
else
{
}
else
{
dInfo
(
"
total vnodes:%d open successfully
"
,
pMgmt
->
state
.
totalVnodes
);
dInfo
(
"
successfully opened %d vnodes
"
,
pMgmt
->
state
.
totalVnodes
);
return
0
;
return
0
;
}
}
}
}
...
...
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
浏览文件 @
294acc9e
...
@@ -128,7 +128,7 @@ static void dmClearVars(SDnode *pDnode) {
...
@@ -128,7 +128,7 @@ static void dmClearVars(SDnode *pDnode) {
}
}
int32_t
dmInitDnode
(
SDnode
*
pDnode
,
EDndNodeType
rtype
)
{
int32_t
dmInitDnode
(
SDnode
*
pDnode
,
EDndNodeType
rtype
)
{
d
Info
(
"start to create dnode"
);
d
Debug
(
"start to create dnode"
);
int32_t
code
=
-
1
;
int32_t
code
=
-
1
;
char
path
[
PATH_MAX
+
100
]
=
{
0
};
char
path
[
PATH_MAX
+
100
]
=
{
0
};
...
...
source/dnode/mnode/impl/src/mndSync.c
浏览文件 @
294acc9e
...
@@ -188,7 +188,7 @@ int32_t mndInitSync(SMnode *pMnode) {
...
@@ -188,7 +188,7 @@ int32_t mndInitSync(SMnode *pMnode) {
SNodeInfo
*
pNode
=
&
pCfg
->
nodeInfo
[
0
];
SNodeInfo
*
pNode
=
&
pCfg
->
nodeInfo
[
0
];
tstrncpy
(
pNode
->
nodeFqdn
,
pMgmt
->
replica
.
fqdn
,
sizeof
(
pNode
->
nodeFqdn
));
tstrncpy
(
pNode
->
nodeFqdn
,
pMgmt
->
replica
.
fqdn
,
sizeof
(
pNode
->
nodeFqdn
));
pNode
->
nodePort
=
pMgmt
->
replica
.
port
;
pNode
->
nodePort
=
pMgmt
->
replica
.
port
;
mInfo
(
"
fqdn:%s port
:%u"
,
pNode
->
nodeFqdn
,
pNode
->
nodePort
);
mInfo
(
"
mnode ep:%s
:%u"
,
pNode
->
nodeFqdn
,
pNode
->
nodePort
);
}
}
tsem_init
(
&
pMgmt
->
syncSem
,
0
,
0
);
tsem_init
(
&
pMgmt
->
syncSem
,
0
,
0
);
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
294acc9e
...
@@ -131,7 +131,7 @@ int32_t tsdbReaderOpen(SVnode *pVnode, SQueryTableDataCond *pCond, SArray *pTabl
...
@@ -131,7 +131,7 @@ int32_t tsdbReaderOpen(SVnode *pVnode, SQueryTableDataCond *pCond, SArray *pTabl
void
tsdbReaderClose
(
STsdbReader
*
pReader
);
void
tsdbReaderClose
(
STsdbReader
*
pReader
);
bool
tsdbNextDataBlock
(
STsdbReader
*
pReader
);
bool
tsdbNextDataBlock
(
STsdbReader
*
pReader
);
void
tsdbRetrieveDataBlockInfo
(
STsdbReader
*
pReader
,
SDataBlockInfo
*
pDataBlockInfo
);
void
tsdbRetrieveDataBlockInfo
(
STsdbReader
*
pReader
,
SDataBlockInfo
*
pDataBlockInfo
);
int32_t
tsdbRetrieveData
BlockStatisInfo
(
STsdbReader
*
pReader
,
SColumnDataAgg
***
pBlockStatis
,
bool
*
allHave
);
int32_t
tsdbRetrieveData
blockSMA
(
STsdbReader
*
pReader
,
SColumnDataAgg
***
pBlockStatis
,
bool
*
allHave
);
SArray
*
tsdbRetrieveDataBlock
(
STsdbReader
*
pTsdbReadHandle
,
SArray
*
pColumnIdList
);
SArray
*
tsdbRetrieveDataBlock
(
STsdbReader
*
pTsdbReadHandle
,
SArray
*
pColumnIdList
);
int32_t
tsdbReaderReset
(
STsdbReader
*
pReader
,
SQueryTableDataCond
*
pCond
,
int32_t
tWinIdx
);
int32_t
tsdbReaderReset
(
STsdbReader
*
pReader
,
SQueryTableDataCond
*
pCond
,
int32_t
tWinIdx
);
int32_t
tsdbGetFileBlocksDistInfo
(
STsdbReader
*
pReader
,
STableBlockDistInfo
*
pTableBlockInfo
);
int32_t
tsdbGetFileBlocksDistInfo
(
STsdbReader
*
pReader
,
STableBlockDistInfo
*
pTableBlockInfo
);
...
...
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
294acc9e
...
@@ -245,6 +245,8 @@ int32_t tsdbCacheRelease(SLRUCache *pCache, LRUHandle *h);
...
@@ -245,6 +245,8 @@ int32_t tsdbCacheRelease(SLRUCache *pCache, LRUHandle *h);
int32_t
tsdbCacheDelete
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
TSKEY
eKey
);
int32_t
tsdbCacheDelete
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
TSKEY
eKey
);
int32_t
tsdbCacheLastArray2Row
(
SArray
*
pLastArray
,
STSRow
**
ppRow
,
STSchema
*
pSchema
);
// structs =======================
// structs =======================
typedef
struct
{
typedef
struct
{
int
minFid
;
int
minFid
;
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
294acc9e
...
@@ -277,8 +277,9 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaInfo
...
@@ -277,8 +277,9 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaInfo
pItem
->
maxDelay
=
TSDB_MAX_ROLLUP_MAX_DELAY
;
pItem
->
maxDelay
=
TSDB_MAX_ROLLUP_MAX_DELAY
;
}
}
pItem
->
level
=
(
idx
==
0
?
TSDB_RETENTION_L1
:
TSDB_RETENTION_L2
);
pItem
->
level
=
(
idx
==
0
?
TSDB_RETENTION_L1
:
TSDB_RETENTION_L2
);
smaInfo
(
"vgId:%d table:%"
PRIi64
" level:%"
PRIi8
" maxdelay:%"
PRIi64
" watermark:%"
PRIi64
", finally maxdelay:%"
PRIi32
,
SMA_VID
(
pSma
),
smaInfo
(
"vgId:%d table:%"
PRIi64
" level:%"
PRIi8
" maxdelay:%"
PRIi64
" watermark:%"
PRIi64
pRSmaInfo
->
suid
,
idx
+
1
,
param
->
maxdelay
[
idx
],
param
->
watermark
[
idx
],
pItem
->
maxDelay
);
", finally maxdelay:%"
PRIi32
,
SMA_VID
(
pSma
),
pRSmaInfo
->
suid
,
idx
+
1
,
param
->
maxdelay
[
idx
],
param
->
watermark
[
idx
],
pItem
->
maxDelay
);
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
_err:
_err:
...
@@ -572,11 +573,15 @@ static int32_t tdFetchAndSubmitRSmaResult(SRSmaInfoItem *pItem, int8_t blkType)
...
@@ -572,11 +573,15 @@ static int32_t tdFetchAndSubmitRSmaResult(SRSmaInfoItem *pItem, int8_t blkType)
SSubmitReq
*
pReq
=
NULL
;
SSubmitReq
*
pReq
=
NULL
;
// TODO: the schema update should be handled
// TODO: the schema update should be handled
if
(
buildSubmitReqFromDataBlock
(
&
pReq
,
pResult
,
pRSmaInfo
->
pTSchema
,
SMA_VID
(
pSma
),
pRSmaInfo
->
suid
)
<
0
)
{
if
(
buildSubmitReqFromDataBlock
(
&
pReq
,
pResult
,
pRSmaInfo
->
pTSchema
,
SMA_VID
(
pSma
),
pRSmaInfo
->
suid
)
<
0
)
{
smaError
(
"vgId:%d, build submit req for rsma table %"
PRIi64
"l evel %"
PRIi8
" failed since %s"
,
SMA_VID
(
pSma
),
pRSmaInfo
->
suid
,
pItem
->
level
,
terrstr
());
goto
_err
;
goto
_err
;
}
}
if
(
pReq
&&
tdProcessSubmitReq
(
sinkTsdb
,
atomic_add_fetch_64
(
&
pRSmaInfo
->
pStat
->
submitVer
,
1
),
pReq
)
<
0
)
{
if
(
pReq
&&
tdProcessSubmitReq
(
sinkTsdb
,
atomic_add_fetch_64
(
&
pRSmaInfo
->
pStat
->
submitVer
,
1
),
pReq
)
<
0
)
{
taosMemoryFreeClear
(
pReq
);
taosMemoryFreeClear
(
pReq
);
smaError
(
"vgId:%d, process submit req for rsma table %"
PRIi64
" level %"
PRIi8
" failed since %s"
,
SMA_VID
(
pSma
),
pRSmaInfo
->
suid
,
pItem
->
level
,
terrstr
());
goto
_err
;
goto
_err
;
}
}
...
...
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
294acc9e
...
@@ -59,6 +59,8 @@ static void getTableCacheKey(tb_uid_t uid, int cacheType, char *key, int *len) {
...
@@ -59,6 +59,8 @@ static void getTableCacheKey(tb_uid_t uid, int cacheType, char *key, int *len) {
static
void
deleteTableCacheLastrow
(
const
void
*
key
,
size_t
keyLen
,
void
*
value
)
{
taosMemoryFree
(
value
);
}
static
void
deleteTableCacheLastrow
(
const
void
*
key
,
size_t
keyLen
,
void
*
value
)
{
taosMemoryFree
(
value
);
}
static
void
deleteTableCacheLast
(
const
void
*
key
,
size_t
keyLen
,
void
*
value
)
{
taosArrayDestroy
(
value
);
}
static
int32_t
tsdbCacheDeleteLastrow
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
TSKEY
eKey
)
{
static
int32_t
tsdbCacheDeleteLastrow
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
TSKEY
eKey
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
char
key
[
32
]
=
{
0
};
char
key
[
32
]
=
{
0
};
...
@@ -761,7 +763,6 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, STSRow **ppRo
...
@@ -761,7 +763,6 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, STSRow **ppRo
for
(
int
i
=
0
;
i
<
nMax
;
++
i
)
{
for
(
int
i
=
0
;
i
<
nMax
;
++
i
)
{
TSDBKEY
maxKey
=
TSDBROW_KEY
(
max
[
i
]);
TSDBKEY
maxKey
=
TSDBROW_KEY
(
max
[
i
]);
// bool deleted = false;
bool
deleted
=
tsdbKeyDeleted
(
&
maxKey
,
pSkyline
,
&
iSkyline
);
bool
deleted
=
tsdbKeyDeleted
(
&
maxKey
,
pSkyline
,
&
iSkyline
);
if
(
!
deleted
)
{
if
(
!
deleted
)
{
// iMerge[nMerge] = i;
// iMerge[nMerge] = i;
...
@@ -818,12 +819,22 @@ _err:
...
@@ -818,12 +819,22 @@ _err:
return
code
;
return
code
;
}
}
static
int32_t
mergeLast
(
tb_uid_t
uid
,
STsdb
*
pTsdb
,
STSRow
**
ppRow
)
{
typedef
struct
{
int32_t
code
=
0
;
TSKEY
ts
;
SColVal
colVal
;
}
SLastCol
;
// static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
static
int32_t
mergeLast
(
tb_uid_t
uid
,
STsdb
*
pTsdb
,
SArray
**
ppLastArray
)
{
int32_t
code
=
0
;
SArray
*
pSkyline
=
NULL
;
STSRow
*
pRow
=
NULL
;
STSRow
**
ppRow
=
&
pRow
;
STSchema
*
pTSchema
=
metaGetTbTSchema
(
pTsdb
->
pVnode
->
pMeta
,
uid
,
-
1
);
STSchema
*
pTSchema
=
metaGetTbTSchema
(
pTsdb
->
pVnode
->
pMeta
,
uid
,
-
1
);
int16_t
nCol
=
pTSchema
->
numOfCols
;
int16_t
nCol
=
pTSchema
->
numOfCols
;
SArray
*
pColArray
=
taosArrayInit
(
nCol
,
sizeof
(
SColVal
));
// SArray *pColArray = taosArrayInit(nCol, sizeof(SColVal));
SArray
*
pColArray
=
taosArrayInit
(
nCol
,
sizeof
(
SLastCol
));
tb_uid_t
suid
=
getTableSuidByUid
(
uid
,
pTsdb
);
tb_uid_t
suid
=
getTableSuidByUid
(
uid
,
pTsdb
);
...
@@ -837,9 +848,9 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
...
@@ -837,9 +848,9 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
tsdbGetTbDataFromMemTable
(
pTsdb
->
imem
,
suid
,
uid
,
&
pIMem
);
tsdbGetTbDataFromMemTable
(
pTsdb
->
imem
,
suid
,
uid
,
&
pIMem
);
}
}
*
pp
Row
=
NULL
;
*
pp
LastArray
=
NULL
;
SArray
*
pSkyline
=
taosArrayInit
(
32
,
sizeof
(
TSDBKEY
));
pSkyline
=
taosArrayInit
(
32
,
sizeof
(
TSDBKEY
));
SDelIdx
delIdx
;
SDelIdx
delIdx
;
...
@@ -943,7 +954,6 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
...
@@ -943,7 +954,6 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
for
(
int
i
=
0
;
i
<
nMax
;
++
i
)
{
for
(
int
i
=
0
;
i
<
nMax
;
++
i
)
{
TSDBKEY
maxKey
=
TSDBROW_KEY
(
max
[
i
]);
TSDBKEY
maxKey
=
TSDBROW_KEY
(
max
[
i
]);
// bool deleted = false;
bool
deleted
=
tsdbKeyDeleted
(
&
maxKey
,
pSkyline
,
&
iSkyline
);
bool
deleted
=
tsdbKeyDeleted
(
&
maxKey
,
pSkyline
,
&
iSkyline
);
if
(
!
deleted
)
{
if
(
!
deleted
)
{
iMerge
[
nMerge
]
=
iMax
[
i
];
iMerge
[
nMerge
]
=
iMax
[
i
];
...
@@ -970,8 +980,9 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
...
@@ -970,8 +980,9 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
tRowMergerClear
(
&
merger
);
tRowMergerClear
(
&
merger
);
}
}
}
else
{
}
else
{
*
ppRow
=
NULL
;
/* *ppRow = NULL; */
return
code
;
/* return code; */
continue
;
}
}
if
(
iCol
==
0
)
{
if
(
iCol
==
0
)
{
...
@@ -980,7 +991,8 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
...
@@ -980,7 +991,8 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
*
pColVal
=
COL_VAL_VALUE
(
pTColumn
->
colId
,
pTColumn
->
type
,
(
SValue
){.
ts
=
maxKey
});
*
pColVal
=
COL_VAL_VALUE
(
pTColumn
->
colId
,
pTColumn
->
type
,
(
SValue
){.
ts
=
maxKey
});
if
(
taosArrayPush
(
pColArray
,
pColVal
)
==
NULL
)
{
// if (taosArrayPush(pColArray, pColVal) == NULL) {
if
(
taosArrayPush
(
pColArray
,
&
(
SLastCol
){.
ts
=
TSKEY_MAX
,
.
colVal
=
*
pColVal
})
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
code
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_err
;
goto
_err
;
}
}
...
@@ -991,7 +1003,8 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
...
@@ -991,7 +1003,8 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
for
(
int16_t
i
=
iCol
;
i
<
nCol
;
++
i
)
{
for
(
int16_t
i
=
iCol
;
i
<
nCol
;
++
i
)
{
// tsdbRowGetColVal(*ppRow, pTSchema, i, pColVal);
// tsdbRowGetColVal(*ppRow, pTSchema, i, pColVal);
tTSRowGetVal
(
*
ppRow
,
pTSchema
,
i
,
pColVal
);
tTSRowGetVal
(
*
ppRow
,
pTSchema
,
i
,
pColVal
);
if
(
taosArrayPush
(
pColArray
,
pColVal
)
==
NULL
)
{
// if (taosArrayPush(pColArray, pColVal) == NULL) {
if
(
taosArrayPush
(
pColArray
,
&
(
SLastCol
){.
ts
=
maxKey
,
.
colVal
=
*
pColVal
})
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
code
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_err
;
goto
_err
;
}
}
...
@@ -1012,11 +1025,11 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
...
@@ -1012,11 +1025,11 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
--
nilColCount
;
--
nilColCount
;
}
}
}
}
/*
if
(
*
ppRow
)
{
if
(
*
ppRow
)
{
taosMemoryFreeClear
(
*
ppRow
);
taosMemoryFreeClear
(
*
ppRow
);
}
}
*/
continue
;
continue
;
}
}
...
@@ -1024,12 +1037,16 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
...
@@ -1024,12 +1037,16 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
for
(
int16_t
i
=
iCol
;
i
<
nCol
;
++
i
)
{
for
(
int16_t
i
=
iCol
;
i
<
nCol
;
++
i
)
{
SColVal
colVal
=
{
0
};
SColVal
colVal
=
{
0
};
tTSRowGetVal
(
*
ppRow
,
pTSchema
,
i
,
&
colVal
);
tTSRowGetVal
(
*
ppRow
,
pTSchema
,
i
,
&
colVal
);
TSKEY
rowTs
=
(
*
ppRow
)
->
ts
;
SColVal
*
tColVal
=
(
SColVal
*
)
taosArrayGet
(
pColArray
,
i
);
// SColVal *tColVal = (SColVal *)taosArrayGet(pColArray, i);
SLastCol
*
tTsVal
=
(
SLastCol
*
)
taosArrayGet
(
pColArray
,
i
);
SColVal
*
tColVal
=
&
tTsVal
->
colVal
;
if
(
!
colVal
.
isNone
&&
!
colVal
.
isNull
)
{
if
(
!
colVal
.
isNone
&&
!
colVal
.
isNull
)
{
if
(
tColVal
->
isNull
||
tColVal
->
isNone
)
{
if
(
tColVal
->
isNull
||
tColVal
->
isNone
)
{
taosArraySet
(
pColArray
,
i
,
&
colVal
);
// taosArraySet(pColArray, i, &colVal);
taosArraySet
(
pColArray
,
i
,
&
(
SLastCol
){.
ts
=
rowTs
,
.
colVal
=
colVal
});
--
nilColCount
;
--
nilColCount
;
}
}
}
else
{
}
else
{
...
@@ -1054,16 +1071,45 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
...
@@ -1054,16 +1071,45 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, STSRow **ppRow) {
}
while
(
nilColCount
>
0
);
}
while
(
nilColCount
>
0
);
// if () new ts row from pColArray if non empty
// if () new ts row from pColArray if non empty
if
(
taosArrayGetSize
(
pColArray
)
==
nCol
)
{
/* if (taosArrayGetSize(pColArray) == nCol) { */
code
=
tdSTSRowNew
(
pColArray
,
pTSchema
,
ppRow
);
/* code = tdSTSRowNew(pColArray, pTSchema, ppRow); */
if
(
code
)
goto
_err
;
/* if (code) goto _err; */
/* } */
/* taosArrayDestroy(pColArray); */
if
(
taosArrayGetSize
(
pColArray
)
<=
0
)
{
*
ppLastArray
=
NULL
;
taosArrayDestroy
(
pColArray
);
}
else
{
*
ppLastArray
=
pColArray
;
}
if
(
*
ppRow
)
{
taosMemoryFreeClear
(
*
ppRow
);
}
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
if
(
input
[
i
].
nextRowClearFn
)
{
input
[
i
].
nextRowClearFn
(
input
[
i
].
iter
);
}
}
if
(
pSkyline
)
{
taosArrayDestroy
(
pSkyline
);
}
}
taosArrayDestroy
(
pColArray
);
taosMemoryFreeClear
(
pTSchema
);
taosMemoryFreeClear
(
pTSchema
);
return
code
;
return
code
;
_err:
_err:
taosArrayDestroy
(
pColArray
);
taosArrayDestroy
(
pColArray
);
if
(
*
ppRow
)
{
taosMemoryFreeClear
(
*
ppRow
);
}
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
if
(
input
[
i
].
nextRowClearFn
)
{
input
[
i
].
nextRowClearFn
(
input
[
i
].
iter
);
}
}
if
(
pSkyline
)
{
taosArrayDestroy
(
pSkyline
);
}
taosMemoryFreeClear
(
pTSchema
);
taosMemoryFreeClear
(
pTSchema
);
tsdbError
(
"vgId:%d merge last_row failed since %s"
,
TD_VID
(
pTsdb
->
pVnode
),
tstrerror
(
code
));
tsdbError
(
"vgId:%d merge last_row failed since %s"
,
TD_VID
(
pTsdb
->
pVnode
),
tstrerror
(
code
));
return
code
;
return
code
;
...
@@ -1103,6 +1149,30 @@ int32_t tsdbCacheGetLastrowH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUH
...
@@ -1103,6 +1149,30 @@ int32_t tsdbCacheGetLastrowH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUH
return
code
;
return
code
;
}
}
int32_t
tsdbCacheLastArray2Row
(
SArray
*
pLastArray
,
STSRow
**
ppRow
,
STSchema
*
pTSchema
)
{
int32_t
code
=
0
;
int16_t
nCol
=
taosArrayGetSize
(
pLastArray
);
SArray
*
pColArray
=
taosArrayInit
(
nCol
,
sizeof
(
SColVal
));
for
(
int16_t
iCol
=
0
;
iCol
<
nCol
;
++
iCol
)
{
SLastCol
*
tTsVal
=
(
SLastCol
*
)
taosArrayGet
(
pLastArray
,
iCol
);
SColVal
*
tColVal
=
&
tTsVal
->
colVal
;
taosArrayPush
(
pColArray
,
tColVal
);
}
code
=
tdSTSRowNew
(
pColArray
,
pTSchema
,
ppRow
);
if
(
code
)
goto
_err
;
taosArrayDestroy
(
pColArray
);
return
code
;
_err:
taosArrayDestroy
(
pColArray
);
return
code
;
}
int32_t
tsdbCacheGetLastH
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
STsdb
*
pTsdb
,
LRUHandle
**
handle
)
{
int32_t
tsdbCacheGetLastH
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
STsdb
*
pTsdb
,
LRUHandle
**
handle
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
char
key
[
32
]
=
{
0
};
char
key
[
32
]
=
{
0
};
...
@@ -1115,17 +1185,20 @@ int32_t tsdbCacheGetLastH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUHand
...
@@ -1115,17 +1185,20 @@ int32_t tsdbCacheGetLastH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUHand
//*ppRow = (STSRow *)taosLRUCacheValue(pCache, h);
//*ppRow = (STSRow *)taosLRUCacheValue(pCache, h);
}
else
{
}
else
{
STSRow
*
pRow
=
NULL
;
// STSRow *pRow = NULL;
code
=
mergeLast
(
uid
,
pTsdb
,
&
pRow
);
// code = mergeLast(uid, pTsdb, &pRow);
SArray
*
pLastArray
=
NULL
;
code
=
mergeLast
(
uid
,
pTsdb
,
&
pLastArray
);
// if table's empty or error, return code of -1
// if table's empty or error, return code of -1
if
(
code
<
0
||
pRow
==
NULL
)
{
// if (code < 0 || pRow == NULL) {
if
(
code
<
0
||
pLastArray
==
NULL
)
{
*
handle
=
NULL
;
*
handle
=
NULL
;
return
0
;
return
0
;
}
}
_taos_lru_deleter_t
deleter
=
deleteTableCacheLast
row
;
_taos_lru_deleter_t
deleter
=
deleteTableCacheLast
;
LRUStatus
status
=
LRUStatus
status
=
taosLRUCacheInsert
(
pCache
,
key
,
keyLen
,
p
Row
,
TD_ROW_LEN
(
pRow
)
,
deleter
,
NULL
,
TAOS_LRU_PRIORITY_LOW
);
taosLRUCacheInsert
(
pCache
,
key
,
keyLen
,
p
LastArray
,
pLastArray
->
capacity
,
deleter
,
NULL
,
TAOS_LRU_PRIORITY_LOW
);
if
(
status
!=
TAOS_LRU_STATUS_OK
)
{
if
(
status
!=
TAOS_LRU_STATUS_OK
)
{
code
=
-
1
;
code
=
-
1
;
}
}
...
...
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
浏览文件 @
294acc9e
...
@@ -128,6 +128,8 @@ int32_t tsdbRetrieveLastRow(void* pReader, SSDataBlock* pResBlock, const int32_t
...
@@ -128,6 +128,8 @@ int32_t tsdbRetrieveLastRow(void* pReader, SSDataBlock* pResBlock, const int32_t
}
}
pRow
=
(
STSRow
*
)
taosLRUCacheValue
(
lruCache
,
h
);
pRow
=
(
STSRow
*
)
taosLRUCacheValue
(
lruCache
,
h
);
// SArray* pLast = (SArray*)taosLRUCacheValue(lruCache, h);
// tsdbCacheLastArray2Row(pLast, &pRow, pr->pSchema);
if
(
pRow
->
ts
>
lastKey
)
{
if
(
pRow
->
ts
>
lastKey
)
{
// Set result row into the same rowIndex repeatly, so we need to check if the internal result row has already
// Set result row into the same rowIndex repeatly, so we need to check if the internal result row has already
// appended or not.
// appended or not.
...
@@ -140,6 +142,7 @@ int32_t tsdbRetrieveLastRow(void* pReader, SSDataBlock* pResBlock, const int32_t
...
@@ -140,6 +142,7 @@ int32_t tsdbRetrieveLastRow(void* pReader, SSDataBlock* pResBlock, const int32_t
lastKey
=
pRow
->
ts
;
lastKey
=
pRow
->
ts
;
}
}
// taosMemoryFree(pRow);
tsdbCacheRelease
(
lruCache
,
h
);
tsdbCacheRelease
(
lruCache
,
h
);
}
}
}
else
if
(
pr
->
type
==
LASTROW_RETRIEVE_TYPE_ALL
)
{
}
else
if
(
pr
->
type
==
LASTROW_RETRIEVE_TYPE_ALL
)
{
...
@@ -158,8 +161,12 @@ int32_t tsdbRetrieveLastRow(void* pReader, SSDataBlock* pResBlock, const int32_t
...
@@ -158,8 +161,12 @@ int32_t tsdbRetrieveLastRow(void* pReader, SSDataBlock* pResBlock, const int32_t
}
}
pRow
=
(
STSRow
*
)
taosLRUCacheValue
(
lruCache
,
h
);
pRow
=
(
STSRow
*
)
taosLRUCacheValue
(
lruCache
,
h
);
// SArray* pLast = (SArray*)taosLRUCacheValue(lruCache, h);
// tsdbCacheLastArray2Row(pLast, &pRow, pr->pSchema);
saveOneRow
(
pRow
,
pResBlock
,
pr
,
slotIds
);
saveOneRow
(
pRow
,
pResBlock
,
pr
,
slotIds
);
// taosMemoryFree(pRow);
tsdbCacheRelease
(
lruCache
,
h
);
tsdbCacheRelease
(
lruCache
,
h
);
pr
->
tableIndex
+=
1
;
pr
->
tableIndex
+=
1
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
294acc9e
此差异已折叠。
点击以展开。
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
浏览文件 @
294acc9e
...
@@ -1158,7 +1158,7 @@ _err:
...
@@ -1158,7 +1158,7 @@ _err:
int32_t
tsdbReadBlockSma
(
SDataFReader
*
pReader
,
SBlock
*
pBlock
,
SArray
*
aColumnDataAgg
,
uint8_t
**
ppBuf
)
{
int32_t
tsdbReadBlockSma
(
SDataFReader
*
pReader
,
SBlock
*
pBlock
,
SArray
*
aColumnDataAgg
,
uint8_t
**
ppBuf
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
TdFilePtr
pFD
=
pReader
->
pSmaFD
;
TdFilePtr
pFD
=
pReader
->
pSmaFD
;
int64_t
offset
=
pBlock
->
aSubBlock
[
0
].
o
ffset
;
int64_t
offset
=
pBlock
->
aSubBlock
[
0
].
sO
ffset
;
int64_t
size
=
pBlock
->
aSubBlock
[
0
].
nSma
*
sizeof
(
SColumnDataAgg
)
+
sizeof
(
TSCKSUM
);
int64_t
size
=
pBlock
->
aSubBlock
[
0
].
nSma
*
sizeof
(
SColumnDataAgg
)
+
sizeof
(
TSCKSUM
);
uint8_t
*
pBuf
=
NULL
;
uint8_t
*
pBuf
=
NULL
;
int64_t
n
;
int64_t
n
;
...
@@ -1181,10 +1181,13 @@ int32_t tsdbReadBlockSma(SDataFReader *pReader, SBlock *pBlock, SArray *aColumnD
...
@@ -1181,10 +1181,13 @@ int32_t tsdbReadBlockSma(SDataFReader *pReader, SBlock *pBlock, SArray *aColumnD
if
(
n
<
0
)
{
if
(
n
<
0
)
{
code
=
TAOS_SYSTEM_ERROR
(
errno
);
code
=
TAOS_SYSTEM_ERROR
(
errno
);
goto
_err
;
goto
_err
;
}
else
if
(
n
<
size
)
{
code
=
TSDB_CODE_FILE_CORRUPTED
;
goto
_err
;
}
}
// check
// check
if
(
!
taosCheckChecksumWhole
(
NULL
,
size
))
{
if
(
!
taosCheckChecksumWhole
(
*
ppBuf
,
size
))
{
code
=
TSDB_CODE_FILE_CORRUPTED
;
code
=
TSDB_CODE_FILE_CORRUPTED
;
goto
_err
;
goto
_err
;
}
}
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
294acc9e
...
@@ -1235,10 +1235,26 @@ void tsdbCalcColDataSMA(SColData *pColData, SColumnDataAgg *pColAgg) {
...
@@ -1235,10 +1235,26 @@ void tsdbCalcColDataSMA(SColData *pColData, SColumnDataAgg *pColAgg) {
break
;
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
case
TSDB_DATA_TYPE_SMALLINT
:
break
;
break
;
case
TSDB_DATA_TYPE_INT
:
case
TSDB_DATA_TYPE_INT
:
{
pColAgg
->
sum
+=
colVal
.
value
.
i32
;
if
(
pColAgg
->
min
>
colVal
.
value
.
i32
)
{
pColAgg
->
min
=
colVal
.
value
.
i32
;
}
if
(
pColAgg
->
max
<
colVal
.
value
.
i32
)
{
pColAgg
->
max
=
colVal
.
value
.
i32
;
}
break
;
break
;
case
TSDB_DATA_TYPE_BIGINT
:
}
case
TSDB_DATA_TYPE_BIGINT
:
{
pColAgg
->
sum
+=
colVal
.
value
.
i64
;
if
(
pColAgg
->
min
>
colVal
.
value
.
i64
)
{
pColAgg
->
min
=
colVal
.
value
.
i64
;
}
if
(
pColAgg
->
max
<
colVal
.
value
.
i64
)
{
pColAgg
->
max
=
colVal
.
value
.
i64
;
}
break
;
break
;
}
case
TSDB_DATA_TYPE_FLOAT
:
case
TSDB_DATA_TYPE_FLOAT
:
break
;
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
case
TSDB_DATA_TYPE_DOUBLE
:
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
294acc9e
...
@@ -741,10 +741,10 @@ static int32_t doCreateConstantValColumnAggInfo(SInputColumnInfoData* pInput, SF
...
@@ -741,10 +741,10 @@ static int32_t doCreateConstantValColumnAggInfo(SInputColumnInfoData* pInput, SF
if
(
type
==
TSDB_DATA_TYPE_BIGINT
)
{
if
(
type
==
TSDB_DATA_TYPE_BIGINT
)
{
int64_t
v
=
pFuncParam
->
param
.
i
;
int64_t
v
=
pFuncParam
->
param
.
i
;
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
,
.
min
=
v
,
.
max
=
v
,
.
maxIndex
=
0
,
.
minIndex
=
0
,
.
sum
=
v
*
numOfRows
};
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
,
.
min
=
v
,
.
max
=
v
,
.
sum
=
v
*
numOfRows
};
}
else
if
(
type
==
TSDB_DATA_TYPE_DOUBLE
)
{
}
else
if
(
type
==
TSDB_DATA_TYPE_DOUBLE
)
{
double
v
=
pFuncParam
->
param
.
d
;
double
v
=
pFuncParam
->
param
.
d
;
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
,
.
maxIndex
=
0
,
.
minIndex
=
0
};
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
};
*
(
double
*
)
&
da
->
min
=
v
;
*
(
double
*
)
&
da
->
min
=
v
;
*
(
double
*
)
&
da
->
max
=
v
;
*
(
double
*
)
&
da
->
max
=
v
;
...
@@ -752,7 +752,7 @@ static int32_t doCreateConstantValColumnAggInfo(SInputColumnInfoData* pInput, SF
...
@@ -752,7 +752,7 @@ static int32_t doCreateConstantValColumnAggInfo(SInputColumnInfoData* pInput, SF
}
else
if
(
type
==
TSDB_DATA_TYPE_BOOL
)
{
// todo validate this data type
}
else
if
(
type
==
TSDB_DATA_TYPE_BOOL
)
{
// todo validate this data type
bool
v
=
pFuncParam
->
param
.
i
;
bool
v
=
pFuncParam
->
param
.
i
;
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
,
.
maxIndex
=
0
,
.
minIndex
=
0
};
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
};
*
(
bool
*
)
&
da
->
min
=
0
;
*
(
bool
*
)
&
da
->
min
=
0
;
*
(
bool
*
)
&
da
->
max
=
v
;
*
(
bool
*
)
&
da
->
max
=
v
;
*
(
bool
*
)
&
da
->
sum
=
v
*
numOfRows
;
*
(
bool
*
)
&
da
->
sum
=
v
*
numOfRows
;
...
@@ -1130,7 +1130,7 @@ int32_t loadDataBlockOnDemand(SExecTaskInfo* pTaskInfo, STableScanInfo* pTableSc
...
@@ -1130,7 +1130,7 @@ int32_t loadDataBlockOnDemand(SExecTaskInfo* pTaskInfo, STableScanInfo* pTableSc
} else if ((*status) == BLK_DATA_SMA_LOAD) {
} else if ((*status) == BLK_DATA_SMA_LOAD) {
// this function never returns error?
// this function never returns error?
pCost->loadBlockStatis += 1;
pCost->loadBlockStatis += 1;
// tsdbRetrieveData
BlockStatisInfo
(pTableScanInfo->pTsdbReadHandle, &pBlock->pBlockAgg);
// tsdbRetrieveData
blockSMA
(pTableScanInfo->pTsdbReadHandle, &pBlock->pBlockAgg);
if (pBlock->pBlockAgg == NULL) { // data block statistics does not exist, load data block
if (pBlock->pBlockAgg == NULL) { // data block statistics does not exist, load data block
// pBlock->pDataBlock = tsdbRetrieveDataBlock(pTableScanInfo->pTsdbReadHandle, NULL);
// pBlock->pDataBlock = tsdbRetrieveDataBlock(pTableScanInfo->pTsdbReadHandle, NULL);
...
@@ -1141,7 +1141,7 @@ int32_t loadDataBlockOnDemand(SExecTaskInfo* pTaskInfo, STableScanInfo* pTableSc
...
@@ -1141,7 +1141,7 @@ int32_t loadDataBlockOnDemand(SExecTaskInfo* pTaskInfo, STableScanInfo* pTableSc
// load the data block statistics to perform further filter
// load the data block statistics to perform further filter
pCost->loadBlockStatis += 1;
pCost->loadBlockStatis += 1;
// tsdbRetrieveData
BlockStatisInfo
(pTableScanInfo->pTsdbReadHandle, &pBlock->pBlockAgg);
// tsdbRetrieveData
blockSMA
(pTableScanInfo->pTsdbReadHandle, &pBlock->pBlockAgg);
if (pQueryAttr->topBotQuery && pBlock->pBlockAgg != NULL) {
if (pQueryAttr->topBotQuery && pBlock->pBlockAgg != NULL) {
{ // set previous window
{ // set previous window
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
294acc9e
...
@@ -210,7 +210,10 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanInfo* pTableSca
...
@@ -210,7 +210,10 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanInfo* pTableSca
bool
allColumnsHaveAgg
=
true
;
bool
allColumnsHaveAgg
=
true
;
SColumnDataAgg
**
pColAgg
=
NULL
;
SColumnDataAgg
**
pColAgg
=
NULL
;
tsdbRetrieveDataBlockStatisInfo
(
pTableScanInfo
->
dataReader
,
&
pColAgg
,
&
allColumnsHaveAgg
);
int32_t
code
=
tsdbRetrieveDatablockSMA
(
pTableScanInfo
->
dataReader
,
&
pColAgg
,
&
allColumnsHaveAgg
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
longjmp
(
pTaskInfo
->
env
,
code
);
}
if
(
allColumnsHaveAgg
==
true
)
{
if
(
allColumnsHaveAgg
==
true
)
{
int32_t
numOfCols
=
taosArrayGetSize
(
pBlock
->
pDataBlock
);
int32_t
numOfCols
=
taosArrayGetSize
(
pBlock
->
pDataBlock
);
...
@@ -1248,11 +1251,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
...
@@ -1248,11 +1251,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
pInfo
->
pRes
->
info
.
type
=
STREAM_NORMAL
;
pInfo
->
pRes
->
info
.
type
=
STREAM_NORMAL
;
pInfo
->
pRes
->
info
.
capacity
=
block
.
info
.
rows
;
pInfo
->
pRes
->
info
.
capacity
=
block
.
info
.
rows
;
// for generating rollup SMA result, each time is an independent time serie.
// TODO temporarily used, when the statement of "partition by tbname" is ready, remove this
if
(
pInfo
->
assignBlockUid
)
{
pInfo
->
pRes
->
info
.
groupId
=
block
.
info
.
uid
;
}
uint64_t
*
groupIdPre
=
taosHashGet
(
pOperator
->
pTaskInfo
->
tableqinfoList
.
map
,
&
block
.
info
.
uid
,
sizeof
(
int64_t
));
uint64_t
*
groupIdPre
=
taosHashGet
(
pOperator
->
pTaskInfo
->
tableqinfoList
.
map
,
&
block
.
info
.
uid
,
sizeof
(
int64_t
));
if
(
groupIdPre
)
{
if
(
groupIdPre
)
{
...
@@ -1261,6 +1260,12 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
...
@@ -1261,6 +1260,12 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
pInfo
->
pRes
->
info
.
groupId
=
0
;
pInfo
->
pRes
->
info
.
groupId
=
0
;
}
}
// for generating rollup SMA result, each time is an independent time serie.
// TODO temporarily used, when the statement of "partition by tbname" is ready, remove this
if
(
pInfo
->
assignBlockUid
)
{
pInfo
->
pRes
->
info
.
groupId
=
block
.
info
.
uid
;
}
// todo extract method
// todo extract method
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pInfo
->
pColMatchInfo
);
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pInfo
->
pColMatchInfo
);
++
i
)
{
SColMatchInfo
*
pColMatchInfo
=
taosArrayGet
(
pInfo
->
pColMatchInfo
,
i
);
SColMatchInfo
*
pColMatchInfo
=
taosArrayGet
(
pInfo
->
pColMatchInfo
,
i
);
...
@@ -2347,7 +2352,7 @@ static int32_t loadDataBlockFromOneTable(SOperatorInfo* pOperator, STableMergeSc
...
@@ -2347,7 +2352,7 @@ static int32_t loadDataBlockFromOneTable(SOperatorInfo* pOperator, STableMergeSc
bool
allColumnsHaveAgg
=
true
;
bool
allColumnsHaveAgg
=
true
;
SColumnDataAgg
**
pColAgg
=
NULL
;
SColumnDataAgg
**
pColAgg
=
NULL
;
STsdbReader
*
reader
=
taosArrayGetP
(
pTableScanInfo
->
dataReaders
,
readerIdx
);
STsdbReader
*
reader
=
taosArrayGetP
(
pTableScanInfo
->
dataReaders
,
readerIdx
);
tsdbRetrieveData
BlockStatisInfo
(
reader
,
&
pColAgg
,
&
allColumnsHaveAgg
);
tsdbRetrieveData
blockSMA
(
reader
,
&
pColAgg
,
&
allColumnsHaveAgg
);
if
(
allColumnsHaveAgg
==
true
)
{
if
(
allColumnsHaveAgg
==
true
)
{
int32_t
numOfCols
=
taosArrayGetSize
(
pBlock
->
pDataBlock
);
int32_t
numOfCols
=
taosArrayGetSize
(
pBlock
->
pDataBlock
);
...
...
source/libs/function/inc/fnLog.h
浏览文件 @
294acc9e
...
@@ -10,12 +10,14 @@
...
@@ -10,12 +10,14 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#define fnFatal(...) { if (fnDebugFlag & DEBUG_FATAL) { taosPrintLog("FN FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }}
// clang-format off
#define fnError(...) { if (fnDebugFlag & DEBUG_ERROR) { taosPrintLog("FN ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }}
#define fnFatal(...) { if (udfDebugFlag & DEBUG_FATAL) { taosPrintLog("UDF FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }}
#define fnWarn(...) { if (fnDebugFlag & DEBUG_WARN) { taosPrintLog("FN WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
#define fnError(...) { if (udfDebugFlag & DEBUG_ERROR) { taosPrintLog("UDF ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }}
#define fnInfo(...) { if (fnDebugFlag & DEBUG_INFO) { taosPrintLog("FN ", DEBUG_INFO, 255, __VA_ARGS__); }}
#define fnWarn(...) { if (udfDebugFlag & DEBUG_WARN) { taosPrintLog("UDF WARN ", DEBUG_WARN, 255, __VA_ARGS__); }}
#define fnDebug(...) { if (fnDebugFlag & DEBUG_DEBUG) { taosPrintLog("FN ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define fnInfo(...) { if (udfDebugFlag & DEBUG_INFO) { taosPrintLog("UDF ", DEBUG_INFO, 255, __VA_ARGS__); }}
#define fnTrace(...) { if (fnDebugFlag & DEBUG_TRACE) { taosPrintLog("FN ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
#define fnDebug(...) { if (udfDebugFlag & DEBUG_DEBUG) { taosPrintLog("UDF ", DEBUG_DEBUG, udfDebugFlag, __VA_ARGS__); }}
#define fnTrace(...) { if (udfDebugFlag & DEBUG_TRACE) { taosPrintLog("UDF ", DEBUG_TRACE, udfDebugFlag, __VA_ARGS__); }}
// clang-format on
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
294acc9e
...
@@ -1080,6 +1080,19 @@ bool getMinmaxFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) {
...
@@ -1080,6 +1080,19 @@ bool getMinmaxFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) {
static
void
saveTupleData
(
SqlFunctionCtx
*
pCtx
,
int32_t
rowIndex
,
const
SSDataBlock
*
pSrcBlock
,
STuplePos
*
pPos
);
static
void
saveTupleData
(
SqlFunctionCtx
*
pCtx
,
int32_t
rowIndex
,
const
SSDataBlock
*
pSrcBlock
,
STuplePos
*
pPos
);
static
void
copyTupleData
(
SqlFunctionCtx
*
pCtx
,
int32_t
rowIndex
,
const
SSDataBlock
*
pSrcBlock
,
STuplePos
*
pPos
);
static
void
copyTupleData
(
SqlFunctionCtx
*
pCtx
,
int32_t
rowIndex
,
const
SSDataBlock
*
pSrcBlock
,
STuplePos
*
pPos
);
static
int32_t
findRowIndex
(
int32_t
start
,
int32_t
num
,
SColumnInfoData
*
pCol
,
const
char
*
tval
)
{
// the data is loaded, not only the block SMA value
for
(
int32_t
i
=
start
;
i
<
num
+
start
;
++
i
)
{
char
*
p
=
colDataGetData
(
pCol
,
i
);
if
(
memcpy
((
void
*
)
tval
,
p
,
pCol
->
info
.
bytes
)
==
0
)
{
return
i
;
}
}
ASSERT
(
0
);
}
int32_t
doMinMaxHelper
(
SqlFunctionCtx
*
pCtx
,
int32_t
isMinFunc
)
{
int32_t
doMinMaxHelper
(
SqlFunctionCtx
*
pCtx
,
int32_t
isMinFunc
)
{
int32_t
numOfElems
=
0
;
int32_t
numOfElems
=
0
;
...
@@ -1111,15 +1124,14 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
...
@@ -1111,15 +1124,14 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
if
(
isMinFunc
)
{
if
(
isMinFunc
)
{
tval
=
&
pInput
->
pColumnDataAgg
[
0
]
->
min
;
tval
=
&
pInput
->
pColumnDataAgg
[
0
]
->
min
;
index
=
pInput
->
pColumnDataAgg
[
0
]
->
minIndex
;
}
else
{
}
else
{
tval
=
&
pInput
->
pColumnDataAgg
[
0
]
->
max
;
tval
=
&
pInput
->
pColumnDataAgg
[
0
]
->
max
;
index
=
pInput
->
pColumnDataAgg
[
0
]
->
maxIndex
;
}
}
if
(
!
pBuf
->
assign
)
{
if
(
!
pBuf
->
assign
)
{
pBuf
->
v
=
*
(
int64_t
*
)
tval
;
pBuf
->
v
=
*
(
int64_t
*
)
tval
;
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
index
=
findRowIndex
(
pInput
->
startRowIndex
,
pInput
->
numOfRows
,
pCol
,
tval
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
}
}
}
else
{
}
else
{
...
@@ -1131,6 +1143,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
...
@@ -1131,6 +1143,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
if
((
prev
<
val
)
^
isMinFunc
)
{
if
((
prev
<
val
)
^
isMinFunc
)
{
pBuf
->
v
=
val
;
pBuf
->
v
=
val
;
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
index
=
findRowIndex
(
pInput
->
startRowIndex
,
pInput
->
numOfRows
,
pCol
,
tval
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
}
}
}
}
...
@@ -1143,6 +1156,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
...
@@ -1143,6 +1156,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
if
((
prev
<
val
)
^
isMinFunc
)
{
if
((
prev
<
val
)
^
isMinFunc
)
{
pBuf
->
v
=
val
;
pBuf
->
v
=
val
;
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
index
=
findRowIndex
(
pInput
->
startRowIndex
,
pInput
->
numOfRows
,
pCol
,
tval
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
}
}
}
}
...
@@ -1154,6 +1168,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
...
@@ -1154,6 +1168,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
if
((
prev
<
val
)
^
isMinFunc
)
{
if
((
prev
<
val
)
^
isMinFunc
)
{
pBuf
->
v
=
val
;
pBuf
->
v
=
val
;
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
index
=
findRowIndex
(
pInput
->
startRowIndex
,
pInput
->
numOfRows
,
pCol
,
tval
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
}
}
}
}
...
@@ -1167,6 +1182,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
...
@@ -1167,6 +1182,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
}
}
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
index
=
findRowIndex
(
pInput
->
startRowIndex
,
pInput
->
numOfRows
,
pCol
,
tval
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
}
}
}
}
...
@@ -5547,30 +5563,18 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
...
@@ -5547,30 +5563,18 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
}
}
}
}
int32_t
delta
=
maxVal
-
minVal
;
// maximum number of step is 80
int32_t
step
=
delta
/
50
;
double
factor
=
pData
->
numOfBlocks
/
80
.
0
;
if
(
step
==
0
)
{
step
=
1
;
}
int32_t
numOfBuckets
=
sizeof
(
pData
->
blockRowsHisto
)
/
sizeof
(
pData
->
blockRowsHisto
[
0
]);
int32_t
numOfBuckets
=
sizeof
(
pData
->
blockRowsHisto
)
/
sizeof
(
pData
->
blockRowsHisto
[
0
]);
int32_t
bucketRange
=
(
pData
->
maxRows
-
pData
->
minRows
)
/
numOfBuckets
;
int32_t
bucketRange
=
(
pData
->
defMaxRows
-
pData
->
defMinRows
)
/
numOfBuckets
;
bool
singleModel
=
false
;
if
(
bucketRange
==
0
)
{
singleModel
=
true
;
step
=
20
;
bucketRange
=
(
pData
->
defMaxRows
-
pData
->
defMinRows
)
/
numOfBuckets
;
}
for
(
int32_t
i
=
0
;
i
<
tListLen
(
pData
->
blockRowsHisto
);
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
tListLen
(
pData
->
blockRowsHisto
);
++
i
)
{
len
=
sprintf
(
st
+
VARSTR_HEADER_SIZE
,
"%04d |"
,
pData
->
defMinRows
+
bucketRange
*
(
i
+
1
)
);
len
=
sprintf
(
st
+
VARSTR_HEADER_SIZE
,
"%04d |"
,
pData
->
defMinRows
+
bucketRange
*
i
);
int32_t
num
=
0
;
int32_t
num
=
0
;
if
(
singleModel
&&
pData
->
blockRowsHisto
[
i
]
>
0
)
{
if
(
pData
->
blockRowsHisto
[
i
]
>
0
)
{
num
=
20
;
num
=
(
pData
->
blockRowsHisto
[
i
])
/
factor
;
}
else
{
num
=
(
pData
->
blockRowsHisto
[
i
]
+
step
-
1
)
/
step
;
}
}
for
(
int32_t
j
=
0
;
j
<
num
;
++
j
)
{
for
(
int32_t
j
=
0
;
j
<
num
;
++
j
)
{
...
@@ -5578,9 +5582,10 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
...
@@ -5578,9 +5582,10 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
len
+=
x
;
len
+=
x
;
}
}
double
v
=
pData
->
blockRowsHisto
[
i
]
*
100
.
0
/
pData
->
numOfBlocks
;
if
(
num
>
0
)
{
len
+=
sprintf
(
st
+
VARSTR_HEADER_SIZE
+
len
,
" %d (%.2f%c)"
,
pData
->
blockRowsHisto
[
i
],
v
,
'%'
);
double
v
=
pData
->
blockRowsHisto
[
i
]
*
100
.
0
/
pData
->
numOfBlocks
;
printf
(
"%s
\n
"
,
st
);
len
+=
sprintf
(
st
+
VARSTR_HEADER_SIZE
+
len
,
" %d (%.2f%c)"
,
pData
->
blockRowsHisto
[
i
],
v
,
'%'
);
}
varDataSetLen
(
st
,
len
);
varDataSetLen
(
st
,
len
);
colDataAppend
(
pColInfo
,
row
++
,
st
,
false
);
colDataAppend
(
pColInfo
,
row
++
,
st
,
false
);
...
...
source/libs/sync/inc/syncOnMessage.h
已删除
100644 → 0
浏览文件 @
1e4f7e3a
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_LIBS_SYNC_ON_MESSAGE_H
#define _TD_LIBS_SYNC_ON_MESSAGE_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "taosdef.h"
// TLA+ Spec
// Receive(m) ==
// LET i == m.mdest
// j == m.msource
// IN \* Any RPC with a newer term causes the recipient to advance
// \* its term first. Responses with stale terms are ignored.
// \/ UpdateTerm(i, j, m)
// \/ /\ m.mtype = RequestVoteRequest
// /\ HandleRequestVoteRequest(i, j, m)
// \/ /\ m.mtype = RequestVoteResponse
// /\ \/ DropStaleResponse(i, j, m)
// \/ HandleRequestVoteResponse(i, j, m)
// \/ /\ m.mtype = AppendEntriesRequest
// /\ HandleAppendEntriesRequest(i, j, m)
// \/ /\ m.mtype = AppendEntriesResponse
// /\ \/ DropStaleResponse(i, j, m)
// \/ HandleAppendEntriesResponse(i, j, m)
// DuplicateMessage(m) ==
// /\ Send(m)
// /\ UNCHANGED <<serverVars, candidateVars, leaderVars, logVars>>
// DropMessage(m) ==
// /\ Discard(m)
// /\ UNCHANGED <<serverVars, candidateVars, leaderVars, logVars>>
// Next == /\ \/ \E i \in Server : Restart(i)
// \/ \E i \in Server : Timeout(i)
// \/ \E i,j \in Server : RequestVote(i, j)
// \/ \E i \in Server : BecomeLeader(i)
// \/ \E i \in Server, v \in Value : ClientRequest(i, v)
// \/ \E i \in Server : AdvanceCommitIndex(i)
// \/ \E i,j \in Server : AppendEntries(i, j)
// \/ \E m \in DOMAIN messages : Receive(m)
// \/ \E m \in DOMAIN messages : DuplicateMessage(m)
// \/ \E m \in DOMAIN messages : DropMessage(m)
// \* History variable that tracks every log ever:
// /\ allLogs' = allLogs \cup {log[i] : i \in Server}
//
#ifdef __cplusplus
}
#endif
#endif
/*_TD_LIBS_SYNC_ON_MESSAGE_H*/
source/libs/sync/src/syncAppendEntries.c
浏览文件 @
294acc9e
...
@@ -162,6 +162,17 @@ int32_t syncNodeOnAppendEntriesCb(SSyncNode* ths, SyncAppendEntries* pMsg) {
...
@@ -162,6 +162,17 @@ int32_t syncNodeOnAppendEntriesCb(SSyncNode* ths, SyncAppendEntries* pMsg) {
pReply
->
success
=
false
;
pReply
->
success
=
false
;
pReply
->
matchIndex
=
SYNC_INDEX_INVALID
;
pReply
->
matchIndex
=
SYNC_INDEX_INVALID
;
// msg event log
do
{
char
host
[
128
];
uint16_t
port
;
syncUtilU642Addr
(
pReply
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sDebug
(
"vgId:%d, send sync-append-entries-reply to %s:%d, {term:%lu, pterm:%lu, success:%d, "
"match-index:%ld}"
,
ths
->
vgId
,
host
,
port
,
pReply
->
term
,
pReply
->
privateTerm
,
pReply
->
success
,
pReply
->
matchIndex
);
}
while
(
0
);
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
;
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
syncNodeSendMsgById
(
&
pReply
->
destId
,
ths
,
&
rpcMsg
);
syncNodeSendMsgById
(
&
pReply
->
destId
,
ths
,
&
rpcMsg
);
...
@@ -334,270 +345,16 @@ int32_t syncNodeOnAppendEntriesCb(SSyncNode* ths, SyncAppendEntries* pMsg) {
...
@@ -334,270 +345,16 @@ int32_t syncNodeOnAppendEntriesCb(SSyncNode* ths, SyncAppendEntries* pMsg) {
pReply
->
matchIndex
=
pMsg
->
prevLogIndex
;
pReply
->
matchIndex
=
pMsg
->
prevLogIndex
;
}
}
SRpcMsg
rpcMsg
;
// msg event log
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
do
{
syncNodeSendMsgById
(
&
pReply
->
destId
,
ths
,
&
rpcMsg
);
char
host
[
128
];
syncAppendEntriesReplyDestroy
(
pReply
);
uint16_t
port
;
syncUtilU642Addr
(
pReply
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
// maybe update commit index from leader
sDebug
(
if
(
pMsg
->
commitIndex
>
ths
->
commitIndex
)
{
"vgId:%d, send sync-append-entries-reply to %s:%d, {term:%lu, pterm:%lu, success:%d, "
// has commit entry in local
"match-index:%ld}"
,
if
(
pMsg
->
commitIndex
<=
ths
->
pLogStore
->
getLastIndex
(
ths
->
pLogStore
))
{
ths
->
vgId
,
host
,
port
,
pReply
->
term
,
pReply
->
privateTerm
,
pReply
->
success
,
pReply
->
matchIndex
);
SyncIndex
beginIndex
=
ths
->
commitIndex
+
1
;
}
while
(
0
);
SyncIndex
endIndex
=
pMsg
->
commitIndex
;
// update commit index
ths
->
commitIndex
=
pMsg
->
commitIndex
;
// call back Wal
ths
->
pLogStore
->
updateCommitIndex
(
ths
->
pLogStore
,
ths
->
commitIndex
);
int32_t
code
=
syncNodeCommit
(
ths
,
beginIndex
,
endIndex
,
ths
->
state
);
ASSERT
(
code
==
0
);
}
}
}
return
ret
;
}
#if 0
int32_t syncNodeOnAppendEntriesCb(SSyncNode* ths, SyncAppendEntries* pMsg) {
int32_t ret = 0;
char logBuf[128] = {0};
snprintf(logBuf, sizeof(logBuf), "==syncNodeOnAppendEntriesCb== term:%lu", ths->pRaftStore->currentTerm);
syncAppendEntriesLog2(logBuf, pMsg);
if (pMsg->term > ths->pRaftStore->currentTerm) {
syncNodeUpdateTerm(ths, pMsg->term);
}
ASSERT(pMsg->term <= ths->pRaftStore->currentTerm);
// reset elect timer
if (pMsg->term == ths->pRaftStore->currentTerm) {
ths->leaderCache = pMsg->srcId;
syncNodeResetElectTimer(ths);
}
ASSERT(pMsg->dataLen >= 0);
SyncTerm localPreLogTerm = 0;
if (pMsg->prevLogIndex >= SYNC_INDEX_BEGIN && pMsg->prevLogIndex <= ths->pLogStore->getLastIndex(ths->pLogStore)) {
SSyncRaftEntry* pEntry = ths->pLogStore->getEntry(ths->pLogStore, pMsg->prevLogIndex);
if (pEntry == NULL) {
char logBuf[128];
snprintf(logBuf, sizeof(logBuf), "getEntry error, index:%ld, since %s", pMsg->prevLogIndex, terrstr());
syncNodeErrorLog(ths, logBuf);
return -1;
}
localPreLogTerm = pEntry->term;
syncEntryDestory(pEntry);
}
bool logOK =
(pMsg->prevLogIndex == SYNC_INDEX_INVALID) ||
((pMsg->prevLogIndex >= SYNC_INDEX_BEGIN) &&
(pMsg->prevLogIndex <= ths->pLogStore->getLastIndex(ths->pLogStore)) && (pMsg->prevLogTerm == localPreLogTerm));
// reject request
if ((pMsg->term < ths->pRaftStore->currentTerm) ||
((pMsg->term == ths->pRaftStore->currentTerm) && (ths->state == TAOS_SYNC_STATE_FOLLOWER) && !logOK)) {
sTrace(
"syncNodeOnAppendEntriesCb --> reject, pMsg->term:%lu, ths->pRaftStore->currentTerm:%lu, ths->state:%d, "
"logOK:%d",
pMsg->term, ths->pRaftStore->currentTerm, ths->state, logOK);
SyncAppendEntriesReply* pReply = syncAppendEntriesReplyBuild(ths->vgId);
pReply->srcId = ths->myRaftId;
pReply->destId = pMsg->srcId;
pReply->term = ths->pRaftStore->currentTerm;
pReply->success = false;
pReply->matchIndex = SYNC_INDEX_INVALID;
SRpcMsg rpcMsg;
syncAppendEntriesReply2RpcMsg(pReply, &rpcMsg);
syncNodeSendMsgById(&pReply->destId, ths, &rpcMsg);
syncAppendEntriesReplyDestroy(pReply);
return ret;
}
// return to follower state
if (pMsg->term == ths->pRaftStore->currentTerm && ths->state == TAOS_SYNC_STATE_CANDIDATE) {
sTrace(
"syncNodeOnAppendEntriesCb --> return to follower, pMsg->term:%lu, ths->pRaftStore->currentTerm:%lu, "
"ths->state:%d, logOK:%d",
pMsg->term, ths->pRaftStore->currentTerm, ths->state, logOK);
syncNodeBecomeFollower(ths, "from candidate by append entries");
// ret or reply?
return ret;
}
// accept request
if (pMsg->term == ths->pRaftStore->currentTerm && ths->state == TAOS_SYNC_STATE_FOLLOWER && logOK) {
// preIndex = -1, or has preIndex entry in local log
ASSERT(pMsg->prevLogIndex <= ths->pLogStore->getLastIndex(ths->pLogStore));
// has extra entries (> preIndex) in local log
bool hasExtraEntries = pMsg->prevLogIndex < ths->pLogStore->getLastIndex(ths->pLogStore);
// has entries in SyncAppendEntries msg
bool hasAppendEntries = pMsg->dataLen > 0;
sTrace(
"syncNodeOnAppendEntriesCb --> accept, pMsg->term:%lu, ths->pRaftStore->currentTerm:%lu, ths->state:%d, "
"logOK:%d, hasExtraEntries:%d, hasAppendEntries:%d",
pMsg->term, ths->pRaftStore->currentTerm, ths->state, logOK, hasExtraEntries, hasAppendEntries);
if (hasExtraEntries && hasAppendEntries) {
// not conflict by default
bool conflict = false;
SyncIndex extraIndex = pMsg->prevLogIndex + 1;
SSyncRaftEntry* pExtraEntry = ths->pLogStore->getEntry(ths->pLogStore, extraIndex);
if (pExtraEntry == NULL) {
char logBuf[128];
snprintf(logBuf, sizeof(logBuf), "getEntry error2, index:%ld, since %s", extraIndex, terrstr());
syncNodeErrorLog(ths, logBuf);
return -1;
}
SSyncRaftEntry* pAppendEntry = syncEntryDeserialize(pMsg->data, pMsg->dataLen);
if (pAppendEntry == NULL) {
syncNodeErrorLog(ths, "syncEntryDeserialize pAppendEntry error");
return -1;
}
// log not match, conflict
ASSERT(extraIndex == pAppendEntry->index);
if (pExtraEntry->term != pAppendEntry->term) {
conflict = true;
}
if (conflict) {
// roll back
SyncIndex delBegin = ths->pLogStore->getLastIndex(ths->pLogStore);
SyncIndex delEnd = extraIndex;
sTrace("syncNodeOnAppendEntriesCb --> conflict:%d, delBegin:%ld, delEnd:%ld", conflict, delBegin, delEnd);
// notice! reverse roll back!
for (SyncIndex index = delEnd; index >= delBegin; --index) {
if (ths->pFsm->FpRollBackCb != NULL) {
SSyncRaftEntry* pRollBackEntry = ths->pLogStore->getEntry(ths->pLogStore, index);
if (pRollBackEntry == NULL) {
char logBuf[128];
snprintf(logBuf, sizeof(logBuf), "getEntry error3, index:%ld, since %s", index, terrstr());
syncNodeErrorLog(ths, logBuf);
return -1;
}
// if (pRollBackEntry->msgType != TDMT_SYNC_NOOP) {
if (syncUtilUserRollback(pRollBackEntry->msgType)) {
SRpcMsg rpcMsg;
syncEntry2OriginalRpc(pRollBackEntry, &rpcMsg);
SFsmCbMeta cbMeta = {0};
cbMeta.index = pRollBackEntry->index;
cbMeta.lastConfigIndex = syncNodeGetSnapshotConfigIndex(ths, cbMeta.index);
cbMeta.isWeak = pRollBackEntry->isWeak;
cbMeta.code = 0;
cbMeta.state = ths->state;
cbMeta.seqNum = pRollBackEntry->seqNum;
ths->pFsm->FpRollBackCb(ths->pFsm, &rpcMsg, cbMeta);
rpcFreeCont(rpcMsg.pCont);
}
syncEntryDestory(pRollBackEntry);
}
}
// delete confict entries
ths->pLogStore->truncate(ths->pLogStore, extraIndex);
// append new entries
ths->pLogStore->appendEntry(ths->pLogStore, pAppendEntry);
// pre commit
SRpcMsg rpcMsg;
syncEntry2OriginalRpc(pAppendEntry, &rpcMsg);
if (ths->pFsm != NULL) {
// if (ths->pFsm->FpPreCommitCb != NULL && pAppendEntry->originalRpcType != TDMT_SYNC_NOOP) {
if (ths->pFsm->FpPreCommitCb != NULL && syncUtilUserPreCommit(pAppendEntry->originalRpcType)) {
SFsmCbMeta cbMeta = {0};
cbMeta.index = pAppendEntry->index;
cbMeta.lastConfigIndex = syncNodeGetSnapshotConfigIndex(ths, cbMeta.index);
cbMeta.isWeak = pAppendEntry->isWeak;
cbMeta.code = 2;
cbMeta.state = ths->state;
cbMeta.seqNum = pAppendEntry->seqNum;
ths->pFsm->FpPreCommitCb(ths->pFsm, &rpcMsg, cbMeta);
}
}
rpcFreeCont(rpcMsg.pCont);
}
// free memory
syncEntryDestory(pExtraEntry);
syncEntryDestory(pAppendEntry);
} else if (hasExtraEntries && !hasAppendEntries) {
// do nothing
} else if (!hasExtraEntries && hasAppendEntries) {
SSyncRaftEntry* pAppendEntry = syncEntryDeserialize(pMsg->data, pMsg->dataLen);
if (pAppendEntry == NULL) {
syncNodeErrorLog(ths, "syncEntryDeserialize pAppendEntry2 error");
return -1;
}
// append new entries
ths->pLogStore->appendEntry(ths->pLogStore, pAppendEntry);
// pre commit
SRpcMsg rpcMsg;
syncEntry2OriginalRpc(pAppendEntry, &rpcMsg);
if (ths->pFsm != NULL) {
// if (ths->pFsm->FpPreCommitCb != NULL && pAppendEntry->originalRpcType != TDMT_SYNC_NOOP) {
if (ths->pFsm->FpPreCommitCb != NULL && syncUtilUserPreCommit(pAppendEntry->originalRpcType)) {
SFsmCbMeta cbMeta = {0};
cbMeta.index = pAppendEntry->index;
cbMeta.lastConfigIndex = syncNodeGetSnapshotConfigIndex(ths, cbMeta.index);
cbMeta.isWeak = pAppendEntry->isWeak;
cbMeta.code = 3;
cbMeta.state = ths->state;
cbMeta.seqNum = pAppendEntry->seqNum;
ths->pFsm->FpPreCommitCb(ths->pFsm, &rpcMsg, cbMeta);
}
}
rpcFreeCont(rpcMsg.pCont);
// free memory
syncEntryDestory(pAppendEntry);
} else if (!hasExtraEntries && !hasAppendEntries) {
// do nothing
} else {
syncNodeLog3("", ths);
ASSERT(0);
}
SyncAppendEntriesReply* pReply = syncAppendEntriesReplyBuild(ths->vgId);
pReply->srcId = ths->myRaftId;
pReply->destId = pMsg->srcId;
pReply->term = ths->pRaftStore->currentTerm;
pReply->success = true;
if (hasAppendEntries) {
pReply->matchIndex = pMsg->prevLogIndex + 1;
} else {
pReply->matchIndex = pMsg->prevLogIndex;
}
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
;
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
...
@@ -626,8 +383,6 @@ int32_t syncNodeOnAppendEntriesCb(SSyncNode* ths, SyncAppendEntries* pMsg) {
...
@@ -626,8 +383,6 @@ int32_t syncNodeOnAppendEntriesCb(SSyncNode* ths, SyncAppendEntries* pMsg) {
return
ret
;
return
ret
;
}
}
#endif
static
int32_t
syncNodeMakeLogSame
(
SSyncNode
*
ths
,
SyncAppendEntries
*
pMsg
)
{
static
int32_t
syncNodeMakeLogSame
(
SSyncNode
*
ths
,
SyncAppendEntries
*
pMsg
)
{
int32_t
code
;
int32_t
code
;
...
@@ -897,6 +652,17 @@ int32_t syncNodeOnAppendEntriesSnapshot2Cb(SSyncNode* ths, SyncAppendEntriesBatc
...
@@ -897,6 +652,17 @@ int32_t syncNodeOnAppendEntriesSnapshot2Cb(SSyncNode* ths, SyncAppendEntriesBatc
pReply
->
success
=
true
;
pReply
->
success
=
true
;
pReply
->
matchIndex
=
matchIndex
;
pReply
->
matchIndex
=
matchIndex
;
// msg event log
do
{
char
host
[
128
];
uint16_t
port
;
syncUtilU642Addr
(
pReply
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sDebug
(
"vgId:%d, send sync-append-entries-reply to %s:%d, {term:%lu, pterm:%lu, success:%d, "
"match-index:%ld}"
,
ths
->
vgId
,
host
,
port
,
pReply
->
term
,
pReply
->
privateTerm
,
pReply
->
success
,
pReply
->
matchIndex
);
}
while
(
0
);
// send response
// send response
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
;
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
...
@@ -945,6 +711,17 @@ int32_t syncNodeOnAppendEntriesSnapshot2Cb(SSyncNode* ths, SyncAppendEntriesBatc
...
@@ -945,6 +711,17 @@ int32_t syncNodeOnAppendEntriesSnapshot2Cb(SSyncNode* ths, SyncAppendEntriesBatc
pReply
->
success
=
false
;
pReply
->
success
=
false
;
pReply
->
matchIndex
=
SYNC_INDEX_INVALID
;
pReply
->
matchIndex
=
SYNC_INDEX_INVALID
;
// msg event log
do
{
char
host
[
128
];
uint16_t
port
;
syncUtilU642Addr
(
pReply
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sDebug
(
"vgId:%d, send sync-append-entries-reply to %s:%d, {term:%lu, pterm:%lu, success:%d, "
"match-index:%ld}"
,
ths
->
vgId
,
host
,
port
,
pReply
->
term
,
pReply
->
privateTerm
,
pReply
->
success
,
pReply
->
matchIndex
);
}
while
(
0
);
// send response
// send response
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
;
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
...
@@ -977,7 +754,7 @@ int32_t syncNodeOnAppendEntriesSnapshot2Cb(SSyncNode* ths, SyncAppendEntriesBatc
...
@@ -977,7 +754,7 @@ int32_t syncNodeOnAppendEntriesSnapshot2Cb(SSyncNode* ths, SyncAppendEntriesBatc
do
{
do
{
char
logBuf
[
128
];
char
logBuf
[
128
];
snprintf
(
logBuf
,
sizeof
(
logBuf
),
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"recv sync-append-entries, match, {pre-index:%ld, pre-term:%lu, datalen:%d, datacount:%d}"
,
"recv sync-append-entries
-batch
, match, {pre-index:%ld, pre-term:%lu, datalen:%d, datacount:%d}"
,
pMsg
->
prevLogIndex
,
pMsg
->
prevLogTerm
,
pMsg
->
dataLen
,
pMsg
->
dataCount
);
pMsg
->
prevLogIndex
,
pMsg
->
prevLogTerm
,
pMsg
->
dataLen
,
pMsg
->
dataCount
);
syncNodeEventLog
(
ths
,
logBuf
);
syncNodeEventLog
(
ths
,
logBuf
);
}
while
(
0
);
}
while
(
0
);
...
@@ -1018,6 +795,17 @@ int32_t syncNodeOnAppendEntriesSnapshot2Cb(SSyncNode* ths, SyncAppendEntriesBatc
...
@@ -1018,6 +795,17 @@ int32_t syncNodeOnAppendEntriesSnapshot2Cb(SSyncNode* ths, SyncAppendEntriesBatc
pReply
->
success
=
true
;
pReply
->
success
=
true
;
pReply
->
matchIndex
=
hasAppendEntries
?
pMsg
->
prevLogIndex
+
pMsg
->
dataCount
:
pMsg
->
prevLogIndex
;
pReply
->
matchIndex
=
hasAppendEntries
?
pMsg
->
prevLogIndex
+
pMsg
->
dataCount
:
pMsg
->
prevLogIndex
;
// msg event log
do
{
char
host
[
128
];
uint16_t
port
;
syncUtilU642Addr
(
pReply
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sDebug
(
"vgId:%d, send sync-append-entries-reply to %s:%d, {term:%lu, pterm:%lu, success:%d, "
"match-index:%ld}"
,
ths
->
vgId
,
host
,
port
,
pReply
->
term
,
pReply
->
privateTerm
,
pReply
->
success
,
pReply
->
matchIndex
);
}
while
(
0
);
// send response
// send response
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
;
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
...
@@ -1227,6 +1015,17 @@ int32_t syncNodeOnAppendEntriesSnapshotCb(SSyncNode* ths, SyncAppendEntries* pMs
...
@@ -1227,6 +1015,17 @@ int32_t syncNodeOnAppendEntriesSnapshotCb(SSyncNode* ths, SyncAppendEntries* pMs
pReply
->
success
=
true
;
pReply
->
success
=
true
;
pReply
->
matchIndex
=
matchIndex
;
pReply
->
matchIndex
=
matchIndex
;
// msg event log
do
{
char
host
[
128
];
uint16_t
port
;
syncUtilU642Addr
(
pReply
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sDebug
(
"vgId:%d, send sync-append-entries-reply to %s:%d, {term:%lu, pterm:%lu, success:%d, "
"match-index:%ld}"
,
ths
->
vgId
,
host
,
port
,
pReply
->
term
,
pReply
->
privateTerm
,
pReply
->
success
,
pReply
->
matchIndex
);
}
while
(
0
);
// send response
// send response
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
;
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
...
@@ -1272,6 +1071,17 @@ int32_t syncNodeOnAppendEntriesSnapshotCb(SSyncNode* ths, SyncAppendEntries* pMs
...
@@ -1272,6 +1071,17 @@ int32_t syncNodeOnAppendEntriesSnapshotCb(SSyncNode* ths, SyncAppendEntries* pMs
pReply
->
success
=
false
;
pReply
->
success
=
false
;
pReply
->
matchIndex
=
SYNC_INDEX_INVALID
;
pReply
->
matchIndex
=
SYNC_INDEX_INVALID
;
// msg event log
do
{
char
host
[
128
];
uint16_t
port
;
syncUtilU642Addr
(
pReply
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sDebug
(
"vgId:%d, send sync-append-entries-reply to %s:%d, {term:%lu, pterm:%lu, success:%d, "
"match-index:%ld}"
,
ths
->
vgId
,
host
,
port
,
pReply
->
term
,
pReply
->
privateTerm
,
pReply
->
success
,
pReply
->
matchIndex
);
}
while
(
0
);
// send response
// send response
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
;
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
...
@@ -1337,6 +1147,17 @@ int32_t syncNodeOnAppendEntriesSnapshotCb(SSyncNode* ths, SyncAppendEntries* pMs
...
@@ -1337,6 +1147,17 @@ int32_t syncNodeOnAppendEntriesSnapshotCb(SSyncNode* ths, SyncAppendEntries* pMs
pReply
->
success
=
true
;
pReply
->
success
=
true
;
pReply
->
matchIndex
=
hasAppendEntries
?
pMsg
->
prevLogIndex
+
1
:
pMsg
->
prevLogIndex
;
pReply
->
matchIndex
=
hasAppendEntries
?
pMsg
->
prevLogIndex
+
1
:
pMsg
->
prevLogIndex
;
// msg event log
do
{
char
host
[
128
];
uint16_t
port
;
syncUtilU642Addr
(
pReply
->
destId
.
addr
,
host
,
sizeof
(
host
),
&
port
);
sDebug
(
"vgId:%d, send sync-append-entries-reply to %s:%d, {term:%lu, pterm:%lu, success:%d, "
"match-index:%ld}"
,
ths
->
vgId
,
host
,
port
,
pReply
->
term
,
pReply
->
privateTerm
,
pReply
->
success
,
pReply
->
matchIndex
);
}
while
(
0
);
// send response
// send response
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
;
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
syncAppendEntriesReply2RpcMsg
(
pReply
,
&
rpcMsg
);
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
294acc9e
...
@@ -1025,14 +1025,14 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) {
...
@@ -1025,14 +1025,14 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) {
pSyncNode
->
FpOnSnapshotRsp
=
syncNodeOnSnapshotRspCb
;
pSyncNode
->
FpOnSnapshotRsp
=
syncNodeOnSnapshotRspCb
;
if
(
pSyncNode
->
pRaftCfg
->
snapshotStrategy
)
{
if
(
pSyncNode
->
pRaftCfg
->
snapshotStrategy
)
{
sInfo
(
"
sync node use snapshot"
);
sInfo
(
"
vgId:%d, sync node use snapshot"
,
pSyncNode
->
vgId
);
pSyncNode
->
FpOnRequestVote
=
syncNodeOnRequestVoteSnapshotCb
;
pSyncNode
->
FpOnRequestVote
=
syncNodeOnRequestVoteSnapshotCb
;
pSyncNode
->
FpOnRequestVoteReply
=
syncNodeOnRequestVoteReplySnapshotCb
;
pSyncNode
->
FpOnRequestVoteReply
=
syncNodeOnRequestVoteReplySnapshotCb
;
pSyncNode
->
FpOnAppendEntries
=
syncNodeOnAppendEntriesSnapshotCb
;
pSyncNode
->
FpOnAppendEntries
=
syncNodeOnAppendEntriesSnapshotCb
;
pSyncNode
->
FpOnAppendEntriesReply
=
syncNodeOnAppendEntriesReplySnapshotCb
;
pSyncNode
->
FpOnAppendEntriesReply
=
syncNodeOnAppendEntriesReplySnapshotCb
;
}
else
{
}
else
{
sInfo
(
"
sync node do not use snapshot"
);
sInfo
(
"
vgId:%d, sync node do not use snapshot"
,
pSyncNode
->
vgId
);
pSyncNode
->
FpOnRequestVote
=
syncNodeOnRequestVoteCb
;
pSyncNode
->
FpOnRequestVote
=
syncNodeOnRequestVoteCb
;
pSyncNode
->
FpOnRequestVoteReply
=
syncNodeOnRequestVoteReplyCb
;
pSyncNode
->
FpOnRequestVoteReply
=
syncNodeOnRequestVoteReplyCb
;
pSyncNode
->
FpOnAppendEntries
=
syncNodeOnAppendEntriesCb
;
pSyncNode
->
FpOnAppendEntries
=
syncNodeOnAppendEntriesCb
;
...
@@ -1311,8 +1311,10 @@ int32_t syncNodeSendMsgById(const SRaftId* destRaftId, SSyncNode* pSyncNode, SRp
...
@@ -1311,8 +1311,10 @@ int32_t syncNodeSendMsgById(const SRaftId* destRaftId, SSyncNode* pSyncNode, SRp
pMsg
->
info
.
noResp
=
1
;
pMsg
->
info
.
noResp
=
1
;
pSyncNode
->
FpSendMsg
(
&
epSet
,
pMsg
);
pSyncNode
->
FpSendMsg
(
&
epSet
,
pMsg
);
}
else
{
}
else
{
sTrace
(
"syncNodeSendMsgById pSyncNode->FpSendMsg is NULL"
);
sError
(
"vgId:%d, sync send msg by id error, fp-send-msg is null"
,
pSyncNode
->
vgId
);
return
-
1
;
}
}
return
0
;
return
0
;
}
}
...
@@ -1326,7 +1328,7 @@ int32_t syncNodeSendMsgByInfo(const SNodeInfo* nodeInfo, SSyncNode* pSyncNode, S
...
@@ -1326,7 +1328,7 @@ int32_t syncNodeSendMsgByInfo(const SNodeInfo* nodeInfo, SSyncNode* pSyncNode, S
pMsg
->
info
.
noResp
=
1
;
pMsg
->
info
.
noResp
=
1
;
pSyncNode
->
FpSendMsg
(
&
epSet
,
pMsg
);
pSyncNode
->
FpSendMsg
(
&
epSet
,
pMsg
);
}
else
{
}
else
{
s
Trace
(
"syncNodeSendMsgByInfo pSyncNode->FpSendMsg is NULL"
);
s
Error
(
"vgId:%d, sync send msg by info error, fp-send-msg is null"
,
pSyncNode
->
vgId
);
}
}
return
0
;
return
0
;
}
}
...
...
source/libs/sync/src/syncOnMessage.c
已删除
100644 → 0
浏览文件 @
1e4f7e3a
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "syncOnMessage.h"
// TLA+ Spec
// Receive(m) ==
// LET i == m.mdest
// j == m.msource
// IN \* Any RPC with a newer term causes the recipient to advance
// \* its term first. Responses with stale terms are ignored.
// \/ UpdateTerm(i, j, m)
// \/ /\ m.mtype = RequestVoteRequest
// /\ HandleRequestVoteRequest(i, j, m)
// \/ /\ m.mtype = RequestVoteResponse
// /\ \/ DropStaleResponse(i, j, m)
// \/ HandleRequestVoteResponse(i, j, m)
// \/ /\ m.mtype = AppendEntriesRequest
// /\ HandleAppendEntriesRequest(i, j, m)
// \/ /\ m.mtype = AppendEntriesResponse
// /\ \/ DropStaleResponse(i, j, m)
// \/ HandleAppendEntriesResponse(i, j, m)
// DuplicateMessage(m) ==
// /\ Send(m)
// /\ UNCHANGED <<serverVars, candidateVars, leaderVars, logVars>>
// DropMessage(m) ==
// /\ Discard(m)
// /\ UNCHANGED <<serverVars, candidateVars, leaderVars, logVars>>
// Next == /\ \/ \E i \in Server : Restart(i)
// \/ \E i \in Server : Timeout(i)
// \/ \E i,j \in Server : RequestVote(i, j)
// \/ \E i \in Server : BecomeLeader(i)
// \/ \E i \in Server, v \in Value : ClientRequest(i, v)
// \/ \E i \in Server : AdvanceCommitIndex(i)
// \/ \E i,j \in Server : AppendEntries(i, j)
// \/ \E m \in DOMAIN messages : Receive(m)
// \/ \E m \in DOMAIN messages : DuplicateMessage(m)
// \/ \E m \in DOMAIN messages : DropMessage(m)
// \* History variable that tracks every log ever:
// /\ allLogs' = allLogs \cup {log[i] : i \in Server}
//
\ No newline at end of file
source/libs/sync/src/syncRaftLog.c
浏览文件 @
294acc9e
...
@@ -326,6 +326,14 @@ static int32_t raftLogTruncate(struct SSyncLogStore* pLogStore, SyncIndex fromIn
...
@@ -326,6 +326,14 @@ static int32_t raftLogTruncate(struct SSyncLogStore* pLogStore, SyncIndex fromIn
ASSERT
(
0
);
ASSERT
(
0
);
}
}
// event log
do
{
char
logBuf
[
128
];
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"wal truncate, from-index:%ld"
,
fromIndex
);
syncNodeEventLog
(
pData
->
pSyncNode
,
logBuf
);
}
while
(
0
);
return
code
;
return
code
;
}
}
...
@@ -463,6 +471,14 @@ int32_t logStoreTruncate(SSyncLogStore* pLogStore, SyncIndex fromIndex) {
...
@@ -463,6 +471,14 @@ int32_t logStoreTruncate(SSyncLogStore* pLogStore, SyncIndex fromIndex) {
ASSERT
(
0
);
ASSERT
(
0
);
}
}
// event log
do
{
char
logBuf
[
128
];
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"wal truncate, from-index:%ld"
,
fromIndex
);
syncNodeEventLog
(
pData
->
pSyncNode
,
logBuf
);
}
while
(
0
);
return
0
;
return
0
;
}
}
...
...
source/libs/sync/src/syncReplication.c
浏览文件 @
294acc9e
...
@@ -151,14 +151,6 @@ int32_t syncNodeAppendEntriesPeersSnapshot2(SSyncNode* pSyncNode) {
...
@@ -151,14 +151,6 @@ int32_t syncNodeAppendEntriesPeersSnapshot2(SSyncNode* pSyncNode) {
for
(
int32_t
i
=
0
;
i
<
pSyncNode
->
pRaftCfg
->
batchSize
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pSyncNode
->
pRaftCfg
->
batchSize
;
++
i
)
{
SSyncRaftEntry
*
pEntry
=
NULL
;
SSyncRaftEntry
*
pEntry
=
NULL
;
int32_t
code
=
pSyncNode
->
pLogStore
->
syncLogGetEntry
(
pSyncNode
->
pLogStore
,
getEntryIndex
,
&
pEntry
);
int32_t
code
=
pSyncNode
->
pLogStore
->
syncLogGetEntry
(
pSyncNode
->
pLogStore
,
getEntryIndex
,
&
pEntry
);
// event log
do
{
char
logBuf
[
128
];
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"get index:%d, code:%d, %s"
,
getEntryIndex
,
code
,
tstrerror
(
terrno
));
syncNodeEventLog
(
pSyncNode
,
logBuf
);
}
while
(
0
);
if
(
code
==
0
)
{
if
(
code
==
0
)
{
ASSERT
(
pEntry
!=
NULL
);
ASSERT
(
pEntry
!=
NULL
);
entryPArr
[
i
]
=
pEntry
;
entryPArr
[
i
]
=
pEntry
;
...
@@ -172,8 +164,11 @@ int32_t syncNodeAppendEntriesPeersSnapshot2(SSyncNode* pSyncNode) {
...
@@ -172,8 +164,11 @@ int32_t syncNodeAppendEntriesPeersSnapshot2(SSyncNode* pSyncNode) {
// event log
// event log
do
{
do
{
char
logBuf
[
128
];
char
logBuf
[
128
];
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"build batch:%d"
,
getCount
);
char
host
[
64
];
uint16_t
port
;
syncUtilU642Addr
(
pDestId
->
addr
,
host
,
sizeof
(
host
),
&
port
);
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"build batch:%d for %s:%d"
,
getCount
,
host
,
port
);
syncNodeEventLog
(
pSyncNode
,
logBuf
);
syncNodeEventLog
(
pSyncNode
,
logBuf
);
}
while
(
0
);
}
while
(
0
);
...
...
source/libs/sync/test/CMakeLists.txt
浏览文件 @
294acc9e
...
@@ -54,6 +54,7 @@ add_executable(syncRaftLogTest2 "")
...
@@ -54,6 +54,7 @@ add_executable(syncRaftLogTest2 "")
add_executable
(
syncRaftLogTest3
""
)
add_executable
(
syncRaftLogTest3
""
)
add_executable
(
syncLeaderTransferTest
""
)
add_executable
(
syncLeaderTransferTest
""
)
add_executable
(
syncReconfigFinishTest
""
)
add_executable
(
syncReconfigFinishTest
""
)
add_executable
(
syncRestoreFromSnapshot
""
)
target_sources
(
syncTest
target_sources
(
syncTest
...
@@ -280,6 +281,10 @@ target_sources(syncReconfigFinishTest
...
@@ -280,6 +281,10 @@ target_sources(syncReconfigFinishTest
PRIVATE
PRIVATE
"syncReconfigFinishTest.cpp"
"syncReconfigFinishTest.cpp"
)
)
target_sources
(
syncRestoreFromSnapshot
PRIVATE
"syncRestoreFromSnapshot.cpp"
)
target_include_directories
(
syncTest
target_include_directories
(
syncTest
...
@@ -562,6 +567,11 @@ target_include_directories(syncReconfigFinishTest
...
@@ -562,6 +567,11 @@ target_include_directories(syncReconfigFinishTest
"
${
TD_SOURCE_DIR
}
/include/libs/sync"
"
${
TD_SOURCE_DIR
}
/include/libs/sync"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
)
target_include_directories
(
syncRestoreFromSnapshot
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/sync"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
target_link_libraries
(
syncTest
target_link_libraries
(
syncTest
...
@@ -788,6 +798,10 @@ target_link_libraries(syncReconfigFinishTest
...
@@ -788,6 +798,10 @@ target_link_libraries(syncReconfigFinishTest
sync
sync
gtest_main
gtest_main
)
)
target_link_libraries
(
syncRestoreFromSnapshot
sync
gtest_main
)
enable_testing
()
enable_testing
()
...
...
source/libs/sync/test/syncLogStoreTest.cpp
浏览文件 @
294acc9e
...
@@ -85,6 +85,7 @@ void logStoreTest() {
...
@@ -85,6 +85,7 @@ void logStoreTest() {
}
}
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
gRaftDetailLog
=
true
;
tsAsyncLog
=
0
;
tsAsyncLog
=
0
;
sDebugFlag
=
DEBUG_TRACE
+
DEBUG_SCREEN
+
DEBUG_FILE
;
sDebugFlag
=
DEBUG_TRACE
+
DEBUG_SCREEN
+
DEBUG_FILE
;
...
...
source/libs/sync/test/syncRestoreFromSnapshot.cpp
0 → 100644
浏览文件 @
294acc9e
#include <gtest/gtest.h>
#include <stdio.h>
#include "syncEnv.h"
#include "syncIO.h"
#include "syncInt.h"
#include "syncRaftLog.h"
#include "syncRaftStore.h"
#include "syncUtil.h"
#include "wal.h"
void
logTest
()
{
sTrace
(
"--- sync log test: trace"
);
sDebug
(
"--- sync log test: debug"
);
sInfo
(
"--- sync log test: info"
);
sWarn
(
"--- sync log test: warn"
);
sError
(
"--- sync log test: error"
);
sFatal
(
"--- sync log test: fatal"
);
}
void
init
()
{
int
code
=
walInit
();
assert
(
code
==
0
);
}
void
cleanup
()
{
walCleanUp
();
}
SWal
*
createWal
(
char
*
path
,
int32_t
vgId
)
{
SWalCfg
walCfg
;
memset
(
&
walCfg
,
0
,
sizeof
(
SWalCfg
));
walCfg
.
vgId
=
vgId
;
walCfg
.
fsyncPeriod
=
1000
;
walCfg
.
retentionPeriod
=
1000
;
walCfg
.
rollPeriod
=
1000
;
walCfg
.
retentionSize
=
1000
;
walCfg
.
segSize
=
1000
;
walCfg
.
level
=
TAOS_WAL_FSYNC
;
SWal
*
pWal
=
walOpen
(
path
,
&
walCfg
);
assert
(
pWal
!=
NULL
);
return
pWal
;
}
SSyncNode
*
createSyncNode
(
SWal
*
pWal
)
{
SSyncNode
*
pSyncNode
=
(
SSyncNode
*
)
taosMemoryMalloc
(
sizeof
(
SSyncNode
));
memset
(
pSyncNode
,
0
,
sizeof
(
SSyncNode
));
pSyncNode
->
pWal
=
pWal
;
return
pSyncNode
;
}
void
usage
(
char
*
exe
)
{
printf
(
"usage: %s path vgId snapshotIndex
\n
"
,
exe
);
}
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
4
)
{
usage
(
argv
[
0
]);
exit
(
-
1
);
}
char
*
path
=
argv
[
1
];
int32_t
vgId
=
atoi
(
argv
[
2
]);
int64_t
snapshotIndex
=
atoll
(
argv
[
3
]);
init
();
SWal
*
pWal
=
createWal
(
path
,
vgId
);
assert
(
pWal
!=
NULL
);
SSyncNode
*
pSyncNode
=
createSyncNode
(
pWal
);
assert
(
pSyncNode
!=
NULL
);
SSyncLogStore
*
pLog
=
logStoreCreate
(
pSyncNode
);
assert
(
pLog
!=
NULL
);
int32_t
code
=
pLog
->
syncLogRestoreFromSnapshot
(
pLog
,
snapshotIndex
);
assert
(
code
==
0
);
walClose
(
pWal
);
logStoreDestory
(
pLog
);
taosMemoryFree
(
pSyncNode
);
cleanup
();
return
0
;
}
source/util/src/tlog.c
浏览文件 @
294acc9e
...
@@ -94,7 +94,7 @@ int32_t tdbDebugFlag = 131;
...
@@ -94,7 +94,7 @@ int32_t tdbDebugFlag = 131;
int32_t
tqDebugFlag
=
135
;
int32_t
tqDebugFlag
=
135
;
int32_t
fsDebugFlag
=
135
;
int32_t
fsDebugFlag
=
135
;
int32_t
metaDebugFlag
=
135
;
int32_t
metaDebugFlag
=
135
;
int32_t
fn
DebugFlag
=
135
;
int32_t
udf
DebugFlag
=
135
;
int32_t
smaDebugFlag
=
135
;
int32_t
smaDebugFlag
=
135
;
int32_t
idxDebugFlag
=
135
;
int32_t
idxDebugFlag
=
135
;
...
@@ -758,7 +758,7 @@ void taosSetAllDebugFlag(int32_t flag) {
...
@@ -758,7 +758,7 @@ void taosSetAllDebugFlag(int32_t flag) {
tsdbDebugFlag
=
flag
;
tsdbDebugFlag
=
flag
;
tqDebugFlag
=
flag
;
tqDebugFlag
=
flag
;
fsDebugFlag
=
flag
;
fsDebugFlag
=
flag
;
fn
DebugFlag
=
flag
;
udf
DebugFlag
=
flag
;
smaDebugFlag
=
flag
;
smaDebugFlag
=
flag
;
idxDebugFlag
=
flag
;
idxDebugFlag
=
flag
;
...
...
tests/script/jenkins/basic.txt
浏览文件 @
294acc9e
...
@@ -163,8 +163,8 @@
...
@@ -163,8 +163,8 @@
# --- sma
# --- sma
./test.sh -f tsim/sma/drop_sma.sim
./test.sh -f tsim/sma/drop_sma.sim
./test.sh -f tsim/sma/tsmaCreateInsertQuery.sim
./test.sh -f tsim/sma/tsmaCreateInsertQuery.sim
#
./test.sh -f tsim/sma/rsmaCreateInsertQuery.sim
./test.sh -f tsim/sma/rsmaCreateInsertQuery.sim
#
./test.sh -f tsim/sma/rsmaPersistenceRecovery.sim
./test.sh -f tsim/sma/rsmaPersistenceRecovery.sim
# --- valgrind
# --- valgrind
./test.sh -f tsim/valgrind/checkError1.sim
./test.sh -f tsim/valgrind/checkError1.sim
...
...
tests/script/sh/deploy.sh
浏览文件 @
294acc9e
...
@@ -134,10 +134,14 @@ echo "cDebugFlag 143" >> $TAOS_CFG
...
@@ -134,10 +134,14 @@ echo "cDebugFlag 143" >> $TAOS_CFG
echo
"jniDebugFlag 143"
>>
$TAOS_CFG
echo
"jniDebugFlag 143"
>>
$TAOS_CFG
echo
"qDebugFlag 143"
>>
$TAOS_CFG
echo
"qDebugFlag 143"
>>
$TAOS_CFG
echo
"rpcDebugFlag 143"
>>
$TAOS_CFG
echo
"rpcDebugFlag 143"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"uDebugFlag 143"
>>
$TAOS_CFG
echo
"sDebugFlag 143"
>>
$TAOS_CFG
echo
"sDebugFlag 143"
>>
$TAOS_CFG
echo
"wDebugFlag 143"
>>
$TAOS_CFG
echo
"wDebugFlag 143"
>>
$TAOS_CFG
echo
"idxDebugFlag 143"
>>
$TAOS_CFG
echo
"fsDebugFlag 143"
>>
$TAOS_CFG
echo
"udfDebugFlag 143"
>>
$TAOS_CFG
echo
"smaDebugFlag 143"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"uDebugFlag 131"
>>
$TAOS_CFG
echo
"numOfLogLines 20000000"
>>
$TAOS_CFG
echo
"numOfLogLines 20000000"
>>
$TAOS_CFG
echo
"statusInterval 1"
>>
$TAOS_CFG
echo
"statusInterval 1"
>>
$TAOS_CFG
echo
"asyncLog 0"
>>
$TAOS_CFG
echo
"asyncLog 0"
>>
$TAOS_CFG
...
...
tests/script/tsim/sync/vnodesnapshot.sim
浏览文件 @
294acc9e
...
@@ -142,20 +142,33 @@ sql create table ct1 using stb tags(1000)
...
@@ -142,20 +142,33 @@ sql create table ct1 using stb tags(1000)
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
$N = 100
sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
$count = 0
while $count < $N
$ms = 1591200000000 + $count
sql insert into ct1 values( $ms , $count , 2.1, 3.1)
$count = $count + 1
endw
#sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
#sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
#sql flush database db;
#sql flush database db;
#system sh/exec.sh -n dnode4 -s start
#system sh/exec.sh -n dnode4 -s start
sql insert into ct1 values(now+1s, 81, 8.1, 8.1)(now+2s, -92, -9.2, -9.2)(now+3s, -73, -7.3, -7.3)
#sql insert into ct1 values(now+1s, 81, 8.1, 8.1)(now+2s, -92, -9.2, -9.2)(now+3s, -73, -7.3, -7.3)
sleep 5000
#
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
#
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
#
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
#system sh/exec.sh -n dnode4 -s stop -x SIGINT
#system sh/exec.sh -n dnode4 -s stop -x SIGINT
...
...
tests/system-test/0-others/cachelast.py
浏览文件 @
294acc9e
...
@@ -13,7 +13,7 @@ from util.dnodes import *
...
@@ -13,7 +13,7 @@ from util.dnodes import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
True
)
tdSql
.
init
(
conn
.
cursor
(),
True
)
...
...
tests/system-test/2-query/abs.py
浏览文件 @
294acc9e
...
@@ -12,7 +12,7 @@ import random
...
@@ -12,7 +12,7 @@ import random
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
tests/system-test/2-query/and_or_for_byte.py
浏览文件 @
294acc9e
...
@@ -12,7 +12,7 @@ import random
...
@@ -12,7 +12,7 @@ import random
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
tests/system-test/2-query/arccos.py
浏览文件 @
294acc9e
...
@@ -11,7 +11,7 @@ from util.cases import *
...
@@ -11,7 +11,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
powSql
):
def
init
(
self
,
conn
,
powSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
())
...
...
tests/system-test/2-query/arcsin.py
浏览文件 @
294acc9e
...
@@ -11,7 +11,7 @@ from util.cases import *
...
@@ -11,7 +11,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
powSql
):
def
init
(
self
,
conn
,
powSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
())
...
...
tests/system-test/2-query/arctan.py
浏览文件 @
294acc9e
...
@@ -11,7 +11,7 @@ from util.cases import *
...
@@ -11,7 +11,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
powSql
):
def
init
(
self
,
conn
,
powSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
())
...
...
tests/system-test/2-query/avg.py
浏览文件 @
294acc9e
...
@@ -10,7 +10,7 @@ from util.cases import *
...
@@ -10,7 +10,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
True
)
tdSql
.
init
(
conn
.
cursor
(),
True
)
...
...
tests/system-test/2-query/ceil.py
浏览文件 @
294acc9e
...
@@ -11,7 +11,7 @@ from util.cases import *
...
@@ -11,7 +11,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
tests/system-test/2-query/check_tsdb.py
浏览文件 @
294acc9e
...
@@ -11,7 +11,7 @@ from util.dnodes import *
...
@@ -11,7 +11,7 @@ from util.dnodes import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
True
)
tdSql
.
init
(
conn
.
cursor
(),
True
)
...
...
tests/system-test/2-query/cos.py
浏览文件 @
294acc9e
...
@@ -11,7 +11,7 @@ from util.cases import *
...
@@ -11,7 +11,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
powSql
):
def
init
(
self
,
conn
,
powSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
())
...
...
tests/system-test/2-query/distribute_agg_apercentile.py
浏览文件 @
294acc9e
...
@@ -8,7 +8,7 @@ import random
...
@@ -8,7 +8,7 @@ import random
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
,
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
...
...
tests/system-test/2-query/distribute_agg_avg.py
浏览文件 @
294acc9e
...
@@ -9,7 +9,7 @@ import platform
...
@@ -9,7 +9,7 @@ import platform
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
,
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
...
...
tests/system-test/2-query/distribute_agg_count.py
浏览文件 @
294acc9e
...
@@ -8,7 +8,7 @@ import random
...
@@ -8,7 +8,7 @@ import random
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
,
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
...
...
tests/system-test/2-query/distribute_agg_max.py
浏览文件 @
294acc9e
...
@@ -8,7 +8,7 @@ import random
...
@@ -8,7 +8,7 @@ import random
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
,
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
...
...
tests/system-test/2-query/distribute_agg_min.py
浏览文件 @
294acc9e
...
@@ -8,7 +8,7 @@ import random
...
@@ -8,7 +8,7 @@ import random
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
,
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
...
...
tests/system-test/2-query/distribute_agg_spread.py
浏览文件 @
294acc9e
...
@@ -8,7 +8,7 @@ import random
...
@@ -8,7 +8,7 @@ import random
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
,
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
...
...
tests/system-test/2-query/distribute_agg_stddev.py
浏览文件 @
294acc9e
...
@@ -9,7 +9,7 @@ import math
...
@@ -9,7 +9,7 @@ import math
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
,
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
...
...
tests/system-test/2-query/distribute_agg_sum.py
浏览文件 @
294acc9e
...
@@ -9,7 +9,7 @@ import platform
...
@@ -9,7 +9,7 @@ import platform
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
,
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
...
...
tests/system-test/2-query/floor.py
浏览文件 @
294acc9e
...
@@ -11,7 +11,7 @@ from util.cases import *
...
@@ -11,7 +11,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
tests/system-test/2-query/function_null.py
浏览文件 @
294acc9e
...
@@ -12,7 +12,7 @@ import random
...
@@ -12,7 +12,7 @@ import random
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
tests/system-test/2-query/function_stateduration.py
浏览文件 @
294acc9e
...
@@ -13,7 +13,7 @@ from util.cases import *
...
@@ -13,7 +13,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
tests/system-test/2-query/irate.py
浏览文件 @
294acc9e
...
@@ -12,7 +12,7 @@ import random
...
@@ -12,7 +12,7 @@ import random
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
tests/system-test/2-query/log.py
浏览文件 @
294acc9e
...
@@ -12,7 +12,7 @@ from util.cases import *
...
@@ -12,7 +12,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
())
...
...
tests/system-test/2-query/max.py
浏览文件 @
294acc9e
...
@@ -7,7 +7,7 @@ import numpy as np
...
@@ -7,7 +7,7 @@ import numpy as np
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
,
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
...
...
tests/system-test/2-query/nestedQuery.py
浏览文件 @
294acc9e
...
@@ -25,7 +25,7 @@ from util.dnodes import *
...
@@ -25,7 +25,7 @@ from util.dnodes import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'maxSQLLength'
:
1048576
,
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'maxSQLLength'
:
1048576
,
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
...
...
tests/system-test/2-query/nestedQuery_str.py
浏览文件 @
294acc9e
...
@@ -26,7 +26,7 @@ from util.dnodes import *
...
@@ -26,7 +26,7 @@ from util.dnodes import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'maxSQLLength'
:
1048576
,
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'maxSQLLength'
:
1048576
,
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
...
...
tests/system-test/2-query/pow.py
浏览文件 @
294acc9e
...
@@ -11,7 +11,7 @@ from util.cases import *
...
@@ -11,7 +11,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
powSql
):
def
init
(
self
,
conn
,
powSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
())
...
...
tests/system-test/2-query/round.py
浏览文件 @
294acc9e
...
@@ -10,7 +10,7 @@ from util.cases import *
...
@@ -10,7 +10,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
tests/system-test/2-query/sin.py
浏览文件 @
294acc9e
...
@@ -11,7 +11,7 @@ from util.cases import *
...
@@ -11,7 +11,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
powSql
):
def
init
(
self
,
conn
,
powSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
())
...
...
tests/system-test/2-query/sqrt.py
浏览文件 @
294acc9e
...
@@ -11,7 +11,7 @@ from util.cases import *
...
@@ -11,7 +11,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
powSql
):
def
init
(
self
,
conn
,
powSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
())
...
...
tests/system-test/2-query/statecount.py
浏览文件 @
294acc9e
...
@@ -13,7 +13,7 @@ from util.cases import *
...
@@ -13,7 +13,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
tests/system-test/2-query/tail.py
浏览文件 @
294acc9e
...
@@ -12,7 +12,7 @@ from util.cases import *
...
@@ -12,7 +12,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
tests/system-test/2-query/tan.py
浏览文件 @
294acc9e
...
@@ -11,7 +11,7 @@ from util.cases import *
...
@@ -11,7 +11,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
powSql
):
def
init
(
self
,
conn
,
powSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
())
...
...
tests/system-test/2-query/twa.py
浏览文件 @
294acc9e
...
@@ -9,7 +9,7 @@ import math
...
@@ -9,7 +9,7 @@ import math
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
,
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
...
...
tests/system-test/2-query/unique.py
浏览文件 @
294acc9e
...
@@ -13,7 +13,7 @@ from util.cases import *
...
@@ -13,7 +13,7 @@ from util.cases import *
class
TDTestCase
:
class
TDTestCase
:
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
updatecfgDict
=
{
'debugFlag'
:
143
,
"cDebugFlag"
:
143
,
"uDebugFlag"
:
143
,
"rpcDebugFlag"
:
143
,
"tmrDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"jniDebugFlag"
:
143
,
"simDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"dDebugFlag"
:
143
,
"vDebugFlag"
:
143
,
"mDebugFlag"
:
143
,
"qDebugFlag"
:
143
,
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
fn
DebugFlag"
:
143
}
"wDebugFlag"
:
143
,
"sDebugFlag"
:
143
,
"tsdbDebugFlag"
:
143
,
"tqDebugFlag"
:
143
,
"fsDebugFlag"
:
143
,
"
udf
DebugFlag"
:
143
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
taosadapter
@
c885e967
比较
389047db
...
c885e967
Subproject commit
389047db713a3dddfbce292c3260b0864b17d936
Subproject commit
c885e967e490105999b84d009a15168728dfafaf
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录