Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1e21eaff
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看板
提交
1e21eaff
编写于
7月 20, 2020
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into feature/2.0tsdb
上级
90144781
c57bdc18
变更
190
展开全部
隐藏空白更改
内联
并排
Showing
190 changed file
with
1840 addition
and
1308 deletion
+1840
-1308
src/client/inc/tscUtil.h
src/client/inc/tscUtil.h
+1
-1
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+3
-3
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+2
-2
src/client/src/tscServer.c
src/client/src/tscServer.c
+51
-51
src/client/src/tscSql.c
src/client/src/tscSql.c
+2
-2
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+7
-7
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+3
-3
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+8
-8
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+0
-2
src/common/src/tglobal.c
src/common/src/tglobal.c
+15
-25
src/connector/grafana/tdengine/package-lock.json
src/connector/grafana/tdengine/package-lock.json
+4
-4
src/connector/grafana/tdengine/package.json
src/connector/grafana/tdengine/package.json
+1
-1
src/connector/grafana/tdengine/yarn.lock
src/connector/grafana/tdengine/yarn.lock
+4
-8
src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TDNode.java
...or/jdbc/src/main/java/com/taosdata/jdbc/utils/TDNode.java
+0
-1
src/cq/src/cqMain.c
src/cq/src/cqMain.c
+3
-3
src/dnode/inc/dnodeMgmt.h
src/dnode/inc/dnodeMgmt.h
+2
-2
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+52
-53
src/dnode/src/dnodePeer.c
src/dnode/src/dnodePeer.c
+12
-12
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+2
-2
src/inc/dnode.h
src/inc/dnode.h
+3
-3
src/inc/taosdef.h
src/inc/taosdef.h
+1
-2
src/inc/taosmsg.h
src/inc/taosmsg.h
+7
-7
src/inc/trpc.h
src/inc/trpc.h
+7
-7
src/inc/tsdb.h
src/inc/tsdb.h
+1
-6
src/kit/taosmigrate/taosmigrate.c
src/kit/taosmigrate/taosmigrate.c
+4
-4
src/kit/taosmigrate/taosmigrate.h
src/kit/taosmigrate/taosmigrate.h
+1
-1
src/kit/taosmigrate/taosmigrateDnodeCfg.c
src/kit/taosmigrate/taosmigrateDnodeCfg.c
+18
-18
src/mnode/inc/mnodeDef.h
src/mnode/inc/mnodeDef.h
+3
-3
src/mnode/inc/mnodeMnode.h
src/mnode/inc/mnodeMnode.h
+3
-3
src/mnode/inc/mnodeVgroup.h
src/mnode/inc/mnodeVgroup.h
+3
-3
src/mnode/src/mnodeBalance.c
src/mnode/src/mnodeBalance.c
+2
-2
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+30
-16
src/mnode/src/mnodeMnode.c
src/mnode/src/mnodeMnode.c
+24
-24
src/mnode/src/mnodePeer.c
src/mnode/src/mnodePeer.c
+7
-7
src/mnode/src/mnodeRead.c
src/mnode/src/mnodeRead.c
+7
-7
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+28
-53
src/mnode/src/mnodeShow.c
src/mnode/src/mnodeShow.c
+2
-2
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+34
-35
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+35
-34
src/mnode/src/mnodeWrite.c
src/mnode/src/mnodeWrite.c
+8
-8
src/plugins/monitor/src/monitorMain.c
src/plugins/monitor/src/monitorMain.c
+4
-0
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+86
-64
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+30
-30
src/rpc/test/rclient.c
src/rpc/test/rclient.c
+15
-15
src/rpc/test/rsclient.c
src/rpc/test/rsclient.c
+13
-13
src/rpc/test/rserver.c
src/rpc/test/rserver.c
+1
-1
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+2
-1
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+27
-10
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+7
-7
tests/comparisonTest/tdengine/q5.txt
tests/comparisonTest/tdengine/q5.txt
+1
-0
tests/comparisonTest/tdengine/tdengineTest.c
tests/comparisonTest/tdengine/tdengineTest.c
+54
-21
tests/perftest-scripts/tdengineTestQ1Loop.sh
tests/perftest-scripts/tdengineTestQ1Loop.sh
+127
-0
tests/perftest-scripts/tdengineTestQ2Loop.sh
tests/perftest-scripts/tdengineTestQ2Loop.sh
+348
-0
tests/perftest-scripts/tdengineTestQ3Loop.sh
tests/perftest-scripts/tdengineTestQ3Loop.sh
+124
-0
tests/perftest-scripts/tdengineTestQ4Loop.sh
tests/perftest-scripts/tdengineTestQ4Loop.sh
+124
-0
tests/perftest-scripts/tdengineTestQ5Loop.sh
tests/perftest-scripts/tdengineTestQ5Loop.sh
+107
-0
tests/perftest-scripts/tdengineTestWriteLoop.sh
tests/perftest-scripts/tdengineTestWriteLoop.sh
+116
-0
tests/pytest/util/dnodes-no-random-fail.py
tests/pytest/util/dnodes-no-random-fail.py
+0
-1
tests/pytest/util/dnodes-random-fail.py
tests/pytest/util/dnodes-random-fail.py
+0
-1
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+0
-1
tests/script/general/db/alter_option.sim
tests/script/general/db/alter_option.sim
+0
-1
tests/script/general/db/basic.sim
tests/script/general/db/basic.sim
+1
-3
tests/script/general/db/delete.sim
tests/script/general/db/delete.sim
+0
-1
tests/script/general/db/delete_reuse1.sim
tests/script/general/db/delete_reuse1.sim
+0
-5
tests/script/general/db/delete_reuse2.sim
tests/script/general/db/delete_reuse2.sim
+0
-5
tests/script/general/db/delete_reusevnode.sim
tests/script/general/db/delete_reusevnode.sim
+0
-7
tests/script/general/db/delete_reusevnode2.sim
tests/script/general/db/delete_reusevnode2.sim
+0
-3
tests/script/general/db/delete_writing1.sim
tests/script/general/db/delete_writing1.sim
+0
-5
tests/script/general/db/delete_writing2.sim
tests/script/general/db/delete_writing2.sim
+0
-1
tests/script/general/db/len.sim
tests/script/general/db/len.sim
+0
-1
tests/script/general/db/repeat.sim
tests/script/general/db/repeat.sim
+0
-1
tests/script/general/db/vnodes.sim
tests/script/general/db/vnodes.sim
+0
-1
tests/script/general/parser/bug.sim
tests/script/general/parser/bug.sim
+0
-1
tests/script/general/parser/first_last_query.sim
tests/script/general/parser/first_last_query.sim
+11
-0
tests/script/general/parser/null_char.sim
tests/script/general/parser/null_char.sim
+15
-0
tests/script/general/parser/select_across_vnodes.sim
tests/script/general/parser/select_across_vnodes.sim
+0
-1
tests/script/general/parser/select_from_cache_disk.sim
tests/script/general/parser/select_from_cache_disk.sim
+0
-1
tests/script/general/parser/slimit.sim
tests/script/general/parser/slimit.sim
+0
-1
tests/script/general/parser/slimit1.sim
tests/script/general/parser/slimit1.sim
+0
-1
tests/script/general/parser/slimit_alter_tags.sim
tests/script/general/parser/slimit_alter_tags.sim
+0
-1
tests/script/general/parser/timestamp.sim
tests/script/general/parser/timestamp.sim
+0
-1
tests/script/general/stable/disk.sim
tests/script/general/stable/disk.sim
+0
-1
tests/script/general/stable/dnode3.sim
tests/script/general/stable/dnode3.sim
+0
-4
tests/script/general/stable/metrics.sim
tests/script/general/stable/metrics.sim
+0
-1
tests/script/general/stable/refcount.sim
tests/script/general/stable/refcount.sim
+0
-1
tests/script/general/stable/show.sim
tests/script/general/stable/show.sim
+0
-1
tests/script/general/stable/values.sim
tests/script/general/stable/values.sim
+0
-1
tests/script/general/stable/vnode3.sim
tests/script/general/stable/vnode3.sim
+0
-2
tests/script/general/stream/metrics_replica1_vnoden.sim
tests/script/general/stream/metrics_replica1_vnoden.sim
+0
-1
tests/script/general/stream/table_replica1_vnoden.sim
tests/script/general/stream/table_replica1_vnoden.sim
+0
-1
tests/script/general/table/delete_reuse1.sim
tests/script/general/table/delete_reuse1.sim
+0
-5
tests/script/general/table/delete_reuse2.sim
tests/script/general/table/delete_reuse2.sim
+0
-5
tests/script/general/table/delete_writing.sim
tests/script/general/table/delete_writing.sim
+0
-5
tests/script/general/table/limit.sim
tests/script/general/table/limit.sim
+0
-1
tests/script/general/table/vgroup.sim
tests/script/general/table/vgroup.sim
+1
-8
tests/script/sh/clear.sh
tests/script/sh/clear.sh
+0
-1
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+0
-1
tests/script/tmp/http.sim
tests/script/tmp/http.sim
+0
-5
tests/script/tmp/mnodes.sim
tests/script/tmp/mnodes.sim
+0
-4
tests/script/unique/account/authority.sim
tests/script/unique/account/authority.sim
+0
-1
tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim
tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim
...script/unique/arbitrator/dn3_mn1_full_createTableFail.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim
...s/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim
...script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim
...e/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim
tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim
tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
...t/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
+6
-13
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
...ipt/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
+5
-10
tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim
tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim
...t/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim
...pt/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim
.../unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim
tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim
...unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim
tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim
+4
-9
tests/script/unique/arbitrator/dn3_mn2_killDnode.sim
tests/script/unique/arbitrator/dn3_mn2_killDnode.sim
+4
-9
tests/script/unique/arbitrator/insert_duplicationTs.sim
tests/script/unique/arbitrator/insert_duplicationTs.sim
+4
-9
tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim
.../unique/arbitrator/offline_replica2_alterTable_online.sim
+4
-9
tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim
...pt/unique/arbitrator/offline_replica2_alterTag_online.sim
+4
-9
tests/script/unique/arbitrator/offline_replica2_createTable_online.sim
...unique/arbitrator/offline_replica2_createTable_online.sim
+4
-9
tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim
...ript/unique/arbitrator/offline_replica2_dropDb_online.sim
+4
-9
tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim
...t/unique/arbitrator/offline_replica2_dropTable_online.sim
+4
-9
tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim
.../unique/arbitrator/offline_replica3_alterTable_online.sim
+4
-9
tests/script/unique/arbitrator/offline_replica3_alterTag_online.sim
...pt/unique/arbitrator/offline_replica3_alterTag_online.sim
+4
-4
tests/script/unique/arbitrator/offline_replica3_createTable_online.sim
...unique/arbitrator/offline_replica3_createTable_online.sim
+4
-9
tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim
...ript/unique/arbitrator/offline_replica3_dropDb_online.sim
+4
-9
tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim
...t/unique/arbitrator/offline_replica3_dropTable_online.sim
+4
-9
tests/script/unique/arbitrator/replica_changeWithArbitrator.sim
...script/unique/arbitrator/replica_changeWithArbitrator.sim
+6
-11
tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim
...script/unique/arbitrator/sync_replica2_alterTable_add.sim
+4
-9
tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim
...cript/unique/arbitrator/sync_replica2_alterTable_drop.sim
+4
-9
tests/script/unique/arbitrator/sync_replica2_dropDb.sim
tests/script/unique/arbitrator/sync_replica2_dropDb.sim
+4
-9
tests/script/unique/arbitrator/sync_replica2_dropTable.sim
tests/script/unique/arbitrator/sync_replica2_dropTable.sim
+4
-9
tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim
...script/unique/arbitrator/sync_replica3_alterTable_add.sim
+4
-9
tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim
...cript/unique/arbitrator/sync_replica3_alterTable_drop.sim
+4
-9
tests/script/unique/arbitrator/sync_replica3_createTable.sim
tests/script/unique/arbitrator/sync_replica3_createTable.sim
+4
-9
tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim
...ator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim
+4
-9
tests/script/unique/arbitrator/sync_replica3_dropDb.sim
tests/script/unique/arbitrator/sync_replica3_dropDb.sim
+4
-9
tests/script/unique/arbitrator/sync_replica3_dropTable.sim
tests/script/unique/arbitrator/sync_replica3_dropTable.sim
+4
-9
tests/script/unique/big/balance.sim
tests/script/unique/big/balance.sim
+0
-5
tests/script/unique/big/maxvnodes.sim
tests/script/unique/big/maxvnodes.sim
+0
-2
tests/script/unique/big/restartSpeed.sim
tests/script/unique/big/restartSpeed.sim
+0
-2
tests/script/unique/cluster/balance1.sim
tests/script/unique/cluster/balance1.sim
+0
-9
tests/script/unique/cluster/balance2.sim
tests/script/unique/cluster/balance2.sim
+0
-9
tests/script/unique/cluster/balance3.sim
tests/script/unique/cluster/balance3.sim
+0
-9
tests/script/unique/cluster/client1_0.sim
tests/script/unique/cluster/client1_0.sim
+0
-5
tests/script/unique/cluster/cluster_main.sim
tests/script/unique/cluster/cluster_main.sim
+5
-11
tests/script/unique/cluster/cluster_main0.sim
tests/script/unique/cluster/cluster_main0.sim
+5
-11
tests/script/unique/cluster/cluster_main1.sim
tests/script/unique/cluster/cluster_main1.sim
+5
-11
tests/script/unique/cluster/cluster_main2.sim
tests/script/unique/cluster/cluster_main2.sim
+5
-11
tests/script/unique/cluster/main1_client1_0.sim
tests/script/unique/cluster/main1_client1_0.sim
+1
-2
tests/script/unique/cluster/main2_client1_0.sim
tests/script/unique/cluster/main2_client1_0.sim
+0
-1
tests/script/unique/db/delete.sim
tests/script/unique/db/delete.sim
+0
-3
tests/script/unique/db/delete_part.sim
tests/script/unique/db/delete_part.sim
+4
-9
tests/script/unique/db/replica_add12.sim
tests/script/unique/db/replica_add12.sim
+0
-5
tests/script/unique/db/replica_add13.sim
tests/script/unique/db/replica_add13.sim
+0
-5
tests/script/unique/db/replica_add23.sim
tests/script/unique/db/replica_add23.sim
+0
-5
tests/script/unique/db/replica_part.sim
tests/script/unique/db/replica_part.sim
+0
-3
tests/script/unique/db/replica_reduce21.sim
tests/script/unique/db/replica_reduce21.sim
+0
-6
tests/script/unique/db/replica_reduce31.sim
tests/script/unique/db/replica_reduce31.sim
+0
-3
tests/script/unique/db/replica_reduce32.sim
tests/script/unique/db/replica_reduce32.sim
+0
-3
tests/script/unique/dnode/alternativeRole.sim
tests/script/unique/dnode/alternativeRole.sim
+3
-3
tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim
tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim
+4
-9
tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
...s/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
+4
-9
tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
...migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
+4
-9
tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
+4
-9
tests/script/unique/stable/balance_replica1.sim
tests/script/unique/stable/balance_replica1.sim
+0
-2
tests/script/unique/stable/dnode2.sim
tests/script/unique/stable/dnode2.sim
+0
-2
tests/script/unique/stable/dnode2_stop.sim
tests/script/unique/stable/dnode2_stop.sim
+0
-2
tests/script/unique/stable/dnode3.sim
tests/script/unique/stable/dnode3.sim
+0
-3
tests/script/unique/stable/replica2_dnode4.sim
tests/script/unique/stable/replica2_dnode4.sim
+0
-4
tests/script/unique/stable/replica2_vnode3.sim
tests/script/unique/stable/replica2_vnode3.sim
+0
-2
tests/script/unique/stable/replica3_dnode6.sim
tests/script/unique/stable/replica3_dnode6.sim
+0
-7
tests/script/unique/stable/replica3_vnode3.sim
tests/script/unique/stable/replica3_vnode3.sim
+0
-4
tests/script/unique/stream/metrics_balance.sim
tests/script/unique/stream/metrics_balance.sim
+0
-2
tests/script/unique/stream/metrics_replica1_dnode2.sim
tests/script/unique/stream/metrics_replica1_dnode2.sim
+0
-2
tests/script/unique/stream/metrics_replica2_dnode2_vnoden.sim
...s/script/unique/stream/metrics_replica2_dnode2_vnoden.sim
+0
-2
tests/script/unique/stream/metrics_replica2_dnode3.sim
tests/script/unique/stream/metrics_replica2_dnode3.sim
+0
-3
tests/script/unique/stream/metrics_replica3_dnode4.sim
tests/script/unique/stream/metrics_replica3_dnode4.sim
+0
-4
tests/script/unique/stream/table_balance.sim
tests/script/unique/stream/table_balance.sim
+0
-4
tests/script/unique/stream/table_move.sim
tests/script/unique/stream/table_move.sim
+0
-10
tests/script/unique/stream/table_replica1_dnode2.sim
tests/script/unique/stream/table_replica1_dnode2.sim
+0
-4
tests/script/unique/stream/table_replica2_dnode2_vnoden.sim
tests/script/unique/stream/table_replica2_dnode2_vnoden.sim
+0
-2
tests/script/unique/stream/table_replica2_dnode3.sim
tests/script/unique/stream/table_replica2_dnode3.sim
+0
-3
tests/script/unique/stream/table_replica3_dnode4.sim
tests/script/unique/stream/table_replica3_dnode4.sim
+0
-4
tests/script/unique/vnode/many.sim
tests/script/unique/vnode/many.sim
+0
-4
tests/script/unique/vnode/replica2_basic2.sim
tests/script/unique/vnode/replica2_basic2.sim
+0
-5
tests/tsim/src/simExe.c
tests/tsim/src/simExe.c
+13
-3
未找到文件。
src/client/inc/tscUtil.h
浏览文件 @
1e21eaff
...
@@ -268,7 +268,7 @@ bool hasMoreClauseToTry(SSqlObj* pSql);
...
@@ -268,7 +268,7 @@ bool hasMoreClauseToTry(SSqlObj* pSql);
void
tscTryQueryNextVnode
(
SSqlObj
*
pSql
,
__async_cb_func_t
fp
);
void
tscTryQueryNextVnode
(
SSqlObj
*
pSql
,
__async_cb_func_t
fp
);
void
tscAsyncQuerySingleRowForNextVnode
(
void
*
param
,
TAOS_RES
*
tres
,
int
numOfRows
);
void
tscAsyncQuerySingleRowForNextVnode
(
void
*
param
,
TAOS_RES
*
tres
,
int
numOfRows
);
void
tscTryQueryNextClause
(
SSqlObj
*
pSql
,
__async_cb_func_t
fp
);
void
tscTryQueryNextClause
(
SSqlObj
*
pSql
,
__async_cb_func_t
fp
);
int
tscSetMgmt
IpLis
tFromCfg
(
const
char
*
first
,
const
char
*
second
);
int
tscSetMgmt
EpSe
tFromCfg
(
const
char
*
first
,
const
char
*
second
);
void
*
malloc_throw
(
size_t
size
);
void
*
malloc_throw
(
size_t
size
);
void
*
calloc_throw
(
size_t
nmemb
,
size_t
size
);
void
*
calloc_throw
(
size_t
nmemb
,
size_t
size
);
...
...
src/client/inc/tsclient.h
浏览文件 @
1e21eaff
...
@@ -306,7 +306,7 @@ typedef struct SSqlObj {
...
@@ -306,7 +306,7 @@ typedef struct SSqlObj {
char
*
sqlstr
;
char
*
sqlstr
;
char
retry
;
char
retry
;
char
maxRetry
;
char
maxRetry
;
SRpc
IpSet
ipLis
t
;
SRpc
EpSet
epSe
t
;
char
listed
;
char
listed
;
tsem_t
rspSem
;
tsem_t
rspSem
;
SSqlCmd
cmd
;
SSqlCmd
cmd
;
...
@@ -350,7 +350,7 @@ void tscInitMsgsFp();
...
@@ -350,7 +350,7 @@ void tscInitMsgsFp();
int
tsParseSql
(
SSqlObj
*
pSql
,
bool
initial
);
int
tsParseSql
(
SSqlObj
*
pSql
,
bool
initial
);
void
tscProcessMsgFromServer
(
SRpcMsg
*
rpcMsg
,
SRpc
IpSet
*
pI
pSet
);
void
tscProcessMsgFromServer
(
SRpcMsg
*
rpcMsg
,
SRpc
EpSet
*
pE
pSet
);
int
tscProcessSql
(
SSqlObj
*
pSql
);
int
tscProcessSql
(
SSqlObj
*
pSql
);
int
tscRenewTableMeta
(
SSqlObj
*
pSql
,
char
*
tableId
);
int
tscRenewTableMeta
(
SSqlObj
*
pSql
,
char
*
tableId
);
...
@@ -456,7 +456,7 @@ extern void * tscQhandle;
...
@@ -456,7 +456,7 @@ extern void * tscQhandle;
extern
int
tscKeepConn
[];
extern
int
tscKeepConn
[];
extern
int
tsInsertHeadSize
;
extern
int
tsInsertHeadSize
;
extern
int
tscNumOfThreads
;
extern
int
tscNumOfThreads
;
extern
SRpc
IpSet
tscMgmtI
pSet
;
extern
SRpc
EpSet
tscMgmtE
pSet
;
extern
int
(
*
tscBuildMsg
[
TSDB_SQL_MAX
])(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
);
extern
int
(
*
tscBuildMsg
[
TSDB_SQL_MAX
])(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
1e21eaff
...
@@ -2355,9 +2355,9 @@ bool validateIpAddress(const char* ip, size_t size) {
...
@@ -2355,9 +2355,9 @@ bool validateIpAddress(const char* ip, size_t size) {
strncpy
(
tmp
,
ip
,
size
);
strncpy
(
tmp
,
ip
,
size
);
in_addr_t
i
pAddr
=
inet_addr
(
tmp
);
in_addr_t
e
pAddr
=
inet_addr
(
tmp
);
return
i
pAddr
!=
INADDR_NONE
;
return
e
pAddr
!=
INADDR_NONE
;
}
}
int32_t
tscTansformSQLFuncForSTableQuery
(
SQueryInfo
*
pQueryInfo
)
{
int32_t
tscTansformSQLFuncForSTableQuery
(
SQueryInfo
*
pQueryInfo
)
{
...
...
src/client/src/tscServer.c
浏览文件 @
1e21eaff
...
@@ -29,8 +29,8 @@
...
@@ -29,8 +29,8 @@
#define TSC_MGMT_VNODE 999
#define TSC_MGMT_VNODE 999
SRpc
IpSet
tscMgmtI
pSet
;
SRpc
EpSet
tscMgmtE
pSet
;
SRpc
IpSet
tscDnodeI
pSet
;
SRpc
EpSet
tscDnodeE
pSet
;
int
(
*
tscBuildMsg
[
TSDB_SQL_MAX
])(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
=
{
0
};
int
(
*
tscBuildMsg
[
TSDB_SQL_MAX
])(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
=
{
0
};
...
@@ -44,44 +44,44 @@ void tscSaveSubscriptionProgress(void* sub);
...
@@ -44,44 +44,44 @@ void tscSaveSubscriptionProgress(void* sub);
static
int32_t
minMsgSize
()
{
return
tsRpcHeadSize
+
100
;
}
static
int32_t
minMsgSize
()
{
return
tsRpcHeadSize
+
100
;
}
static
void
tscSetDnode
IpLis
t
(
SSqlObj
*
pSql
,
SCMVgroupInfo
*
pVgroupInfo
)
{
static
void
tscSetDnode
EpSe
t
(
SSqlObj
*
pSql
,
SCMVgroupInfo
*
pVgroupInfo
)
{
SRpc
IpSet
*
pIpList
=
&
pSql
->
ipLis
t
;
SRpc
EpSet
*
pEpSet
=
&
pSql
->
epSe
t
;
p
IpLis
t
->
inUse
=
0
;
p
EpSe
t
->
inUse
=
0
;
if
(
pVgroupInfo
==
NULL
)
{
if
(
pVgroupInfo
==
NULL
)
{
p
IpList
->
numOfI
ps
=
0
;
p
EpSet
->
numOfE
ps
=
0
;
return
;
return
;
}
}
p
IpList
->
numOfIps
=
pVgroupInfo
->
numOfI
ps
;
p
EpSet
->
numOfEps
=
pVgroupInfo
->
numOfE
ps
;
for
(
int32_t
i
=
0
;
i
<
pVgroupInfo
->
numOf
I
ps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pVgroupInfo
->
numOf
E
ps
;
++
i
)
{
strcpy
(
p
IpList
->
fqdn
[
i
],
pVgroupInfo
->
i
pAddr
[
i
].
fqdn
);
strcpy
(
p
EpSet
->
fqdn
[
i
],
pVgroupInfo
->
e
pAddr
[
i
].
fqdn
);
p
IpList
->
port
[
i
]
=
pVgroupInfo
->
i
pAddr
[
i
].
port
;
p
EpSet
->
port
[
i
]
=
pVgroupInfo
->
e
pAddr
[
i
].
port
;
}
}
}
}
void
tscPrintMgmt
I
p
()
{
void
tscPrintMgmt
E
p
()
{
if
(
tscMgmt
IpSet
.
numOfI
ps
<=
0
)
{
if
(
tscMgmt
EpSet
.
numOfE
ps
<=
0
)
{
tscError
(
"invalid mnode
IP list:%d"
,
tscMgmtIpSet
.
numOfI
ps
);
tscError
(
"invalid mnode
EP list:%d"
,
tscMgmtEpSet
.
numOfE
ps
);
}
else
{
}
else
{
for
(
int
i
=
0
;
i
<
tscMgmt
IpSet
.
numOfI
ps
;
++
i
)
{
for
(
int
i
=
0
;
i
<
tscMgmt
EpSet
.
numOfE
ps
;
++
i
)
{
tscDebug
(
"mnode index:%d %s:%d"
,
i
,
tscMgmt
IpSet
.
fqdn
[
i
],
tscMgmtI
pSet
.
port
[
i
]);
tscDebug
(
"mnode index:%d %s:%d"
,
i
,
tscMgmt
EpSet
.
fqdn
[
i
],
tscMgmtE
pSet
.
port
[
i
]);
}
}
}
}
}
}
void
tscSetMgmt
IpList
(
SRpcIpSet
*
pIpLis
t
)
{
void
tscSetMgmt
EpSet
(
SRpcEpSet
*
pEpSe
t
)
{
tscMgmt
IpSet
.
numOfIps
=
pIpList
->
numOfI
ps
;
tscMgmt
EpSet
.
numOfEps
=
pEpSet
->
numOfE
ps
;
tscMgmt
IpSet
.
inUse
=
pIpLis
t
->
inUse
;
tscMgmt
EpSet
.
inUse
=
pEpSe
t
->
inUse
;
for
(
int32_t
i
=
0
;
i
<
tscMgmt
IpSet
.
numOfI
ps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
tscMgmt
EpSet
.
numOfE
ps
;
++
i
)
{
tscMgmt
IpSet
.
port
[
i
]
=
htons
(
pIpLis
t
->
port
[
i
]);
tscMgmt
EpSet
.
port
[
i
]
=
htons
(
pEpSe
t
->
port
[
i
]);
}
}
}
}
void
tscUpdate
IpSet
(
void
*
ahandle
,
SRpcIpSet
*
pI
pSet
)
{
void
tscUpdate
EpSet
(
void
*
ahandle
,
SRpcEpSet
*
pE
pSet
)
{
tscMgmt
IpSet
=
*
pI
pSet
;
tscMgmt
EpSet
=
*
pE
pSet
;
tscDebug
(
"mnode
IP list is changed for ufp is called, numOfIps:%d inUse:%d"
,
tscMgmtIpSet
.
numOfIps
,
tscMgmtI
pSet
.
inUse
);
tscDebug
(
"mnode
EP list is changed for ufp is called, numOfEps:%d inUse:%d"
,
tscMgmtEpSet
.
numOfEps
,
tscMgmtE
pSet
.
inUse
);
for
(
int32_t
i
=
0
;
i
<
tscMgmt
IpSet
.
numOfI
ps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
tscMgmt
EpSet
.
numOfE
ps
;
++
i
)
{
tscDebug
(
"index:%d fqdn:%s port:%d"
,
i
,
tscMgmt
IpSet
.
fqdn
[
i
],
tscMgmtI
pSet
.
port
[
i
]);
tscDebug
(
"index:%d fqdn:%s port:%d"
,
i
,
tscMgmt
EpSet
.
fqdn
[
i
],
tscMgmtE
pSet
.
port
[
i
]);
}
}
}
}
...
@@ -95,7 +95,7 @@ void tscUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) {
...
@@ -95,7 +95,7 @@ void tscUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) {
UNUSED_FUNC
UNUSED_FUNC
static
int32_t
tscGetMgmtConnMaxRetryTimes
()
{
static
int32_t
tscGetMgmtConnMaxRetryTimes
()
{
int32_t
factor
=
2
;
int32_t
factor
=
2
;
return
tscMgmt
IpSet
.
numOfI
ps
*
factor
;
return
tscMgmt
EpSet
.
numOfE
ps
*
factor
;
}
}
void
tscProcessHeartBeatRsp
(
void
*
param
,
TAOS_RES
*
tres
,
int
code
)
{
void
tscProcessHeartBeatRsp
(
void
*
param
,
TAOS_RES
*
tres
,
int
code
)
{
...
@@ -111,9 +111,9 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
...
@@ -111,9 +111,9 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
if
(
code
==
0
)
{
if
(
code
==
0
)
{
SCMHeartBeatRsp
*
pRsp
=
(
SCMHeartBeatRsp
*
)
pRes
->
pRsp
;
SCMHeartBeatRsp
*
pRsp
=
(
SCMHeartBeatRsp
*
)
pRes
->
pRsp
;
SRpc
IpSet
*
pIpList
=
&
pRsp
->
ipLis
t
;
SRpc
EpSet
*
pEpSet
=
&
pRsp
->
epSe
t
;
if
(
p
IpList
->
numOfI
ps
>
0
)
if
(
p
EpSet
->
numOfE
ps
>
0
)
tscSetMgmt
IpList
(
pIpLis
t
);
tscSetMgmt
EpSet
(
pEpSe
t
);
pSql
->
pTscObj
->
connId
=
htonl
(
pRsp
->
connId
);
pSql
->
pTscObj
->
connId
=
htonl
(
pRsp
->
connId
);
...
@@ -185,7 +185,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
...
@@ -185,7 +185,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
// set the mgmt ip list
// set the mgmt ip list
if
(
pSql
->
cmd
.
command
>=
TSDB_SQL_MGMT
)
{
if
(
pSql
->
cmd
.
command
>=
TSDB_SQL_MGMT
)
{
pSql
->
ipList
=
tscMgmtI
pSet
;
pSql
->
epSet
=
tscMgmtE
pSet
;
}
}
memcpy
(
pMsg
,
pSql
->
cmd
.
payload
,
pSql
->
cmd
.
payloadLen
);
memcpy
(
pMsg
,
pSql
->
cmd
.
payload
,
pSql
->
cmd
.
payloadLen
);
...
@@ -203,11 +203,11 @@ int tscSendMsgToServer(SSqlObj *pSql) {
...
@@ -203,11 +203,11 @@ int tscSendMsgToServer(SSqlObj *pSql) {
// Otherwise, the pSql object may have been released already during the response function, which is
// Otherwise, the pSql object may have been released already during the response function, which is
// processMsgFromServer function. In the meanwhile, the assignment of the rpc context to sql object will absolutely
// processMsgFromServer function. In the meanwhile, the assignment of the rpc context to sql object will absolutely
// cause crash.
// cause crash.
rpcSendRequest
(
pObj
->
pDnodeConn
,
&
pSql
->
ipLis
t
,
&
rpcMsg
);
rpcSendRequest
(
pObj
->
pDnodeConn
,
&
pSql
->
epSe
t
,
&
rpcMsg
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
void
tscProcessMsgFromServer
(
SRpcMsg
*
rpcMsg
,
SRpc
IpSet
*
pI
pSet
)
{
void
tscProcessMsgFromServer
(
SRpcMsg
*
rpcMsg
,
SRpc
EpSet
*
pE
pSet
)
{
SSqlObj
*
pSql
=
(
SSqlObj
*
)
rpcMsg
->
ahandle
;
SSqlObj
*
pSql
=
(
SSqlObj
*
)
rpcMsg
->
ahandle
;
if
(
pSql
==
NULL
||
pSql
->
signature
!=
pSql
)
{
if
(
pSql
==
NULL
||
pSql
->
signature
!=
pSql
)
{
tscError
(
"%p sql is already released"
,
pSql
);
tscError
(
"%p sql is already released"
,
pSql
);
...
@@ -237,9 +237,9 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
...
@@ -237,9 +237,9 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
}
}
if
(
pCmd
->
command
<
TSDB_SQL_MGMT
)
{
if
(
pCmd
->
command
<
TSDB_SQL_MGMT
)
{
if
(
p
IpSet
)
pSql
->
ipList
=
*
pI
pSet
;
if
(
p
EpSet
)
pSql
->
epSet
=
*
pE
pSet
;
}
else
{
}
else
{
if
(
p
IpSet
)
tscMgmtIpSet
=
*
pI
pSet
;
if
(
p
EpSet
)
tscMgmtEpSet
=
*
pE
pSet
;
}
}
if
(
rpcMsg
->
pCont
==
NULL
)
{
if
(
rpcMsg
->
pCont
==
NULL
)
{
...
@@ -421,7 +421,7 @@ int tscProcessSql(SSqlObj *pSql) {
...
@@ -421,7 +421,7 @@ int tscProcessSql(SSqlObj *pSql) {
return
pSql
->
res
.
code
;
return
pSql
->
res
.
code
;
}
}
}
else
if
(
pCmd
->
command
<
TSDB_SQL_LOCAL
)
{
}
else
if
(
pCmd
->
command
<
TSDB_SQL_LOCAL
)
{
pSql
->
ipList
=
tscMgmtI
pSet
;
pSql
->
epSet
=
tscMgmtE
pSet
;
}
else
{
// local handler
}
else
{
// local handler
return
(
*
tscProcessMsgRsp
[
pCmd
->
command
])(
pSql
);
return
(
*
tscProcessMsgRsp
[
pCmd
->
command
])(
pSql
);
}
}
...
@@ -525,10 +525,10 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -525,10 +525,10 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
// pSql->cmd.payloadLen is set during copying data into payload
// pSql->cmd.payloadLen is set during copying data into payload
pSql
->
cmd
.
msgType
=
TSDB_MSG_TYPE_SUBMIT
;
pSql
->
cmd
.
msgType
=
TSDB_MSG_TYPE_SUBMIT
;
tscSetDnode
IpLis
t
(
pSql
,
&
pTableMeta
->
vgroupInfo
);
tscSetDnode
EpSe
t
(
pSql
,
&
pTableMeta
->
vgroupInfo
);
tscDebug
(
"%p build submit msg, vgId:%d numOfTables:%d numberOf
I
P:%d"
,
pSql
,
vgId
,
pSql
->
cmd
.
numOfTablesInSubmit
,
tscDebug
(
"%p build submit msg, vgId:%d numOfTables:%d numberOf
E
P:%d"
,
pSql
,
vgId
,
pSql
->
cmd
.
numOfTablesInSubmit
,
pSql
->
ipList
.
numOfI
ps
);
pSql
->
epSet
.
numOfE
ps
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -568,7 +568,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
...
@@ -568,7 +568,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
pVgroupInfo
=
&
pTableMeta
->
vgroupInfo
;
pVgroupInfo
=
&
pTableMeta
->
vgroupInfo
;
}
}
tscSetDnode
IpLis
t
(
pSql
,
pVgroupInfo
);
tscSetDnode
EpSe
t
(
pSql
,
pVgroupInfo
);
if
(
pVgroupInfo
!=
NULL
)
{
if
(
pVgroupInfo
!=
NULL
)
{
pQueryMsg
->
head
.
vgId
=
htonl
(
pVgroupInfo
->
vgId
);
pQueryMsg
->
head
.
vgId
=
htonl
(
pVgroupInfo
->
vgId
);
}
}
...
@@ -580,7 +580,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
...
@@ -580,7 +580,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
pQueryMsg
->
numOfTables
=
htonl
(
1
);
// set the number of tables
pQueryMsg
->
numOfTables
=
htonl
(
1
);
// set the number of tables
pMsg
+=
sizeof
(
STableIdInfo
);
pMsg
+=
sizeof
(
STableIdInfo
);
}
else
{
// it is a subquery of the super table query, this
I
P info is acquired from vgroupInfo
}
else
{
// it is a subquery of the super table query, this
E
P info is acquired from vgroupInfo
int32_t
index
=
pTableMetaInfo
->
vgroupIndex
;
int32_t
index
=
pTableMetaInfo
->
vgroupIndex
;
int32_t
numOfVgroups
=
taosArrayGetSize
(
pTableMetaInfo
->
pVgroupTables
);
int32_t
numOfVgroups
=
taosArrayGetSize
(
pTableMetaInfo
->
pVgroupTables
);
assert
(
index
>=
0
&&
index
<
numOfVgroups
);
assert
(
index
>=
0
&&
index
<
numOfVgroups
);
...
@@ -590,7 +590,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
...
@@ -590,7 +590,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
SVgroupTableInfo
*
pTableIdList
=
taosArrayGet
(
pTableMetaInfo
->
pVgroupTables
,
index
);
SVgroupTableInfo
*
pTableIdList
=
taosArrayGet
(
pTableMetaInfo
->
pVgroupTables
,
index
);
// set the vgroup info
// set the vgroup info
tscSetDnode
IpLis
t
(
pSql
,
&
pTableIdList
->
vgInfo
);
tscSetDnode
EpSe
t
(
pSql
,
&
pTableIdList
->
vgInfo
);
pQueryMsg
->
head
.
vgId
=
htonl
(
pTableIdList
->
vgInfo
.
vgId
);
pQueryMsg
->
head
.
vgId
=
htonl
(
pTableIdList
->
vgInfo
.
vgId
);
int32_t
numOfTables
=
taosArrayGetSize
(
pTableIdList
->
itemList
);
int32_t
numOfTables
=
taosArrayGetSize
(
pTableIdList
->
itemList
);
...
@@ -1323,7 +1323,7 @@ int tscBuildUpdateTagMsg(SSqlObj* pSql, SSqlInfo *pInfo) {
...
@@ -1323,7 +1323,7 @@ int tscBuildUpdateTagMsg(SSqlObj* pSql, SSqlInfo *pInfo) {
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
tscSetDnode
IpLis
t
(
pSql
,
&
pTableMetaInfo
->
pTableMeta
->
vgroupInfo
);
tscSetDnode
EpSe
t
(
pSql
,
&
pTableMetaInfo
->
pTableMeta
->
vgroupInfo
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -1658,8 +1658,8 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
...
@@ -1658,8 +1658,8 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
pMetaMsg
->
contLen
=
htons
(
pMetaMsg
->
contLen
);
pMetaMsg
->
contLen
=
htons
(
pMetaMsg
->
contLen
);
pMetaMsg
->
numOfColumns
=
htons
(
pMetaMsg
->
numOfColumns
);
pMetaMsg
->
numOfColumns
=
htons
(
pMetaMsg
->
numOfColumns
);
if
(
pMetaMsg
->
sid
<
0
||
pMetaMsg
->
vgroup
.
numOf
I
ps
<
0
)
{
if
(
pMetaMsg
->
sid
<
0
||
pMetaMsg
->
vgroup
.
numOf
E
ps
<
0
)
{
tscError
(
"invalid meter vgId:%d, sid%d"
,
pMetaMsg
->
vgroup
.
numOf
I
ps
,
pMetaMsg
->
sid
);
tscError
(
"invalid meter vgId:%d, sid%d"
,
pMetaMsg
->
vgroup
.
numOf
E
ps
,
pMetaMsg
->
sid
);
return
TSDB_CODE_TSC_INVALID_VALUE
;
return
TSDB_CODE_TSC_INVALID_VALUE
;
}
}
...
@@ -1673,8 +1673,8 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
...
@@ -1673,8 +1673,8 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
return
TSDB_CODE_TSC_INVALID_VALUE
;
return
TSDB_CODE_TSC_INVALID_VALUE
;
}
}
for
(
int
i
=
0
;
i
<
pMetaMsg
->
vgroup
.
numOf
I
ps
;
++
i
)
{
for
(
int
i
=
0
;
i
<
pMetaMsg
->
vgroup
.
numOf
E
ps
;
++
i
)
{
pMetaMsg
->
vgroup
.
ipAddr
[
i
].
port
=
htons
(
pMetaMsg
->
vgroup
.
i
pAddr
[
i
].
port
);
pMetaMsg
->
vgroup
.
epAddr
[
i
].
port
=
htons
(
pMetaMsg
->
vgroup
.
e
pAddr
[
i
].
port
);
}
}
SSchema
*
pSchema
=
pMetaMsg
->
schema
;
SSchema
*
pSchema
=
pMetaMsg
->
schema
;
...
@@ -1850,10 +1850,10 @@ int tscProcessSTableVgroupRsp(SSqlObj *pSql) {
...
@@ -1850,10 +1850,10 @@ int tscProcessSTableVgroupRsp(SSqlObj *pSql) {
SCMVgroupInfo
*
pVgroups
=
&
pInfo
->
vgroupList
->
vgroups
[
j
];
SCMVgroupInfo
*
pVgroups
=
&
pInfo
->
vgroupList
->
vgroups
[
j
];
pVgroups
->
vgId
=
htonl
(
pVgroups
->
vgId
);
pVgroups
->
vgId
=
htonl
(
pVgroups
->
vgId
);
assert
(
pVgroups
->
numOf
I
ps
>=
1
);
assert
(
pVgroups
->
numOf
E
ps
>=
1
);
for
(
int32_t
k
=
0
;
k
<
pVgroups
->
numOf
I
ps
;
++
k
)
{
for
(
int32_t
k
=
0
;
k
<
pVgroups
->
numOf
E
ps
;
++
k
)
{
pVgroups
->
ipAddr
[
k
].
port
=
htons
(
pVgroups
->
i
pAddr
[
k
].
port
);
pVgroups
->
epAddr
[
k
].
port
=
htons
(
pVgroups
->
e
pAddr
[
k
].
port
);
}
}
pMsg
+=
size
;
pMsg
+=
size
;
...
@@ -1946,8 +1946,8 @@ int tscProcessConnectRsp(SSqlObj *pSql) {
...
@@ -1946,8 +1946,8 @@ int tscProcessConnectRsp(SSqlObj *pSql) {
assert
(
len
<=
sizeof
(
pObj
->
db
));
assert
(
len
<=
sizeof
(
pObj
->
db
));
tstrncpy
(
pObj
->
db
,
temp
,
sizeof
(
pObj
->
db
));
tstrncpy
(
pObj
->
db
,
temp
,
sizeof
(
pObj
->
db
));
if
(
pConnect
->
ipList
.
numOfI
ps
>
0
)
if
(
pConnect
->
epSet
.
numOfE
ps
>
0
)
tscSetMgmt
IpList
(
&
pConnect
->
ipLis
t
);
tscSetMgmt
EpSet
(
&
pConnect
->
epSe
t
);
strcpy
(
pObj
->
sversion
,
pConnect
->
serverVersion
);
strcpy
(
pObj
->
sversion
,
pConnect
->
serverVersion
);
pObj
->
writeAuth
=
pConnect
->
writeAuth
;
pObj
->
writeAuth
=
pConnect
->
writeAuth
;
...
...
src/client/src/tscSql.c
浏览文件 @
1e21eaff
...
@@ -62,8 +62,8 @@ SSqlObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con
...
@@ -62,8 +62,8 @@ SSqlObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con
}
}
if
(
ip
)
{
if
(
ip
)
{
if
(
tscSetMgmt
IpLis
tFromCfg
(
ip
,
NULL
)
<
0
)
return
NULL
;
if
(
tscSetMgmt
EpSe
tFromCfg
(
ip
,
NULL
)
<
0
)
return
NULL
;
if
(
port
)
tscMgmt
I
pSet
.
port
[
0
]
=
port
;
if
(
port
)
tscMgmt
E
pSet
.
port
[
0
]
=
port
;
}
}
void
*
pDnodeConn
=
NULL
;
void
*
pDnodeConn
=
NULL
;
...
...
src/client/src/tscSubquery.c
浏览文件 @
1e21eaff
...
@@ -458,7 +458,7 @@ void tscBuildVgroupTableInfo(SSqlObj* pSql, STableMetaInfo* pTableMetaInfo, SArr
...
@@ -458,7 +458,7 @@ void tscBuildVgroupTableInfo(SSqlObj* pSql, STableMetaInfo* pTableMetaInfo, SArr
break
;
break
;
}
}
}
}
assert
(
info
.
vgInfo
.
numOf
I
ps
!=
0
);
assert
(
info
.
vgInfo
.
numOf
E
ps
!=
0
);
vgTables
=
taosArrayInit
(
4
,
sizeof
(
STableIdInfo
));
vgTables
=
taosArrayInit
(
4
,
sizeof
(
STableIdInfo
));
info
.
itemList
=
vgTables
;
info
.
itemList
=
vgTables
;
...
@@ -1600,8 +1600,8 @@ static void tscAllDataRetrievedFromDnode(SRetrieveSupport *trsupport, SSqlObj* p
...
@@ -1600,8 +1600,8 @@ static void tscAllDataRetrievedFromDnode(SRetrieveSupport *trsupport, SSqlObj* p
// data in from current vnode is stored in cache and disk
// data in from current vnode is stored in cache and disk
uint32_t
numOfRowsFromSubquery
=
trsupport
->
pExtMemBuffer
[
idx
]
->
numOfTotalElems
+
trsupport
->
localBuffer
->
num
;
uint32_t
numOfRowsFromSubquery
=
trsupport
->
pExtMemBuffer
[
idx
]
->
numOfTotalElems
+
trsupport
->
localBuffer
->
num
;
tscDebug
(
"%p sub:%p all data retrieved from
i
p:%s, vgId:%d, numOfRows:%d, orderOfSub:%d"
,
pParentSql
,
pSql
,
tscDebug
(
"%p sub:%p all data retrieved from
e
p:%s, vgId:%d, numOfRows:%d, orderOfSub:%d"
,
pParentSql
,
pSql
,
pTableMetaInfo
->
vgroupList
->
vgroups
[
0
].
i
pAddr
[
0
].
fqdn
,
pTableMetaInfo
->
vgroupList
->
vgroups
[
0
].
vgId
,
pTableMetaInfo
->
vgroupList
->
vgroups
[
0
].
e
pAddr
[
0
].
fqdn
,
pTableMetaInfo
->
vgroupList
->
vgroups
[
0
].
vgId
,
numOfRowsFromSubquery
,
idx
);
numOfRowsFromSubquery
,
idx
);
tColModelCompact
(
pDesc
->
pColumnModel
,
trsupport
->
localBuffer
,
pDesc
->
pColumnModel
->
capacity
);
tColModelCompact
(
pDesc
->
pColumnModel
,
trsupport
->
localBuffer
,
pDesc
->
pColumnModel
->
capacity
);
...
@@ -1719,8 +1719,8 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR
...
@@ -1719,8 +1719,8 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR
assert
(
pRes
->
numOfRows
==
numOfRows
);
assert
(
pRes
->
numOfRows
==
numOfRows
);
int64_t
num
=
atomic_add_fetch_64
(
&
pState
->
numOfRetrievedRows
,
numOfRows
);
int64_t
num
=
atomic_add_fetch_64
(
&
pState
->
numOfRetrievedRows
,
numOfRows
);
tscDebug
(
"%p sub:%p retrieve numOfRows:%"
PRId64
" totalNumOfRows:%"
PRIu64
" from
i
p:%s, orderOfSub:%d"
,
pParentSql
,
pSql
,
tscDebug
(
"%p sub:%p retrieve numOfRows:%"
PRId64
" totalNumOfRows:%"
PRIu64
" from
e
p:%s, orderOfSub:%d"
,
pParentSql
,
pSql
,
pRes
->
numOfRows
,
pState
->
numOfRetrievedRows
,
pSql
->
ipList
.
fqdn
[
pSql
->
ipLis
t
.
inUse
],
idx
);
pRes
->
numOfRows
,
pState
->
numOfRetrievedRows
,
pSql
->
epSet
.
fqdn
[
pSql
->
epSe
t
.
inUse
],
idx
);
if
(
num
>
tsMaxNumOfOrderedResults
&&
tscIsProjectionQueryOnSTable
(
pQueryInfo
,
0
))
{
if
(
num
>
tsMaxNumOfOrderedResults
&&
tscIsProjectionQueryOnSTable
(
pQueryInfo
,
0
))
{
tscError
(
"%p sub:%p num of OrderedRes is too many, max allowed:%"
PRId32
" , current:%"
PRId64
,
tscError
(
"%p sub:%p num of OrderedRes is too many, max allowed:%"
PRId32
" , current:%"
PRId64
,
...
@@ -1828,8 +1828,8 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) {
...
@@ -1828,8 +1828,8 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) {
return
;
return
;
}
}
tscTrace
(
"%p sub:%p query complete,
i
p:%s, vgId:%d, orderOfSub:%d, retrieve data"
,
trsupport
->
pParentSql
,
pSql
,
tscTrace
(
"%p sub:%p query complete,
e
p:%s, vgId:%d, orderOfSub:%d, retrieve data"
,
trsupport
->
pParentSql
,
pSql
,
pVgroup
->
i
pAddr
[
0
].
fqdn
,
pVgroup
->
vgId
,
trsupport
->
subqueryIndex
);
pVgroup
->
e
pAddr
[
0
].
fqdn
,
pVgroup
->
vgId
,
trsupport
->
subqueryIndex
);
if
(
pSql
->
res
.
qhandle
==
0
)
{
// qhandle is NULL, code is TSDB_CODE_SUCCESS means no results generated from this vnode
if
(
pSql
->
res
.
qhandle
==
0
)
{
// qhandle is NULL, code is TSDB_CODE_SUCCESS means no results generated from this vnode
tscRetrieveFromDnodeCallBack
(
param
,
pSql
,
0
);
tscRetrieveFromDnodeCallBack
(
param
,
pSql
,
0
);
...
...
src/client/src/tscSystem.c
浏览文件 @
1e21eaff
...
@@ -41,7 +41,7 @@ int tscNumOfThreads;
...
@@ -41,7 +41,7 @@ int tscNumOfThreads;
static
pthread_once_t
tscinit
=
PTHREAD_ONCE_INIT
;
static
pthread_once_t
tscinit
=
PTHREAD_ONCE_INIT
;
void
taosInitNote
(
int
numOfNoteLines
,
int
maxNotes
,
char
*
lable
);
void
taosInitNote
(
int
numOfNoteLines
,
int
maxNotes
,
char
*
lable
);
void
tscUpdate
IpSet
(
void
*
ahandle
,
SRpcIpSet
*
pI
pSet
);
void
tscUpdate
EpSet
(
void
*
ahandle
,
SRpcEpSet
*
pE
pSet
);
void
tscCheckDiskUsage
(
void
*
UNUSED_PARAM
(
para
),
void
*
UNUSED_PARAM
(
param
))
{
void
tscCheckDiskUsage
(
void
*
UNUSED_PARAM
(
para
),
void
*
UNUSED_PARAM
(
param
))
{
taosGetDisk
();
taosGetDisk
();
...
@@ -116,8 +116,8 @@ void taos_init_imp() {
...
@@ -116,8 +116,8 @@ void taos_init_imp() {
taosInitNote
(
tsNumOfLogLines
/
10
,
1
,
(
char
*
)
"tsc_note"
);
taosInitNote
(
tsNumOfLogLines
/
10
,
1
,
(
char
*
)
"tsc_note"
);
}
}
if
(
tscSetMgmt
IpLis
tFromCfg
(
tsFirst
,
tsSecond
)
<
0
)
{
if
(
tscSetMgmt
EpSe
tFromCfg
(
tsFirst
,
tsSecond
)
<
0
)
{
tscError
(
"failed to init mnode
I
P list"
);
tscError
(
"failed to init mnode
E
P list"
);
return
;
return
;
}
}
...
...
src/client/src/tscUtil.c
浏览文件 @
1e21eaff
...
@@ -2145,17 +2145,17 @@ char* strdup_throw(const char* str) {
...
@@ -2145,17 +2145,17 @@ char* strdup_throw(const char* str) {
return
p
;
return
p
;
}
}
int
tscSetMgmt
IpLis
tFromCfg
(
const
char
*
first
,
const
char
*
second
)
{
int
tscSetMgmt
EpSe
tFromCfg
(
const
char
*
first
,
const
char
*
second
)
{
tscMgmt
IpSet
.
numOfI
ps
=
0
;
tscMgmt
EpSet
.
numOfE
ps
=
0
;
tscMgmt
I
pSet
.
inUse
=
0
;
tscMgmt
E
pSet
.
inUse
=
0
;
if
(
first
&&
first
[
0
]
!=
0
)
{
if
(
first
&&
first
[
0
]
!=
0
)
{
if
(
strlen
(
first
)
>=
TSDB_EP_LEN
)
{
if
(
strlen
(
first
)
>=
TSDB_EP_LEN
)
{
terrno
=
TSDB_CODE_TSC_INVALID_FQDN
;
terrno
=
TSDB_CODE_TSC_INVALID_FQDN
;
return
-
1
;
return
-
1
;
}
}
taosGetFqdnPortFromEp
(
first
,
tscMgmt
IpSet
.
fqdn
[
tscMgmtIpSet
.
numOfIps
],
&
tscMgmtIpSet
.
port
[
tscMgmtIpSet
.
numOfI
ps
]);
taosGetFqdnPortFromEp
(
first
,
tscMgmt
EpSet
.
fqdn
[
tscMgmtEpSet
.
numOfEps
],
&
tscMgmtEpSet
.
port
[
tscMgmtEpSet
.
numOfE
ps
]);
tscMgmt
IpSet
.
numOfI
ps
++
;
tscMgmt
EpSet
.
numOfE
ps
++
;
}
}
if
(
second
&&
second
[
0
]
!=
0
)
{
if
(
second
&&
second
[
0
]
!=
0
)
{
...
@@ -2163,11 +2163,11 @@ int tscSetMgmtIpListFromCfg(const char *first, const char *second) {
...
@@ -2163,11 +2163,11 @@ int tscSetMgmtIpListFromCfg(const char *first, const char *second) {
terrno
=
TSDB_CODE_TSC_INVALID_FQDN
;
terrno
=
TSDB_CODE_TSC_INVALID_FQDN
;
return
-
1
;
return
-
1
;
}
}
taosGetFqdnPortFromEp
(
second
,
tscMgmt
IpSet
.
fqdn
[
tscMgmtIpSet
.
numOfIps
],
&
tscMgmtIpSet
.
port
[
tscMgmtIpSet
.
numOfI
ps
]);
taosGetFqdnPortFromEp
(
second
,
tscMgmt
EpSet
.
fqdn
[
tscMgmtEpSet
.
numOfEps
],
&
tscMgmtEpSet
.
port
[
tscMgmtEpSet
.
numOfE
ps
]);
tscMgmt
IpSet
.
numOfI
ps
++
;
tscMgmt
EpSet
.
numOfE
ps
++
;
}
}
if
(
tscMgmt
IpSet
.
numOfI
ps
==
0
)
{
if
(
tscMgmt
EpSet
.
numOfE
ps
==
0
)
{
terrno
=
TSDB_CODE_TSC_INVALID_FQDN
;
terrno
=
TSDB_CODE_TSC_INVALID_FQDN
;
return
-
1
;
return
-
1
;
}
}
...
...
src/common/inc/tglobal.h
浏览文件 @
1e21eaff
...
@@ -30,8 +30,6 @@ extern uint16_t tsDnodeShellPort;
...
@@ -30,8 +30,6 @@ extern uint16_t tsDnodeShellPort;
extern
uint16_t
tsDnodeDnodePort
;
extern
uint16_t
tsDnodeDnodePort
;
extern
uint16_t
tsSyncPort
;
extern
uint16_t
tsSyncPort
;
extern
int32_t
tsStatusInterval
;
extern
int32_t
tsStatusInterval
;
extern
int16_t
tsNumOfVnodesPerCore
;
extern
int16_t
tsNumOfTotalVnodes
;
extern
int32_t
tsNumOfMnodes
;
extern
int32_t
tsNumOfMnodes
;
extern
int32_t
tsEnableVnodeBak
;
extern
int32_t
tsEnableVnodeBak
;
...
...
src/common/src/tglobal.c
浏览文件 @
1e21eaff
...
@@ -38,12 +38,9 @@ uint16_t tsDnodeShellPort = 6030; // udp[6035-6039] tcp[6035]
...
@@ -38,12 +38,9 @@ uint16_t tsDnodeShellPort = 6030; // udp[6035-6039] tcp[6035]
uint16_t
tsDnodeDnodePort
=
6035
;
// udp/tcp
uint16_t
tsDnodeDnodePort
=
6035
;
// udp/tcp
uint16_t
tsSyncPort
=
6040
;
uint16_t
tsSyncPort
=
6040
;
int32_t
tsStatusInterval
=
1
;
// second
int32_t
tsStatusInterval
=
1
;
// second
int16_t
tsNumOfVnodesPerCore
=
32
;
int16_t
tsNumOfTotalVnodes
=
TSDB_INVALID_VNODE_NUM
;
int32_t
tsNumOfMnodes
=
3
;
int32_t
tsNumOfMnodes
=
3
;
int32_t
tsEnableVnodeBak
=
1
;
int32_t
tsEnableVnodeBak
=
1
;
// common
// common
int32_t
tsRpcTimer
=
1000
;
int32_t
tsRpcTimer
=
1000
;
int32_t
tsRpcMaxTime
=
600
;
// seconds;
int32_t
tsRpcMaxTime
=
600
;
// seconds;
...
@@ -199,6 +196,9 @@ int32_t sDebugFlag = 135;
...
@@ -199,6 +196,9 @@ int32_t sDebugFlag = 135;
int32_t
wDebugFlag
=
135
;
int32_t
wDebugFlag
=
135
;
int32_t
tsdbDebugFlag
=
131
;
int32_t
tsdbDebugFlag
=
131
;
int32_t
(
*
monitorStartSystemFp
)()
=
NULL
;
void
(
*
monitorStopSystemFp
)()
=
NULL
;
static
pthread_once_t
tsInitGlobalCfgOnce
=
PTHREAD_ONCE_INIT
;
static
pthread_once_t
tsInitGlobalCfgOnce
=
PTHREAD_ONCE_INIT
;
void
taosSetAllDebugFlag
()
{
void
taosSetAllDebugFlag
()
{
...
@@ -248,11 +248,17 @@ bool taosCfgDynamicOptions(char *msg) {
...
@@ -248,11 +248,17 @@ bool taosCfgDynamicOptions(char *msg) {
*
((
int32_t
*
)
cfg
->
ptr
)
=
vint
;
*
((
int32_t
*
)
cfg
->
ptr
)
=
vint
;
if
(
strncasecmp
(
cfg
->
option
,
"monitor"
,
olen
)
==
0
)
{
if
(
strncasecmp
(
cfg
->
option
,
"monitor"
,
olen
)
==
0
)
{
// if (0 == vint) {
if
(
1
==
vint
)
{
// monitorStartSystem();
if
(
monitorStartSystemFp
)
{
// } else {
(
*
monitorStartSystemFp
)();
// monitorStopSystem();
uInfo
(
"monitor is enabled"
);
// }
}
}
else
{
if
(
monitorStopSystemFp
)
{
(
*
monitorStopSystemFp
)();
uInfo
(
"monitor is disabled"
);
}
}
return
true
;
return
true
;
}
}
...
@@ -393,16 +399,6 @@ static void doInitGlobalConfig() {
...
@@ -393,16 +399,6 @@ static void doInitGlobalConfig() {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"numOfTotalVnodes"
;
cfg
.
ptr
=
&
tsNumOfTotalVnodes
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT16
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
TSDB_MAX_VNODES
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"numOfMnodes"
;
cfg
.
option
=
"numOfMnodes"
;
cfg
.
ptr
=
&
tsNumOfMnodes
;
cfg
.
ptr
=
&
tsNumOfMnodes
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
...
@@ -444,7 +440,7 @@ static void doInitGlobalConfig() {
...
@@ -444,7 +440,7 @@ static void doInitGlobalConfig() {
taosInitConfigOption
(
cfg
);
taosInitConfigOption
(
cfg
);
// 0-any; 1-mnode; 2-vnode
// 0-any; 1-mnode; 2-vnode
cfg
.
option
=
"
alternativeR
ole"
;
cfg
.
option
=
"
r
ole"
;
cfg
.
ptr
=
&
tsAlternativeRole
;
cfg
.
ptr
=
&
tsAlternativeRole
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
;
...
@@ -1271,12 +1267,6 @@ bool taosCheckGlobalCfg() {
...
@@ -1271,12 +1267,6 @@ bool taosCheckGlobalCfg() {
tsNumOfCores
=
1
;
tsNumOfCores
=
1
;
}
}
if
(
tsNumOfTotalVnodes
==
TSDB_INVALID_VNODE_NUM
)
{
tsNumOfTotalVnodes
=
tsNumOfCores
*
tsNumOfVnodesPerCore
;
tsNumOfTotalVnodes
=
tsNumOfTotalVnodes
>
TSDB_MAX_VNODES
?
TSDB_MAX_VNODES
:
tsNumOfTotalVnodes
;
tsNumOfTotalVnodes
=
tsNumOfTotalVnodes
<
TSDB_MIN_VNODES
?
TSDB_MIN_VNODES
:
tsNumOfTotalVnodes
;
}
// todo refactor
// todo refactor
tsVersion
=
0
;
tsVersion
=
0
;
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
...
...
src/connector/grafana/tdengine/package-lock.json
浏览文件 @
1e21eaff
{
{
"name"
:
"TDengine"
,
"name"
:
"TDengine"
,
"version"
:
"
1
.0.0"
,
"version"
:
"
2
.0.0"
,
"lockfileVersion"
:
1
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"requires"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
...
@@ -2302,9 +2302,9 @@
...
@@ -2302,9 +2302,9 @@
}
}
},
},
"lodash"
:
{
"lodash"
:
{
"version"
:
"4.17.1
3
"
,
"version"
:
"4.17.1
9
"
,
"resolved"
:
"https://registry.npmjs.org/lodash/-/lodash-4.17.1
3
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/lodash/-/lodash-4.17.1
9
.tgz"
,
"integrity"
:
"sha512-
vm3/XWXfWtRua0FkUyEHBZy8kCPjErNBT9fJx8Zvs+U6zjqPbTUOpkaoum3O5uiA8sm+yNMHXfYkTUHFoMxFNA
=="
"integrity"
:
"sha512-
JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ
=="
},
},
"log-symbols"
:
{
"log-symbols"
:
{
"version"
:
"2.2.0"
,
"version"
:
"2.2.0"
,
...
...
src/connector/grafana/tdengine/package.json
浏览文件 @
1e21eaff
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
"q"
:
"^1.5.0"
"q"
:
"^1.5.0"
},
},
"dependencies"
:
{
"dependencies"
:
{
"lodash"
:
"^4.17.1
3
"
,
"lodash"
:
"^4.17.1
9
"
,
"yarn"
:
"^1.22.0"
"yarn"
:
"^1.22.0"
},
},
"homepage"
:
"https://github.com/taosdata/TDengine/tree/develop/src/connector/grafana/tdengine"
"homepage"
:
"https://github.com/taosdata/TDengine/tree/develop/src/connector/grafana/tdengine"
...
...
src/connector/grafana/tdengine/yarn.lock
浏览文件 @
1e21eaff
...
@@ -1888,14 +1888,10 @@ locate-path@^3.0.0:
...
@@ -1888,14 +1888,10 @@ locate-path@^3.0.0:
p-locate "^3.0.0"
p-locate "^3.0.0"
path-exists "^3.0.0"
path-exists "^3.0.0"
lodash@^4.17.10, lodash@^4.17.13, lodash@^4.17.4, lodash@^4.2.0, lodash@~4.17.10, lodash@~4.17.5:
lodash@^4.17.10, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4, lodash@^4.2.0, lodash@~4.17.10, lodash@~4.17.5:
version "4.17.13"
version "4.17.19"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.13.tgz#0bdc3a6adc873d2f4e0c4bac285df91b64fc7b93"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
lodash@^4.17.15:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
log-symbols@2.2.0:
log-symbols@2.2.0:
version "2.2.0"
version "2.2.0"
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/utils/TDNode.java
浏览文件 @
1e21eaff
...
@@ -208,7 +208,6 @@ public class TDNode {
...
@@ -208,7 +208,6 @@ public class TDNode {
setCfgConfig
(
"mnodeEqualVnodeNum"
,
"0"
);
setCfgConfig
(
"mnodeEqualVnodeNum"
,
"0"
);
setCfgConfig
(
"walLevel"
,
"1"
);
setCfgConfig
(
"walLevel"
,
"1"
);
setCfgConfig
(
"statusInterval"
,
"1"
);
setCfgConfig
(
"statusInterval"
,
"1"
);
setCfgConfig
(
"numOfTotalVnodes"
,
"64"
);
setCfgConfig
(
"numOfMnodes"
,
"3"
);
setCfgConfig
(
"numOfMnodes"
,
"3"
);
setCfgConfig
(
"numOfThreadsPerCore"
,
"2.0"
);
setCfgConfig
(
"numOfThreadsPerCore"
,
"2.0"
);
setCfgConfig
(
"monitor"
,
"0"
);
setCfgConfig
(
"monitor"
,
"0"
);
...
...
src/cq/src/cqMain.c
浏览文件 @
1e21eaff
...
@@ -103,9 +103,6 @@ void cqClose(void *handle) {
...
@@ -103,9 +103,6 @@ void cqClose(void *handle) {
SCqContext
*
pContext
=
handle
;
SCqContext
*
pContext
=
handle
;
if
(
handle
==
NULL
)
return
;
if
(
handle
==
NULL
)
return
;
taosTmrCleanUp
(
pContext
->
tmrCtrl
);
pContext
->
tmrCtrl
=
NULL
;
// stop all CQs
// stop all CQs
cqStop
(
pContext
);
cqStop
(
pContext
);
...
@@ -125,6 +122,9 @@ void cqClose(void *handle) {
...
@@ -125,6 +122,9 @@ void cqClose(void *handle) {
pthread_mutex_destroy
(
&
pContext
->
mutex
);
pthread_mutex_destroy
(
&
pContext
->
mutex
);
taosTmrCleanUp
(
pContext
->
tmrCtrl
);
pContext
->
tmrCtrl
=
NULL
;
cTrace
(
"vgId:%d, CQ is closed"
,
pContext
->
vgId
);
cTrace
(
"vgId:%d, CQ is closed"
,
pContext
->
vgId
);
free
(
pContext
);
free
(
pContext
);
}
}
...
...
src/dnode/inc/dnodeMgmt.h
浏览文件 @
1e21eaff
...
@@ -35,8 +35,8 @@ void* dnodeGetVnodeTsdb(void *pVnode);
...
@@ -35,8 +35,8 @@ void* dnodeGetVnodeTsdb(void *pVnode);
void
dnodeReleaseVnode
(
void
*
pVnode
);
void
dnodeReleaseVnode
(
void
*
pVnode
);
void
dnodeSendRedirectMsg
(
SRpcMsg
*
rpcMsg
,
bool
forShell
);
void
dnodeSendRedirectMsg
(
SRpcMsg
*
rpcMsg
,
bool
forShell
);
void
dnodeGetMnode
IpSetForPeer
(
void
*
i
pSet
);
void
dnodeGetMnode
EpSetForPeer
(
void
*
e
pSet
);
void
dnodeGetMnode
IpSetForShell
(
void
*
i
pSet
);
void
dnodeGetMnode
EpSetForShell
(
void
*
e
pSet
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
1e21eaff
...
@@ -52,7 +52,7 @@ void * tsDnodeTmr = NULL;
...
@@ -52,7 +52,7 @@ void * tsDnodeTmr = NULL;
static
void
*
tsStatusTimer
=
NULL
;
static
void
*
tsStatusTimer
=
NULL
;
static
uint32_t
tsRebootTime
;
static
uint32_t
tsRebootTime
;
static
SRpc
IpSet
tsDMnodeI
pSet
=
{
0
};
static
SRpc
EpSet
tsDMnodeE
pSet
=
{
0
};
static
SDMMnodeInfos
tsDMnodeInfos
=
{
0
};
static
SDMMnodeInfos
tsDMnodeInfos
=
{
0
};
static
SDMDnodeCfg
tsDnodeCfg
=
{
0
};
static
SDMDnodeCfg
tsDnodeCfg
=
{
0
};
static
taos_qset
tsMgmtQset
=
NULL
;
static
taos_qset
tsMgmtQset
=
NULL
;
...
@@ -90,21 +90,21 @@ int32_t dnodeInitMgmt() {
...
@@ -90,21 +90,21 @@ int32_t dnodeInitMgmt() {
tsRebootTime
=
taosGetTimestampSec
();
tsRebootTime
=
taosGetTimestampSec
();
if
(
!
dnodeReadMnodeInfos
())
{
if
(
!
dnodeReadMnodeInfos
())
{
memset
(
&
tsDMnode
IpSet
,
0
,
sizeof
(
SRpcI
pSet
));
memset
(
&
tsDMnode
EpSet
,
0
,
sizeof
(
SRpcE
pSet
));
memset
(
&
tsDMnodeInfos
,
0
,
sizeof
(
SDMMnodeInfos
));
memset
(
&
tsDMnodeInfos
,
0
,
sizeof
(
SDMMnodeInfos
));
tsDMnode
IpSet
.
numOfI
ps
=
1
;
tsDMnode
EpSet
.
numOfE
ps
=
1
;
taosGetFqdnPortFromEp
(
tsFirst
,
tsDMnode
IpSet
.
fqdn
[
0
],
&
tsDMnodeI
pSet
.
port
[
0
]);
taosGetFqdnPortFromEp
(
tsFirst
,
tsDMnode
EpSet
.
fqdn
[
0
],
&
tsDMnodeE
pSet
.
port
[
0
]);
if
(
strcmp
(
tsSecond
,
tsFirst
)
!=
0
)
{
if
(
strcmp
(
tsSecond
,
tsFirst
)
!=
0
)
{
tsDMnode
IpSet
.
numOfI
ps
=
2
;
tsDMnode
EpSet
.
numOfE
ps
=
2
;
taosGetFqdnPortFromEp
(
tsSecond
,
tsDMnode
IpSet
.
fqdn
[
1
],
&
tsDMnodeI
pSet
.
port
[
1
]);
taosGetFqdnPortFromEp
(
tsSecond
,
tsDMnode
EpSet
.
fqdn
[
1
],
&
tsDMnodeE
pSet
.
port
[
1
]);
}
}
}
else
{
}
else
{
tsDMnode
I
pSet
.
inUse
=
tsDMnodeInfos
.
inUse
;
tsDMnode
E
pSet
.
inUse
=
tsDMnodeInfos
.
inUse
;
tsDMnode
IpSet
.
numOfI
ps
=
tsDMnodeInfos
.
nodeNum
;
tsDMnode
EpSet
.
numOfE
ps
=
tsDMnodeInfos
.
nodeNum
;
for
(
int32_t
i
=
0
;
i
<
tsDMnodeInfos
.
nodeNum
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
tsDMnodeInfos
.
nodeNum
;
i
++
)
{
taosGetFqdnPortFromEp
(
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
,
tsDMnode
IpSet
.
fqdn
[
i
],
&
tsDMnodeI
pSet
.
port
[
i
]);
taosGetFqdnPortFromEp
(
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
,
tsDMnode
EpSet
.
fqdn
[
i
],
&
tsDMnodeE
pSet
.
port
[
i
]);
}
}
}
}
...
@@ -450,27 +450,27 @@ static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg) {
...
@@ -450,27 +450,27 @@ static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg) {
return
taosCfgDynamicOptions
(
pCfg
->
config
);
return
taosCfgDynamicOptions
(
pCfg
->
config
);
}
}
void
dnodeUpdateMnode
IpSetForPeer
(
SRpcIpSet
*
pI
pSet
)
{
void
dnodeUpdateMnode
EpSetForPeer
(
SRpcEpSet
*
pE
pSet
)
{
dInfo
(
"mnode
IP list for is changed, numOfIps:%d inUse:%d"
,
pIpSet
->
numOfIps
,
pI
pSet
->
inUse
);
dInfo
(
"mnode
EP list for is changed, numOfEps:%d inUse:%d"
,
pEpSet
->
numOfEps
,
pE
pSet
->
inUse
);
for
(
int
i
=
0
;
i
<
p
IpSet
->
numOfI
ps
;
++
i
)
{
for
(
int
i
=
0
;
i
<
p
EpSet
->
numOfE
ps
;
++
i
)
{
p
I
pSet
->
port
[
i
]
-=
TSDB_PORT_DNODEDNODE
;
p
E
pSet
->
port
[
i
]
-=
TSDB_PORT_DNODEDNODE
;
dInfo
(
"mnode index:%d %s:%u"
,
i
,
p
IpSet
->
fqdn
[
i
],
pI
pSet
->
port
[
i
])
dInfo
(
"mnode index:%d %s:%u"
,
i
,
p
EpSet
->
fqdn
[
i
],
pE
pSet
->
port
[
i
])
}
}
tsDMnode
IpSet
=
*
pI
pSet
;
tsDMnode
EpSet
=
*
pE
pSet
;
}
}
void
dnodeGetMnode
IpSetForPeer
(
void
*
i
pSetRaw
)
{
void
dnodeGetMnode
EpSetForPeer
(
void
*
e
pSetRaw
)
{
SRpc
IpSet
*
ipSet
=
i
pSetRaw
;
SRpc
EpSet
*
epSet
=
e
pSetRaw
;
*
ipSet
=
tsDMnodeI
pSet
;
*
epSet
=
tsDMnodeE
pSet
;
for
(
int
i
=
0
;
i
<
ipSet
->
numOfI
ps
;
++
i
)
for
(
int
i
=
0
;
i
<
epSet
->
numOfE
ps
;
++
i
)
i
pSet
->
port
[
i
]
+=
TSDB_PORT_DNODEDNODE
;
e
pSet
->
port
[
i
]
+=
TSDB_PORT_DNODEDNODE
;
}
}
void
dnodeGetMnode
IpSetForShell
(
void
*
i
pSetRaw
)
{
void
dnodeGetMnode
EpSetForShell
(
void
*
e
pSetRaw
)
{
SRpc
IpSet
*
ipSet
=
i
pSetRaw
;
SRpc
EpSet
*
epSet
=
e
pSetRaw
;
*
ipSet
=
tsDMnodeI
pSet
;
*
epSet
=
tsDMnodeE
pSet
;
}
}
static
void
dnodeProcessStatusRsp
(
SRpcMsg
*
pMsg
)
{
static
void
dnodeProcessStatusRsp
(
SRpcMsg
*
pMsg
)
{
...
@@ -536,10 +536,10 @@ static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) {
...
@@ -536,10 +536,10 @@ static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) {
dInfo
(
"mnode index:%d, %s"
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeId
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
);
dInfo
(
"mnode index:%d, %s"
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeId
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
);
}
}
tsDMnode
I
pSet
.
inUse
=
tsDMnodeInfos
.
inUse
;
tsDMnode
E
pSet
.
inUse
=
tsDMnodeInfos
.
inUse
;
tsDMnode
IpSet
.
numOfI
ps
=
tsDMnodeInfos
.
nodeNum
;
tsDMnode
EpSet
.
numOfE
ps
=
tsDMnodeInfos
.
nodeNum
;
for
(
int32_t
i
=
0
;
i
<
tsDMnodeInfos
.
nodeNum
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
tsDMnodeInfos
.
nodeNum
;
i
++
)
{
taosGetFqdnPortFromEp
(
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
,
tsDMnode
IpSet
.
fqdn
[
i
],
&
tsDMnodeI
pSet
.
port
[
i
]);
taosGetFqdnPortFromEp
(
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
,
tsDMnode
EpSet
.
fqdn
[
i
],
&
tsDMnodeE
pSet
.
port
[
i
]);
}
}
dnodeSaveMnodeInfos
();
dnodeSaveMnodeInfos
();
...
@@ -549,10 +549,10 @@ static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) {
...
@@ -549,10 +549,10 @@ static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) {
static
bool
dnodeReadMnodeInfos
()
{
static
bool
dnodeReadMnodeInfos
()
{
char
ipFile
[
TSDB_FILENAME_LEN
*
2
]
=
{
0
};
char
ipFile
[
TSDB_FILENAME_LEN
*
2
]
=
{
0
};
sprintf
(
ipFile
,
"%s/mnode
IpLis
t.json"
,
tsDnodeDir
);
sprintf
(
ipFile
,
"%s/mnode
EpSe
t.json"
,
tsDnodeDir
);
FILE
*
fp
=
fopen
(
ipFile
,
"r"
);
FILE
*
fp
=
fopen
(
ipFile
,
"r"
);
if
(
!
fp
)
{
if
(
!
fp
)
{
dDebug
(
"failed to read mnode
IpLis
t.json, file not exist"
);
dDebug
(
"failed to read mnode
EpSe
t.json, file not exist"
);
return
false
;
return
false
;
}
}
...
@@ -563,40 +563,40 @@ static bool dnodeReadMnodeInfos() {
...
@@ -563,40 +563,40 @@ static bool dnodeReadMnodeInfos() {
if
(
len
<=
0
)
{
if
(
len
<=
0
)
{
free
(
content
);
free
(
content
);
fclose
(
fp
);
fclose
(
fp
);
dError
(
"failed to read mnode
IpLis
t.json, content is null"
);
dError
(
"failed to read mnode
EpSe
t.json, content is null"
);
return
false
;
return
false
;
}
}
content
[
len
]
=
0
;
content
[
len
]
=
0
;
cJSON
*
root
=
cJSON_Parse
(
content
);
cJSON
*
root
=
cJSON_Parse
(
content
);
if
(
root
==
NULL
)
{
if
(
root
==
NULL
)
{
dError
(
"failed to read mnode
IpLis
t.json, invalid json format"
);
dError
(
"failed to read mnode
EpSe
t.json, invalid json format"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
cJSON
*
inUse
=
cJSON_GetObjectItem
(
root
,
"inUse"
);
cJSON
*
inUse
=
cJSON_GetObjectItem
(
root
,
"inUse"
);
if
(
!
inUse
||
inUse
->
type
!=
cJSON_Number
)
{
if
(
!
inUse
||
inUse
->
type
!=
cJSON_Number
)
{
dError
(
"failed to read mnode
IpLis
t.json, inUse not found"
);
dError
(
"failed to read mnode
EpSe
t.json, inUse not found"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
tsDMnodeInfos
.
inUse
=
inUse
->
valueint
;
tsDMnodeInfos
.
inUse
=
inUse
->
valueint
;
cJSON
*
nodeNum
=
cJSON_GetObjectItem
(
root
,
"nodeNum"
);
cJSON
*
nodeNum
=
cJSON_GetObjectItem
(
root
,
"nodeNum"
);
if
(
!
nodeNum
||
nodeNum
->
type
!=
cJSON_Number
)
{
if
(
!
nodeNum
||
nodeNum
->
type
!=
cJSON_Number
)
{
dError
(
"failed to read mnode
IpLis
t.json, nodeNum not found"
);
dError
(
"failed to read mnode
EpSe
t.json, nodeNum not found"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
tsDMnodeInfos
.
nodeNum
=
nodeNum
->
valueint
;
tsDMnodeInfos
.
nodeNum
=
nodeNum
->
valueint
;
cJSON
*
nodeInfos
=
cJSON_GetObjectItem
(
root
,
"nodeInfos"
);
cJSON
*
nodeInfos
=
cJSON_GetObjectItem
(
root
,
"nodeInfos"
);
if
(
!
nodeInfos
||
nodeInfos
->
type
!=
cJSON_Array
)
{
if
(
!
nodeInfos
||
nodeInfos
->
type
!=
cJSON_Array
)
{
dError
(
"failed to read mnode
IpLis
t.json, nodeInfos not found"
);
dError
(
"failed to read mnode
EpSe
t.json, nodeInfos not found"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
int
size
=
cJSON_GetArraySize
(
nodeInfos
);
int
size
=
cJSON_GetArraySize
(
nodeInfos
);
if
(
size
!=
tsDMnodeInfos
.
nodeNum
)
{
if
(
size
!=
tsDMnodeInfos
.
nodeNum
)
{
dError
(
"failed to read mnode
IpLis
t.json, nodeInfos size not matched"
);
dError
(
"failed to read mnode
EpSe
t.json, nodeInfos size not matched"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
...
@@ -606,14 +606,14 @@ static bool dnodeReadMnodeInfos() {
...
@@ -606,14 +606,14 @@ static bool dnodeReadMnodeInfos() {
cJSON
*
nodeId
=
cJSON_GetObjectItem
(
nodeInfo
,
"nodeId"
);
cJSON
*
nodeId
=
cJSON_GetObjectItem
(
nodeInfo
,
"nodeId"
);
if
(
!
nodeId
||
nodeId
->
type
!=
cJSON_Number
)
{
if
(
!
nodeId
||
nodeId
->
type
!=
cJSON_Number
)
{
dError
(
"failed to read mnode
IpLis
t.json, nodeId not found"
);
dError
(
"failed to read mnode
EpSe
t.json, nodeId not found"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeId
=
nodeId
->
valueint
;
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeId
=
nodeId
->
valueint
;
cJSON
*
nodeEp
=
cJSON_GetObjectItem
(
nodeInfo
,
"nodeEp"
);
cJSON
*
nodeEp
=
cJSON_GetObjectItem
(
nodeInfo
,
"nodeEp"
);
if
(
!
nodeEp
||
nodeEp
->
type
!=
cJSON_String
||
nodeEp
->
valuestring
==
NULL
)
{
if
(
!
nodeEp
||
nodeEp
->
type
!=
cJSON_String
||
nodeEp
->
valuestring
==
NULL
)
{
dError
(
"failed to read mnode
IpLis
t.json, nodeName not found"
);
dError
(
"failed to read mnode
EpSe
t.json, nodeName not found"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
strncpy
(
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
,
nodeEp
->
valuestring
,
TSDB_EP_LEN
);
strncpy
(
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
,
nodeEp
->
valuestring
,
TSDB_EP_LEN
);
...
@@ -621,7 +621,7 @@ static bool dnodeReadMnodeInfos() {
...
@@ -621,7 +621,7 @@ static bool dnodeReadMnodeInfos() {
ret
=
true
;
ret
=
true
;
dInfo
(
"read mnode
iplist successed, numOfI
ps:%d inUse:%d"
,
tsDMnodeInfos
.
nodeNum
,
tsDMnodeInfos
.
inUse
);
dInfo
(
"read mnode
epSet successed, numOfE
ps:%d inUse:%d"
,
tsDMnodeInfos
.
nodeNum
,
tsDMnodeInfos
.
inUse
);
for
(
int32_t
i
=
0
;
i
<
tsDMnodeInfos
.
nodeNum
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
tsDMnodeInfos
.
nodeNum
;
i
++
)
{
dInfo
(
"mnode:%d, %s"
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeId
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
);
dInfo
(
"mnode:%d, %s"
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeId
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
);
}
}
...
@@ -635,7 +635,7 @@ PARSE_OVER:
...
@@ -635,7 +635,7 @@ PARSE_OVER:
static
void
dnodeSaveMnodeInfos
()
{
static
void
dnodeSaveMnodeInfos
()
{
char
ipFile
[
TSDB_FILENAME_LEN
]
=
{
0
};
char
ipFile
[
TSDB_FILENAME_LEN
]
=
{
0
};
sprintf
(
ipFile
,
"%s/mnode
IpLis
t.json"
,
tsDnodeDir
);
sprintf
(
ipFile
,
"%s/mnode
EpSe
t.json"
,
tsDnodeDir
);
FILE
*
fp
=
fopen
(
ipFile
,
"w"
);
FILE
*
fp
=
fopen
(
ipFile
,
"w"
);
if
(
!
fp
)
return
;
if
(
!
fp
)
return
;
...
@@ -663,11 +663,11 @@ static void dnodeSaveMnodeInfos() {
...
@@ -663,11 +663,11 @@ static void dnodeSaveMnodeInfos() {
fclose
(
fp
);
fclose
(
fp
);
free
(
content
);
free
(
content
);
dInfo
(
"save mnode
iplis
t successed"
);
dInfo
(
"save mnode
epSe
t successed"
);
}
}
char
*
dnodeGetMnodeMasterEp
()
{
char
*
dnodeGetMnodeMasterEp
()
{
return
tsDMnodeInfos
.
nodeInfos
[
tsDMnode
I
pSet
.
inUse
].
nodeEp
;
return
tsDMnodeInfos
.
nodeInfos
[
tsDMnode
E
pSet
.
inUse
].
nodeEp
;
}
}
void
*
dnodeGetMnodeInfos
()
{
void
*
dnodeGetMnodeInfos
()
{
...
@@ -699,7 +699,6 @@ static void dnodeSendStatusMsg(void *handle, void *tmrId) {
...
@@ -699,7 +699,6 @@ static void dnodeSendStatusMsg(void *handle, void *tmrId) {
pStatus
->
dnodeId
=
htonl
(
tsDnodeCfg
.
dnodeId
);
pStatus
->
dnodeId
=
htonl
(
tsDnodeCfg
.
dnodeId
);
strcpy
(
pStatus
->
dnodeEp
,
tsLocalEp
);
strcpy
(
pStatus
->
dnodeEp
,
tsLocalEp
);
pStatus
->
lastReboot
=
htonl
(
tsRebootTime
);
pStatus
->
lastReboot
=
htonl
(
tsRebootTime
);
pStatus
->
numOfTotalVnodes
=
htons
((
uint16_t
)
tsNumOfTotalVnodes
);
pStatus
->
numOfCores
=
htons
((
uint16_t
)
tsNumOfCores
);
pStatus
->
numOfCores
=
htons
((
uint16_t
)
tsNumOfCores
);
pStatus
->
diskAvailable
=
tsAvailDataDirGB
;
pStatus
->
diskAvailable
=
tsAvailDataDirGB
;
pStatus
->
alternativeRole
=
(
uint8_t
)
tsAlternativeRole
;
pStatus
->
alternativeRole
=
(
uint8_t
)
tsAlternativeRole
;
...
@@ -727,9 +726,9 @@ static void dnodeSendStatusMsg(void *handle, void *tmrId) {
...
@@ -727,9 +726,9 @@ static void dnodeSendStatusMsg(void *handle, void *tmrId) {
.
msgType
=
TSDB_MSG_TYPE_DM_STATUS
.
msgType
=
TSDB_MSG_TYPE_DM_STATUS
};
};
SRpc
IpSet
i
pSet
;
SRpc
EpSet
e
pSet
;
dnodeGetMnode
IpSetForPeer
(
&
i
pSet
);
dnodeGetMnode
EpSetForPeer
(
&
e
pSet
);
dnodeSendMsgToDnode
(
&
i
pSet
,
&
rpcMsg
);
dnodeSendMsgToDnode
(
&
e
pSet
,
&
rpcMsg
);
}
}
static
bool
dnodeReadDnodeCfg
()
{
static
bool
dnodeReadDnodeCfg
()
{
...
@@ -818,20 +817,20 @@ void dnodeSendRedirectMsg(SRpcMsg *rpcMsg, bool forShell) {
...
@@ -818,20 +817,20 @@ void dnodeSendRedirectMsg(SRpcMsg *rpcMsg, bool forShell) {
SRpcConnInfo
connInfo
=
{
0
};
SRpcConnInfo
connInfo
=
{
0
};
rpcGetConnInfo
(
rpcMsg
->
handle
,
&
connInfo
);
rpcGetConnInfo
(
rpcMsg
->
handle
,
&
connInfo
);
SRpc
IpSet
i
pSet
=
{
0
};
SRpc
EpSet
e
pSet
=
{
0
};
if
(
forShell
)
{
if
(
forShell
)
{
dnodeGetMnode
IpSetForShell
(
&
i
pSet
);
dnodeGetMnode
EpSetForShell
(
&
e
pSet
);
}
else
{
}
else
{
dnodeGetMnode
IpSetForPeer
(
&
i
pSet
);
dnodeGetMnode
EpSetForPeer
(
&
e
pSet
);
}
}
dDebug
(
"msg:%s will be redirected, dnodeIp:%s user:%s, numOf
I
ps:%d inUse:%d"
,
taosMsg
[
rpcMsg
->
msgType
],
dDebug
(
"msg:%s will be redirected, dnodeIp:%s user:%s, numOf
E
ps:%d inUse:%d"
,
taosMsg
[
rpcMsg
->
msgType
],
taosIpStr
(
connInfo
.
clientIp
),
connInfo
.
user
,
ipSet
.
numOfIps
,
i
pSet
.
inUse
);
taosIpStr
(
connInfo
.
clientIp
),
connInfo
.
user
,
epSet
.
numOfEps
,
e
pSet
.
inUse
);
for
(
int
i
=
0
;
i
<
ipSet
.
numOfI
ps
;
++
i
)
{
for
(
int
i
=
0
;
i
<
epSet
.
numOfE
ps
;
++
i
)
{
dDebug
(
"mnode index:%d %s:%d"
,
i
,
ipSet
.
fqdn
[
i
],
i
pSet
.
port
[
i
]);
dDebug
(
"mnode index:%d %s:%d"
,
i
,
epSet
.
fqdn
[
i
],
e
pSet
.
port
[
i
]);
ipSet
.
port
[
i
]
=
htons
(
i
pSet
.
port
[
i
]);
epSet
.
port
[
i
]
=
htons
(
e
pSet
.
port
[
i
]);
}
}
rpcSendRedirectRsp
(
rpcMsg
->
handle
,
&
i
pSet
);
rpcSendRedirectRsp
(
rpcMsg
->
handle
,
&
e
pSet
);
}
}
src/dnode/src/dnodePeer.c
浏览文件 @
1e21eaff
...
@@ -29,11 +29,11 @@
...
@@ -29,11 +29,11 @@
#include "dnodeVWrite.h"
#include "dnodeVWrite.h"
#include "dnodeMPeer.h"
#include "dnodeMPeer.h"
extern
void
dnodeUpdateMnode
IpSetForPeer
(
SRpcIpSet
*
pI
pSet
);
extern
void
dnodeUpdateMnode
EpSetForPeer
(
SRpcEpSet
*
pE
pSet
);
static
void
(
*
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
);
static
void
(
*
dnodeProcessReqMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
);
static
void
dnodeProcessReqMsgFromDnode
(
SRpcMsg
*
pMsg
,
SRpc
I
pSet
*
);
static
void
dnodeProcessReqMsgFromDnode
(
SRpcMsg
*
pMsg
,
SRpc
E
pSet
*
);
static
void
(
*
dnodeProcessRspMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
rpcMsg
);
static
void
(
*
dnodeProcessRspMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
rpcMsg
);
static
void
dnodeProcessRspFromDnode
(
SRpcMsg
*
pMsg
,
SRpc
IpSet
*
pI
pSet
);
static
void
dnodeProcessRspFromDnode
(
SRpcMsg
*
pMsg
,
SRpc
EpSet
*
pE
pSet
);
static
void
*
tsDnodeServerRpc
=
NULL
;
static
void
*
tsDnodeServerRpc
=
NULL
;
static
void
*
tsDnodeClientRpc
=
NULL
;
static
void
*
tsDnodeClientRpc
=
NULL
;
...
@@ -83,7 +83,7 @@ void dnodeCleanupServer() {
...
@@ -83,7 +83,7 @@ void dnodeCleanupServer() {
}
}
}
}
static
void
dnodeProcessReqMsgFromDnode
(
SRpcMsg
*
pMsg
,
SRpc
IpSet
*
pI
pSet
)
{
static
void
dnodeProcessReqMsgFromDnode
(
SRpcMsg
*
pMsg
,
SRpc
EpSet
*
pE
pSet
)
{
SRpcMsg
rspMsg
=
{
SRpcMsg
rspMsg
=
{
.
handle
=
pMsg
->
handle
,
.
handle
=
pMsg
->
handle
,
.
pCont
=
NULL
,
.
pCont
=
NULL
,
...
@@ -148,9 +148,9 @@ void dnodeCleanupClient() {
...
@@ -148,9 +148,9 @@ void dnodeCleanupClient() {
}
}
}
}
static
void
dnodeProcessRspFromDnode
(
SRpcMsg
*
pMsg
,
SRpc
IpSet
*
pI
pSet
)
{
static
void
dnodeProcessRspFromDnode
(
SRpcMsg
*
pMsg
,
SRpc
EpSet
*
pE
pSet
)
{
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_DM_STATUS_RSP
&&
p
I
pSet
)
{
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_DM_STATUS_RSP
&&
p
E
pSet
)
{
dnodeUpdateMnode
IpSetForPeer
(
pI
pSet
);
dnodeUpdateMnode
EpSetForPeer
(
pE
pSet
);
}
}
if
(
dnodeProcessRspMsgFp
[
pMsg
->
msgType
])
{
if
(
dnodeProcessRspMsgFp
[
pMsg
->
msgType
])
{
...
@@ -166,12 +166,12 @@ void dnodeAddClientRspHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) {
...
@@ -166,12 +166,12 @@ void dnodeAddClientRspHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) {
dnodeProcessRspMsgFp
[
msgType
]
=
fp
;
dnodeProcessRspMsgFp
[
msgType
]
=
fp
;
}
}
void
dnodeSendMsgToDnode
(
SRpc
IpSet
*
i
pSet
,
SRpcMsg
*
rpcMsg
)
{
void
dnodeSendMsgToDnode
(
SRpc
EpSet
*
e
pSet
,
SRpcMsg
*
rpcMsg
)
{
rpcSendRequest
(
tsDnodeClientRpc
,
i
pSet
,
rpcMsg
);
rpcSendRequest
(
tsDnodeClientRpc
,
e
pSet
,
rpcMsg
);
}
}
void
dnodeSendMsgToDnodeRecv
(
SRpcMsg
*
rpcMsg
,
SRpcMsg
*
rpcRsp
)
{
void
dnodeSendMsgToDnodeRecv
(
SRpcMsg
*
rpcMsg
,
SRpcMsg
*
rpcRsp
)
{
SRpc
IpSet
i
pSet
=
{
0
};
SRpc
EpSet
e
pSet
=
{
0
};
dnodeGetMnode
IpSetForPeer
(
&
i
pSet
);
dnodeGetMnode
EpSetForPeer
(
&
e
pSet
);
rpcSendRecv
(
tsDnodeClientRpc
,
&
i
pSet
,
rpcMsg
,
rpcRsp
);
rpcSendRecv
(
tsDnodeClientRpc
,
&
e
pSet
,
rpcMsg
,
rpcRsp
);
}
}
src/dnode/src/dnodeShell.c
浏览文件 @
1e21eaff
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
#include "dnodeShell.h"
#include "dnodeShell.h"
static
void
(
*
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
);
static
void
(
*
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_MAX
])(
SRpcMsg
*
);
static
void
dnodeProcessMsgFromShell
(
SRpcMsg
*
pMsg
,
SRpc
I
pSet
*
);
static
void
dnodeProcessMsgFromShell
(
SRpcMsg
*
pMsg
,
SRpc
E
pSet
*
);
static
int
dnodeRetrieveUserAuthInfo
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
static
int
dnodeRetrieveUserAuthInfo
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
static
void
*
tsDnodeShellRpc
=
NULL
;
static
void
*
tsDnodeShellRpc
=
NULL
;
static
int32_t
tsDnodeQueryReqNum
=
0
;
static
int32_t
tsDnodeQueryReqNum
=
0
;
...
@@ -108,7 +108,7 @@ void dnodeCleanupShell() {
...
@@ -108,7 +108,7 @@ void dnodeCleanupShell() {
}
}
}
}
void
dnodeProcessMsgFromShell
(
SRpcMsg
*
pMsg
,
SRpc
IpSet
*
pI
pSet
)
{
void
dnodeProcessMsgFromShell
(
SRpcMsg
*
pMsg
,
SRpc
EpSet
*
pE
pSet
)
{
SRpcMsg
rpcMsg
=
{
SRpcMsg
rpcMsg
=
{
.
handle
=
pMsg
->
handle
,
.
handle
=
pMsg
->
handle
,
.
pCont
=
NULL
,
.
pCont
=
NULL
,
...
...
src/inc/dnode.h
浏览文件 @
1e21eaff
...
@@ -39,13 +39,13 @@ SDnodeStatisInfo dnodeGetStatisInfo();
...
@@ -39,13 +39,13 @@ SDnodeStatisInfo dnodeGetStatisInfo();
bool
dnodeIsFirstDeploy
();
bool
dnodeIsFirstDeploy
();
char
*
dnodeGetMnodeMasterEp
();
char
*
dnodeGetMnodeMasterEp
();
void
dnodeGetMnode
IpSetForPeer
(
void
*
i
pSet
);
void
dnodeGetMnode
EpSetForPeer
(
void
*
e
pSet
);
void
dnodeGetMnode
IpSetForShell
(
void
*
i
pSet
);
void
dnodeGetMnode
EpSetForShell
(
void
*
e
pSet
);
void
*
dnodeGetMnodeInfos
();
void
*
dnodeGetMnodeInfos
();
int32_t
dnodeGetDnodeId
();
int32_t
dnodeGetDnodeId
();
void
dnodeAddClientRspHandle
(
uint8_t
msgType
,
void
(
*
fp
)(
SRpcMsg
*
rpcMsg
));
void
dnodeAddClientRspHandle
(
uint8_t
msgType
,
void
(
*
fp
)(
SRpcMsg
*
rpcMsg
));
void
dnodeSendMsgToDnode
(
SRpc
IpSet
*
i
pSet
,
SRpcMsg
*
rpcMsg
);
void
dnodeSendMsgToDnode
(
SRpc
EpSet
*
e
pSet
,
SRpcMsg
*
rpcMsg
);
void
dnodeSendMsgToDnodeRecv
(
SRpcMsg
*
rpcMsg
,
SRpcMsg
*
rpcRsp
);
void
dnodeSendMsgToDnodeRecv
(
SRpcMsg
*
rpcMsg
,
SRpcMsg
*
rpcRsp
);
void
*
dnodeSendCfgTableToRecv
(
int32_t
vgId
,
int32_t
sid
);
void
*
dnodeSendCfgTableToRecv
(
int32_t
vgId
,
int32_t
sid
);
...
...
src/inc/taosdef.h
浏览文件 @
1e21eaff
...
@@ -274,9 +274,8 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
...
@@ -274,9 +274,8 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
#define TSDB_DEFAULT_PAYLOAD_SIZE 5120 // default payload size, greater than PATH_MAX value
#define TSDB_DEFAULT_PAYLOAD_SIZE 5120 // default payload size, greater than PATH_MAX value
#define TSDB_EXTRA_PAYLOAD_SIZE 128 // extra bytes for auth
#define TSDB_EXTRA_PAYLOAD_SIZE 128 // extra bytes for auth
#define TSDB_CQ_SQL_SIZE 1024
#define TSDB_CQ_SQL_SIZE 1024
#define TSDB_MIN_VNODES 64
#define TSDB_MAX_VNODES 2048
#define TSDB_MAX_VNODES 2048
#define TSDB_MIN_VNODES 256
#define TSDB_INVALID_VNODE_NUM 0
#define TSDB_DNODE_ROLE_ANY 0
#define TSDB_DNODE_ROLE_ANY 0
#define TSDB_DNODE_ROLE_MGMT 1
#define TSDB_DNODE_ROLE_MGMT 1
...
...
src/inc/taosmsg.h
浏览文件 @
1e21eaff
...
@@ -176,7 +176,7 @@ extern char *taosMsg[];
...
@@ -176,7 +176,7 @@ extern char *taosMsg[];
typedef
struct
{
typedef
struct
{
char
fqdn
[
TSDB_FQDN_LEN
];
char
fqdn
[
TSDB_FQDN_LEN
];
uint16_t
port
;
uint16_t
port
;
}
S
I
pAddr
;
}
S
E
pAddr
;
typedef
struct
{
typedef
struct
{
int32_t
numOfVnodes
;
int32_t
numOfVnodes
;
...
@@ -306,7 +306,7 @@ typedef struct {
...
@@ -306,7 +306,7 @@ typedef struct {
int8_t
reserved1
;
int8_t
reserved1
;
int8_t
reserved2
;
int8_t
reserved2
;
int32_t
connId
;
int32_t
connId
;
SRpc
IpSet
ipLis
t
;
SRpc
EpSet
epSe
t
;
}
SCMConnectRsp
;
}
SCMConnectRsp
;
typedef
struct
{
typedef
struct
{
...
@@ -581,12 +581,12 @@ typedef struct {
...
@@ -581,12 +581,12 @@ typedef struct {
char
dnodeEp
[
TSDB_EP_LEN
];
char
dnodeEp
[
TSDB_EP_LEN
];
uint32_t
moduleStatus
;
uint32_t
moduleStatus
;
uint32_t
lastReboot
;
// time stamp for last reboot
uint32_t
lastReboot
;
// time stamp for last reboot
uint16_t
numOfTotalVnodes
;
// from config file
uint16_t
reserve1
;
// from config file
uint16_t
openVnodes
;
uint16_t
openVnodes
;
uint16_t
numOfCores
;
uint16_t
numOfCores
;
float
diskAvailable
;
// GB
float
diskAvailable
;
// GB
uint8_t
alternativeRole
;
uint8_t
alternativeRole
;
uint8_t
reserve
[
15
];
uint8_t
reserve
2
[
15
];
SClusterCfg
clusterCfg
;
SClusterCfg
clusterCfg
;
SVnodeLoad
load
[];
SVnodeLoad
load
[];
}
SDMStatusMsg
;
}
SDMStatusMsg
;
...
@@ -648,8 +648,8 @@ typedef struct SCMSTableVgroupMsg {
...
@@ -648,8 +648,8 @@ typedef struct SCMSTableVgroupMsg {
typedef
struct
{
typedef
struct
{
int32_t
vgId
;
int32_t
vgId
;
int8_t
numOf
I
ps
;
int8_t
numOf
E
ps
;
S
IpAddr
i
pAddr
[
TSDB_MAX_REPLICA
];
S
EpAddr
e
pAddr
[
TSDB_MAX_REPLICA
];
}
SCMVgroupInfo
;
}
SCMVgroupInfo
;
typedef
struct
{
typedef
struct
{
...
@@ -753,7 +753,7 @@ typedef struct {
...
@@ -753,7 +753,7 @@ typedef struct {
uint32_t
onlineDnodes
;
uint32_t
onlineDnodes
;
uint32_t
connId
;
uint32_t
connId
;
int8_t
killConnection
;
int8_t
killConnection
;
SRpc
IpSet
ipLis
t
;
SRpc
EpSet
epSe
t
;
}
SCMHeartBeatRsp
;
}
SCMHeartBeatRsp
;
typedef
struct
{
typedef
struct
{
...
...
src/inc/trpc.h
浏览文件 @
1e21eaff
...
@@ -28,12 +28,12 @@ extern "C" {
...
@@ -28,12 +28,12 @@ extern "C" {
extern
int
tsRpcHeadSize
;
extern
int
tsRpcHeadSize
;
typedef
struct
SRpc
I
pSet
{
typedef
struct
SRpc
E
pSet
{
int8_t
inUse
;
int8_t
inUse
;
int8_t
numOf
I
ps
;
int8_t
numOf
E
ps
;
uint16_t
port
[
TSDB_MAX_REPLICA
];
uint16_t
port
[
TSDB_MAX_REPLICA
];
char
fqdn
[
TSDB_MAX_REPLICA
][
TSDB_FQDN_LEN
];
char
fqdn
[
TSDB_MAX_REPLICA
][
TSDB_FQDN_LEN
];
}
SRpc
I
pSet
;
}
SRpc
E
pSet
;
typedef
struct
SRpcConnInfo
{
typedef
struct
SRpcConnInfo
{
uint32_t
clientIp
;
uint32_t
clientIp
;
...
@@ -67,7 +67,7 @@ typedef struct SRpcInit {
...
@@ -67,7 +67,7 @@ typedef struct SRpcInit {
char
*
ckey
;
// ciphering key
char
*
ckey
;
// ciphering key
// call back to process incoming msg, code shall be ignored by server app
// call back to process incoming msg, code shall be ignored by server app
void
(
*
cfp
)(
SRpcMsg
*
,
SRpc
I
pSet
*
);
void
(
*
cfp
)(
SRpcMsg
*
,
SRpc
E
pSet
*
);
// call back to retrieve the client auth info, for server app only
// call back to retrieve the client auth info, for server app only
int
(
*
afp
)(
char
*
tableId
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
int
(
*
afp
)(
char
*
tableId
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
...
@@ -78,11 +78,11 @@ void rpcClose(void *);
...
@@ -78,11 +78,11 @@ void rpcClose(void *);
void
*
rpcMallocCont
(
int
contLen
);
void
*
rpcMallocCont
(
int
contLen
);
void
rpcFreeCont
(
void
*
pCont
);
void
rpcFreeCont
(
void
*
pCont
);
void
*
rpcReallocCont
(
void
*
ptr
,
int
contLen
);
void
*
rpcReallocCont
(
void
*
ptr
,
int
contLen
);
void
rpcSendRequest
(
void
*
thandle
,
const
SRpc
IpSet
*
pI
pSet
,
SRpcMsg
*
pMsg
);
void
rpcSendRequest
(
void
*
thandle
,
const
SRpc
EpSet
*
pE
pSet
,
SRpcMsg
*
pMsg
);
void
rpcSendResponse
(
const
SRpcMsg
*
pMsg
);
void
rpcSendResponse
(
const
SRpcMsg
*
pMsg
);
void
rpcSendRedirectRsp
(
void
*
pConn
,
const
SRpc
IpSet
*
pI
pSet
);
void
rpcSendRedirectRsp
(
void
*
pConn
,
const
SRpc
EpSet
*
pE
pSet
);
int
rpcGetConnInfo
(
void
*
thandle
,
SRpcConnInfo
*
pInfo
);
int
rpcGetConnInfo
(
void
*
thandle
,
SRpcConnInfo
*
pInfo
);
void
rpcSendRecv
(
void
*
shandle
,
SRpc
IpSet
*
pI
pSet
,
SRpcMsg
*
pReq
,
SRpcMsg
*
pRsp
);
void
rpcSendRecv
(
void
*
shandle
,
SRpc
EpSet
*
pE
pSet
,
SRpcMsg
*
pReq
,
SRpcMsg
*
pRsp
);
int
rpcReportProgress
(
void
*
pConn
,
char
*
pCont
,
int
contLen
);
int
rpcReportProgress
(
void
*
pConn
,
char
*
pCont
,
int
contLen
);
void
rpcCancelRequest
(
void
*
pContext
);
void
rpcCancelRequest
(
void
*
pContext
);
...
...
src/inc/tsdb.h
浏览文件 @
1e21eaff
...
@@ -174,11 +174,6 @@ typedef struct {
...
@@ -174,11 +174,6 @@ typedef struct {
SHashObj
*
map
;
// speedup acquire the tableQueryInfo from STableId
SHashObj
*
map
;
// speedup acquire the tableQueryInfo from STableId
}
STableGroupInfo
;
}
STableGroupInfo
;
typedef
struct
SQueryRowCond
{
int32_t
rel
;
TSKEY
ts
;
}
SQueryRowCond
;
/**
/**
* Get the data block iterator, starting from position according to the query condition
* Get the data block iterator, starting from position according to the query condition
*
*
...
@@ -275,7 +270,7 @@ int32_t tsdbQuerySTableByTagCond(TSDB_REPO_T *tsdb, uint64_t uid, const char *pT
...
@@ -275,7 +270,7 @@ int32_t tsdbQuerySTableByTagCond(TSDB_REPO_T *tsdb, uint64_t uid, const char *pT
* destory the created table group list, which is generated by tag query
* destory the created table group list, which is generated by tag query
* @param pGroupList
* @param pGroupList
*/
*/
void
tsdbDest
or
yTableGroup
(
STableGroupInfo
*
pGroupList
);
void
tsdbDest
ro
yTableGroup
(
STableGroupInfo
*
pGroupList
);
/**
/**
* create the table group result including only one table, used to handle the normal table query
* create the table group result including only one table, used to handle the normal table query
...
...
src/kit/taosmigrate/taosmigrate.c
浏览文件 @
1e21eaff
...
@@ -210,10 +210,10 @@ int32_t main(int32_t argc, char *argv[]) {
...
@@ -210,10 +210,10 @@ int32_t main(int32_t argc, char *argv[]) {
(
void
)
snprintf
(
mnodeWal
,
TSDB_FILENAME_LEN
*
2
,
"%s/mnode/wal/wal0"
,
arguments
.
dataDir
);
(
void
)
snprintf
(
mnodeWal
,
TSDB_FILENAME_LEN
*
2
,
"%s/mnode/wal/wal0"
,
arguments
.
dataDir
);
walModWalFile
(
mnodeWal
);
walModWalFile
(
mnodeWal
);
// 2. modfiy dnode config: mnode
IpLis
t.json
// 2. modfiy dnode config: mnode
EpSe
t.json
char
dnode
IpLis
t
[
TSDB_FILENAME_LEN
*
2
]
=
{
0
};
char
dnode
EpSe
t
[
TSDB_FILENAME_LEN
*
2
]
=
{
0
};
(
void
)
snprintf
(
dnode
IpList
,
TSDB_FILENAME_LEN
*
2
,
"%s/dnode/mnodeIpLis
t.json"
,
arguments
.
dataDir
);
(
void
)
snprintf
(
dnode
EpSet
,
TSDB_FILENAME_LEN
*
2
,
"%s/dnode/mnodeEpSe
t.json"
,
arguments
.
dataDir
);
modDnode
IpList
(
dnodeIpLis
t
);
modDnode
EpSet
(
dnodeEpSe
t
);
// 3. modify vnode config: config.json
// 3. modify vnode config: config.json
char
vnodeDir
[
TSDB_FILENAME_LEN
*
2
]
=
{
0
};
char
vnodeDir
[
TSDB_FILENAME_LEN
*
2
]
=
{
0
};
...
...
src/kit/taosmigrate/taosmigrate.h
浏览文件 @
1e21eaff
...
@@ -71,7 +71,7 @@ int tSystemShell(const char * cmd);
...
@@ -71,7 +71,7 @@ int tSystemShell(const char * cmd);
void
taosMvFile
(
char
*
destFile
,
char
*
srcFile
)
;
void
taosMvFile
(
char
*
destFile
,
char
*
srcFile
)
;
void
walModWalFile
(
char
*
walfile
);
void
walModWalFile
(
char
*
walfile
);
SdnodeIfo
*
getDnodeInfo
(
int32_t
dnodeId
);
SdnodeIfo
*
getDnodeInfo
(
int32_t
dnodeId
);
void
modDnode
IpList
(
char
*
dnodeIpLis
t
);
void
modDnode
EpSet
(
char
*
dnodeEpSe
t
);
void
modAllVnode
(
char
*
vnodeDir
);
void
modAllVnode
(
char
*
vnodeDir
);
#endif
#endif
src/kit/taosmigrate/taosmigrateDnodeCfg.c
浏览文件 @
1e21eaff
...
@@ -23,10 +23,10 @@
...
@@ -23,10 +23,10 @@
static
SDMMnodeInfos
tsDnodeIpInfos
=
{
0
};
static
SDMMnodeInfos
tsDnodeIpInfos
=
{
0
};
static
bool
dnodeReadMnodeInfos
(
char
*
dnode
IpLis
t
)
{
static
bool
dnodeReadMnodeInfos
(
char
*
dnode
EpSe
t
)
{
FILE
*
fp
=
fopen
(
dnode
IpLis
t
,
"r"
);
FILE
*
fp
=
fopen
(
dnode
EpSe
t
,
"r"
);
if
(
!
fp
)
{
if
(
!
fp
)
{
printf
(
"failed to read mnode
IpLis
t.json, file not exist
\n
"
);
printf
(
"failed to read mnode
EpSe
t.json, file not exist
\n
"
);
return
false
;
return
false
;
}
}
...
@@ -37,40 +37,40 @@ static bool dnodeReadMnodeInfos(char* dnodeIpList) {
...
@@ -37,40 +37,40 @@ static bool dnodeReadMnodeInfos(char* dnodeIpList) {
if
(
len
<=
0
)
{
if
(
len
<=
0
)
{
free
(
content
);
free
(
content
);
fclose
(
fp
);
fclose
(
fp
);
printf
(
"failed to read mnode
IpLis
t.json, content is null
\n
"
);
printf
(
"failed to read mnode
EpSe
t.json, content is null
\n
"
);
return
false
;
return
false
;
}
}
content
[
len
]
=
0
;
content
[
len
]
=
0
;
cJSON
*
root
=
cJSON_Parse
(
content
);
cJSON
*
root
=
cJSON_Parse
(
content
);
if
(
root
==
NULL
)
{
if
(
root
==
NULL
)
{
printf
(
"failed to read mnode
IpLis
t.json, invalid json format
\n
"
);
printf
(
"failed to read mnode
EpSe
t.json, invalid json format
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
cJSON
*
inUse
=
cJSON_GetObjectItem
(
root
,
"inUse"
);
cJSON
*
inUse
=
cJSON_GetObjectItem
(
root
,
"inUse"
);
if
(
!
inUse
||
inUse
->
type
!=
cJSON_Number
)
{
if
(
!
inUse
||
inUse
->
type
!=
cJSON_Number
)
{
printf
(
"failed to read mnode
IpLis
t.json, inUse not found
\n
"
);
printf
(
"failed to read mnode
EpSe
t.json, inUse not found
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
tsDnodeIpInfos
.
inUse
=
inUse
->
valueint
;
tsDnodeIpInfos
.
inUse
=
inUse
->
valueint
;
cJSON
*
nodeNum
=
cJSON_GetObjectItem
(
root
,
"nodeNum"
);
cJSON
*
nodeNum
=
cJSON_GetObjectItem
(
root
,
"nodeNum"
);
if
(
!
nodeNum
||
nodeNum
->
type
!=
cJSON_Number
)
{
if
(
!
nodeNum
||
nodeNum
->
type
!=
cJSON_Number
)
{
printf
(
"failed to read mnode
IpLis
t.json, nodeNum not found
\n
"
);
printf
(
"failed to read mnode
EpSe
t.json, nodeNum not found
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
tsDnodeIpInfos
.
nodeNum
=
nodeNum
->
valueint
;
tsDnodeIpInfos
.
nodeNum
=
nodeNum
->
valueint
;
cJSON
*
nodeInfos
=
cJSON_GetObjectItem
(
root
,
"nodeInfos"
);
cJSON
*
nodeInfos
=
cJSON_GetObjectItem
(
root
,
"nodeInfos"
);
if
(
!
nodeInfos
||
nodeInfos
->
type
!=
cJSON_Array
)
{
if
(
!
nodeInfos
||
nodeInfos
->
type
!=
cJSON_Array
)
{
printf
(
"failed to read mnode
IpLis
t.json, nodeInfos not found
\n
"
);
printf
(
"failed to read mnode
EpSe
t.json, nodeInfos not found
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
int
size
=
cJSON_GetArraySize
(
nodeInfos
);
int
size
=
cJSON_GetArraySize
(
nodeInfos
);
if
(
size
!=
tsDnodeIpInfos
.
nodeNum
)
{
if
(
size
!=
tsDnodeIpInfos
.
nodeNum
)
{
printf
(
"failed to read mnode
IpLis
t.json, nodeInfos size not matched
\n
"
);
printf
(
"failed to read mnode
EpSe
t.json, nodeInfos size not matched
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
...
@@ -80,14 +80,14 @@ static bool dnodeReadMnodeInfos(char* dnodeIpList) {
...
@@ -80,14 +80,14 @@ static bool dnodeReadMnodeInfos(char* dnodeIpList) {
cJSON
*
nodeId
=
cJSON_GetObjectItem
(
nodeInfo
,
"nodeId"
);
cJSON
*
nodeId
=
cJSON_GetObjectItem
(
nodeInfo
,
"nodeId"
);
if
(
!
nodeId
||
nodeId
->
type
!=
cJSON_Number
)
{
if
(
!
nodeId
||
nodeId
->
type
!=
cJSON_Number
)
{
printf
(
"failed to read mnode
IpLis
t.json, nodeId not found
\n
"
);
printf
(
"failed to read mnode
EpSe
t.json, nodeId not found
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
tsDnodeIpInfos
.
nodeInfos
[
i
].
nodeId
=
nodeId
->
valueint
;
tsDnodeIpInfos
.
nodeInfos
[
i
].
nodeId
=
nodeId
->
valueint
;
cJSON
*
nodeEp
=
cJSON_GetObjectItem
(
nodeInfo
,
"nodeEp"
);
cJSON
*
nodeEp
=
cJSON_GetObjectItem
(
nodeInfo
,
"nodeEp"
);
if
(
!
nodeEp
||
nodeEp
->
type
!=
cJSON_String
||
nodeEp
->
valuestring
==
NULL
)
{
if
(
!
nodeEp
||
nodeEp
->
type
!=
cJSON_String
||
nodeEp
->
valuestring
==
NULL
)
{
printf
(
"failed to read mnode
IpLis
t.json, nodeName not found
\n
"
);
printf
(
"failed to read mnode
EpSe
t.json, nodeName not found
\n
"
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
strncpy
(
tsDnodeIpInfos
.
nodeInfos
[
i
].
nodeEp
,
nodeEp
->
valuestring
,
TSDB_EP_LEN
);
strncpy
(
tsDnodeIpInfos
.
nodeInfos
[
i
].
nodeEp
,
nodeEp
->
valuestring
,
TSDB_EP_LEN
);
...
@@ -102,7 +102,7 @@ static bool dnodeReadMnodeInfos(char* dnodeIpList) {
...
@@ -102,7 +102,7 @@ static bool dnodeReadMnodeInfos(char* dnodeIpList) {
ret
=
true
;
ret
=
true
;
//printf("read mnode
iplist successed, numOfI
ps:%d inUse:%d\n", tsDnodeIpInfos.nodeNum, tsDnodeIpInfos.inUse);
//printf("read mnode
epSet successed, numOfE
ps:%d inUse:%d\n", tsDnodeIpInfos.nodeNum, tsDnodeIpInfos.inUse);
//for (int32_t i = 0; i < tsDnodeIpInfos.nodeNum; i++) {
//for (int32_t i = 0; i < tsDnodeIpInfos.nodeNum; i++) {
// printf("mnode:%d, %s\n", tsDnodeIpInfos.nodeInfos[i].nodeId, tsDnodeIpInfos.nodeInfos[i].nodeEp);
// printf("mnode:%d, %s\n", tsDnodeIpInfos.nodeInfos[i].nodeId, tsDnodeIpInfos.nodeInfos[i].nodeEp);
//}
//}
...
@@ -115,8 +115,8 @@ PARSE_OVER:
...
@@ -115,8 +115,8 @@ PARSE_OVER:
}
}
static
void
dnodeSaveMnodeInfos
(
char
*
dnode
IpLis
t
)
{
static
void
dnodeSaveMnodeInfos
(
char
*
dnode
EpSe
t
)
{
FILE
*
fp
=
fopen
(
dnode
IpLis
t
,
"w"
);
FILE
*
fp
=
fopen
(
dnode
EpSe
t
,
"w"
);
if
(
!
fp
)
return
;
if
(
!
fp
)
return
;
int32_t
len
=
0
;
int32_t
len
=
0
;
...
@@ -143,13 +143,13 @@ static void dnodeSaveMnodeInfos(char* dnodeIpList) {
...
@@ -143,13 +143,13 @@ static void dnodeSaveMnodeInfos(char* dnodeIpList) {
fclose
(
fp
);
fclose
(
fp
);
free
(
content
);
free
(
content
);
printf
(
"mod mnode
iplis
t successed
\n
"
);
printf
(
"mod mnode
epSe
t successed
\n
"
);
}
}
void
modDnode
IpList
(
char
*
dnodeIpLis
t
)
void
modDnode
EpSet
(
char
*
dnodeEpSe
t
)
{
{
(
void
)
dnodeReadMnodeInfos
(
dnode
IpLis
t
);
(
void
)
dnodeReadMnodeInfos
(
dnode
EpSe
t
);
dnodeSaveMnodeInfos
(
dnode
IpLis
t
);
dnodeSaveMnodeInfos
(
dnode
EpSe
t
);
return
;
return
;
}
}
...
...
src/mnode/inc/mnodeDef.h
浏览文件 @
1e21eaff
...
@@ -40,7 +40,7 @@ typedef struct SDnodeObj {
...
@@ -40,7 +40,7 @@ typedef struct SDnodeObj {
int32_t
dnodeId
;
int32_t
dnodeId
;
int32_t
openVnodes
;
int32_t
openVnodes
;
int64_t
createdTime
;
int64_t
createdTime
;
int32_t
totalVnodes
;
// from dnode status msg, config information
int32_t
resever0
;
// from dnode status msg, config information
int32_t
customScore
;
// config by user
int32_t
customScore
;
// config by user
uint32_t
lastAccess
;
uint32_t
lastAccess
;
uint16_t
numOfCores
;
// from dnode status msg
uint16_t
numOfCores
;
// from dnode status msg
...
@@ -50,7 +50,7 @@ typedef struct SDnodeObj {
...
@@ -50,7 +50,7 @@ typedef struct SDnodeObj {
int8_t
alternativeRole
;
// from dnode status msg, 0-any, 1-mgmt, 2-dnode
int8_t
alternativeRole
;
// from dnode status msg, 0-any, 1-mgmt, 2-dnode
int8_t
status
;
// set in balance function
int8_t
status
;
// set in balance function
int8_t
isMgmt
;
int8_t
isMgmt
;
int8_t
reserve
d0
[
14
];
int8_t
reserve
1
[
14
];
int8_t
updateEnd
[
1
];
int8_t
updateEnd
[
1
];
int32_t
refCount
;
int32_t
refCount
;
uint32_t
moduleStatus
;
uint32_t
moduleStatus
;
...
@@ -61,7 +61,7 @@ typedef struct SDnodeObj {
...
@@ -61,7 +61,7 @@ typedef struct SDnodeObj {
int16_t
cpuAvgUsage
;
// calc from sys.cpu
int16_t
cpuAvgUsage
;
// calc from sys.cpu
int16_t
memoryAvgUsage
;
// calc from sys.mem
int16_t
memoryAvgUsage
;
// calc from sys.mem
int16_t
bandwidthUsage
;
// calc from sys.band
int16_t
bandwidthUsage
;
// calc from sys.band
int8_t
reserved
1
[
2
];
int8_t
reserved
2
[
2
];
}
SDnodeObj
;
}
SDnodeObj
;
typedef
struct
SMnodeObj
{
typedef
struct
SMnodeObj
{
...
...
src/mnode/inc/mnodeMnode.h
浏览文件 @
1e21eaff
...
@@ -42,12 +42,12 @@ void mnodeIncMnodeRef(struct SMnodeObj *pMnode);
...
@@ -42,12 +42,12 @@ void mnodeIncMnodeRef(struct SMnodeObj *pMnode);
void
mnodeDecMnodeRef
(
struct
SMnodeObj
*
pMnode
);
void
mnodeDecMnodeRef
(
struct
SMnodeObj
*
pMnode
);
char
*
mnodeGetMnodeRoleStr
();
char
*
mnodeGetMnodeRoleStr
();
void
mnodeGetMnode
IpSetForPeer
(
SRpcIpSet
*
i
pSet
);
void
mnodeGetMnode
EpSetForPeer
(
SRpcEpSet
*
e
pSet
);
void
mnodeGetMnode
IpSetForShell
(
SRpcIpSet
*
i
pSet
);
void
mnodeGetMnode
EpSetForShell
(
SRpcEpSet
*
e
pSet
);
char
*
mnodeGetMnodeMasterEp
();
char
*
mnodeGetMnodeMasterEp
();
void
mnodeGetMnodeInfos
(
void
*
mnodes
);
void
mnodeGetMnodeInfos
(
void
*
mnodes
);
void
mnodeUpdateMnode
I
pSet
();
void
mnodeUpdateMnode
E
pSet
();
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/mnode/inc/mnodeVgroup.h
浏览文件 @
1e21eaff
...
@@ -44,12 +44,12 @@ int32_t mnodeGetAvailableVgroup(struct SMnodeMsg *pMsg, SVgObj **pVgroup, int32_
...
@@ -44,12 +44,12 @@ int32_t mnodeGetAvailableVgroup(struct SMnodeMsg *pMsg, SVgObj **pVgroup, int32_
void
mnodeAddTableIntoVgroup
(
SVgObj
*
pVgroup
,
SChildTableObj
*
pTable
);
void
mnodeAddTableIntoVgroup
(
SVgObj
*
pVgroup
,
SChildTableObj
*
pTable
);
void
mnodeRemoveTableFromVgroup
(
SVgObj
*
pVgroup
,
SChildTableObj
*
pTable
);
void
mnodeRemoveTableFromVgroup
(
SVgObj
*
pVgroup
,
SChildTableObj
*
pTable
);
void
mnodeSendDropVnodeMsg
(
int32_t
vgId
,
SRpc
IpSet
*
i
pSet
,
void
*
ahandle
);
void
mnodeSendDropVnodeMsg
(
int32_t
vgId
,
SRpc
EpSet
*
e
pSet
,
void
*
ahandle
);
void
mnodeSendCreateVgroupMsg
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
void
mnodeSendCreateVgroupMsg
(
SVgObj
*
pVgroup
,
void
*
ahandle
);
void
mnodeSendAlterVgroupMsg
(
SVgObj
*
pVgroup
);
void
mnodeSendAlterVgroupMsg
(
SVgObj
*
pVgroup
);
SRpc
IpSet
mnodeGetI
pSetFromVgroup
(
SVgObj
*
pVgroup
);
SRpc
EpSet
mnodeGetE
pSetFromVgroup
(
SVgObj
*
pVgroup
);
SRpc
IpSet
mnodeGetI
pSetFromIp
(
char
*
ep
);
SRpc
EpSet
mnodeGetE
pSetFromIp
(
char
*
ep
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/mnode/src/mnodeBalance.c
浏览文件 @
1e21eaff
...
@@ -39,11 +39,11 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) {
...
@@ -39,11 +39,11 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) {
pIter
=
mnodeGetNextDnode
(
pIter
,
&
pDnode
);
pIter
=
mnodeGetNextDnode
(
pIter
,
&
pDnode
);
if
(
pDnode
==
NULL
)
break
;
if
(
pDnode
==
NULL
)
break
;
if
(
pDnode
->
totalVnodes
>
0
&&
pDnode
->
openVnodes
<
pDnode
->
totalVnodes
)
{
if
(
pDnode
->
numOfCores
>
0
&&
pDnode
->
openVnodes
<
TSDB_MAX_VNODES
)
{
float
openVnodes
=
pDnode
->
openVnodes
;
float
openVnodes
=
pDnode
->
openVnodes
;
if
(
pDnode
->
isMgmt
)
openVnodes
+=
tsMnodeEqualVnodeNum
;
if
(
pDnode
->
isMgmt
)
openVnodes
+=
tsMnodeEqualVnodeNum
;
float
usage
=
openVnodes
/
pDnode
->
totalVnod
es
;
float
usage
=
openVnodes
/
pDnode
->
numOfCor
es
;
if
(
usage
<=
vnodeUsage
)
{
if
(
usage
<=
vnodeUsage
)
{
pSelDnode
=
pDnode
;
pSelDnode
=
pDnode
;
vnodeUsage
=
usage
;
vnodeUsage
=
usage
;
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
1e21eaff
...
@@ -289,14 +289,14 @@ static int32_t mnodeProcessCfgDnodeMsg(SMnodeMsg *pMsg) {
...
@@ -289,14 +289,14 @@ static int32_t mnodeProcessCfgDnodeMsg(SMnodeMsg *pMsg) {
}
}
}
}
SRpc
IpSet
ipSet
=
mnodeGetI
pSetFromIp
(
pCmCfgDnode
->
ep
);
SRpc
EpSet
epSet
=
mnodeGetE
pSetFromIp
(
pCmCfgDnode
->
ep
);
if
(
dnodeId
!=
0
)
{
if
(
dnodeId
!=
0
)
{
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
dnodeId
);
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
dnodeId
);
if
(
pDnode
==
NULL
)
{
if
(
pDnode
==
NULL
)
{
mError
(
"failed to cfg dnode, invalid dnodeId:%d"
,
dnodeId
);
mError
(
"failed to cfg dnode, invalid dnodeId:%d"
,
dnodeId
);
return
TSDB_CODE_MND_DNODE_NOT_EXIST
;
return
TSDB_CODE_MND_DNODE_NOT_EXIST
;
}
}
ipSet
=
mnodeGetI
pSetFromIp
(
pDnode
->
dnodeEp
);
epSet
=
mnodeGetE
pSetFromIp
(
pDnode
->
dnodeEp
);
mnodeDecDnodeRef
(
pDnode
);
mnodeDecDnodeRef
(
pDnode
);
}
}
...
@@ -313,7 +313,7 @@ static int32_t mnodeProcessCfgDnodeMsg(SMnodeMsg *pMsg) {
...
@@ -313,7 +313,7 @@ static int32_t mnodeProcessCfgDnodeMsg(SMnodeMsg *pMsg) {
};
};
mInfo
(
"dnode:%s, is configured by %s"
,
pCmCfgDnode
->
ep
,
pMsg
->
pUser
->
user
);
mInfo
(
"dnode:%s, is configured by %s"
,
pCmCfgDnode
->
ep
,
pMsg
->
pUser
->
user
);
dnodeSendMsgToDnode
(
&
i
pSet
,
&
rpcMdCfgDnodeMsg
);
dnodeSendMsgToDnode
(
&
e
pSet
,
&
rpcMdCfgDnodeMsg
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -345,8 +345,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
...
@@ -345,8 +345,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
pStatus
->
moduleStatus
=
htonl
(
pStatus
->
moduleStatus
);
pStatus
->
moduleStatus
=
htonl
(
pStatus
->
moduleStatus
);
pStatus
->
lastReboot
=
htonl
(
pStatus
->
lastReboot
);
pStatus
->
lastReboot
=
htonl
(
pStatus
->
lastReboot
);
pStatus
->
numOfCores
=
htons
(
pStatus
->
numOfCores
);
pStatus
->
numOfCores
=
htons
(
pStatus
->
numOfCores
);
pStatus
->
numOfTotalVnodes
=
htons
(
pStatus
->
numOfTotalVnodes
);
uint32_t
version
=
htonl
(
pStatus
->
version
);
uint32_t
version
=
htonl
(
pStatus
->
version
);
if
(
version
!=
tsVersion
)
{
if
(
version
!=
tsVersion
)
{
mError
(
"status msg version:%d not equal with mnode:%d"
,
version
,
tsVersion
);
mError
(
"status msg version:%d not equal with mnode:%d"
,
version
,
tsVersion
);
...
@@ -372,7 +371,6 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
...
@@ -372,7 +371,6 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
pDnode
->
numOfCores
=
pStatus
->
numOfCores
;
pDnode
->
numOfCores
=
pStatus
->
numOfCores
;
pDnode
->
diskAvailable
=
pStatus
->
diskAvailable
;
pDnode
->
diskAvailable
=
pStatus
->
diskAvailable
;
pDnode
->
alternativeRole
=
pStatus
->
alternativeRole
;
pDnode
->
alternativeRole
=
pStatus
->
alternativeRole
;
pDnode
->
totalVnodes
=
pStatus
->
numOfTotalVnodes
;
pDnode
->
moduleStatus
=
pStatus
->
moduleStatus
;
pDnode
->
moduleStatus
=
pStatus
->
moduleStatus
;
if
(
pStatus
->
dnodeId
==
0
)
{
if
(
pStatus
->
dnodeId
==
0
)
{
...
@@ -401,9 +399,9 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
...
@@ -401,9 +399,9 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
pVload
->
vgId
);
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
pVload
->
vgId
);
if
(
pVgroup
==
NULL
)
{
if
(
pVgroup
==
NULL
)
{
SRpc
IpSet
ipSet
=
mnodeGetI
pSetFromIp
(
pDnode
->
dnodeEp
);
SRpc
EpSet
epSet
=
mnodeGetE
pSetFromIp
(
pDnode
->
dnodeEp
);
mInfo
(
"dnode:%d, vgId:%d not exist in mnode, drop it"
,
pDnode
->
dnodeId
,
pVload
->
vgId
);
mInfo
(
"dnode:%d, vgId:%d not exist in mnode, drop it"
,
pDnode
->
dnodeId
,
pVload
->
vgId
);
mnodeSendDropVnodeMsg
(
pVload
->
vgId
,
&
i
pSet
,
NULL
);
mnodeSendDropVnodeMsg
(
pVload
->
vgId
,
&
e
pSet
,
NULL
);
}
else
{
}
else
{
mnodeUpdateVgroupStatus
(
pVgroup
,
pDnode
,
pVload
);
mnodeUpdateVgroupStatus
(
pVgroup
,
pDnode
,
pVload
);
pAccess
->
vgId
=
htonl
(
pVload
->
vgId
);
pAccess
->
vgId
=
htonl
(
pVload
->
vgId
);
...
@@ -452,17 +450,29 @@ static int32_t mnodeCreateDnode(char *ep, SMnodeMsg *pMsg) {
...
@@ -452,17 +450,29 @@ static int32_t mnodeCreateDnode(char *ep, SMnodeMsg *pMsg) {
return
grantCode
;
return
grantCode
;
}
}
char
dnodeEp
[
TSDB_EP_LEN
]
=
{
0
};
tstrncpy
(
dnodeEp
,
ep
,
TSDB_EP_LEN
);
strtrim
(
dnodeEp
);
char
*
temp
=
strchr
(
dnodeEp
,
':'
);
if
(
!
temp
)
{
int
len
=
strlen
(
dnodeEp
);
if
(
dnodeEp
[
len
-
1
]
==
';'
)
dnodeEp
[
len
-
1
]
=
0
;
len
=
strlen
(
dnodeEp
);
snprintf
(
dnodeEp
+
len
,
TSDB_EP_LEN
-
len
,
":%d"
,
tsServerPort
);
}
ep
=
dnodeEp
;
SDnodeObj
*
pDnode
=
mnodeGetDnodeByEp
(
ep
);
SDnodeObj
*
pDnode
=
mnodeGetDnodeByEp
(
ep
);
if
(
pDnode
!=
NULL
)
{
if
(
pDnode
!=
NULL
)
{
mnodeDecDnodeRef
(
pDnode
);
mnodeDecDnodeRef
(
pDnode
);
mError
(
"dnode:%d is alredy exist, %s:%d"
,
pDnode
->
dnodeId
,
pDnode
->
dnodeFqdn
,
pDnode
->
dnodePort
);
mError
(
"dnode:%d is alre
a
dy exist, %s:%d"
,
pDnode
->
dnodeId
,
pDnode
->
dnodeFqdn
,
pDnode
->
dnodePort
);
return
TSDB_CODE_MND_DNODE_ALREADY_EXIST
;
return
TSDB_CODE_MND_DNODE_ALREADY_EXIST
;
}
}
pDnode
=
(
SDnodeObj
*
)
calloc
(
1
,
sizeof
(
SDnodeObj
));
pDnode
=
(
SDnodeObj
*
)
calloc
(
1
,
sizeof
(
SDnodeObj
));
pDnode
->
createdTime
=
taosGetTimestampMs
();
pDnode
->
createdTime
=
taosGetTimestampMs
();
pDnode
->
status
=
TAOS_DN_STATUS_OFFLINE
;
pDnode
->
status
=
TAOS_DN_STATUS_OFFLINE
;
pDnode
->
totalVnodes
=
TSDB_INVALID_VNODE_NUM
;
tstrncpy
(
pDnode
->
dnodeEp
,
ep
,
TSDB_EP_LEN
);
tstrncpy
(
pDnode
->
dnodeEp
,
ep
,
TSDB_EP_LEN
);
taosGetFqdnPortFromEp
(
ep
,
pDnode
->
dnodeFqdn
,
&
pDnode
->
dnodePort
);
taosGetFqdnPortFromEp
(
ep
,
pDnode
->
dnodeFqdn
,
&
pDnode
->
dnodePort
);
...
@@ -507,8 +517,12 @@ int32_t mnodeDropDnode(SDnodeObj *pDnode, void *pMsg) {
...
@@ -507,8 +517,12 @@ int32_t mnodeDropDnode(SDnodeObj *pDnode, void *pMsg) {
static
int32_t
mnodeDropDnodeByEp
(
char
*
ep
,
SMnodeMsg
*
pMsg
)
{
static
int32_t
mnodeDropDnodeByEp
(
char
*
ep
,
SMnodeMsg
*
pMsg
)
{
SDnodeObj
*
pDnode
=
mnodeGetDnodeByEp
(
ep
);
SDnodeObj
*
pDnode
=
mnodeGetDnodeByEp
(
ep
);
if
(
pDnode
==
NULL
)
{
if
(
pDnode
==
NULL
)
{
mError
(
"dnode:%s, is not exist"
,
ep
);
int32_t
dnodeId
=
(
int32_t
)
strtol
(
ep
,
NULL
,
10
);
return
TSDB_CODE_MND_DNODE_NOT_EXIST
;
pDnode
=
mnodeGetDnode
(
dnodeId
);
if
(
pDnode
==
NULL
)
{
mError
(
"dnode:%s, is not exist"
,
ep
);
return
TSDB_CODE_MND_DNODE_NOT_EXIST
;
}
}
}
if
(
strcmp
(
pDnode
->
dnodeEp
,
mnodeGetMnodeMasterEp
())
==
0
)
{
if
(
strcmp
(
pDnode
->
dnodeEp
,
mnodeGetMnodeMasterEp
())
==
0
)
{
...
@@ -575,13 +589,13 @@ static int32_t mnodeGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
...
@@ -575,13 +589,13 @@ static int32_t mnodeGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
pShow
->
bytes
[
cols
]
=
2
;
pShow
->
bytes
[
cols
]
=
2
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
strcpy
(
pSchema
[
cols
].
name
,
"
open_
vnodes"
);
strcpy
(
pSchema
[
cols
].
name
,
"vnodes"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
cols
++
;
pShow
->
bytes
[
cols
]
=
2
;
pShow
->
bytes
[
cols
]
=
2
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
strcpy
(
pSchema
[
cols
].
name
,
"
total_vnod
es"
);
strcpy
(
pSchema
[
cols
].
name
,
"
cor
es"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
cols
++
;
...
@@ -593,7 +607,7 @@ static int32_t mnodeGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
...
@@ -593,7 +607,7 @@ static int32_t mnodeGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
pShow
->
bytes
[
cols
]
=
6
+
VARSTR_HEADER_SIZE
;
pShow
->
bytes
[
cols
]
=
6
+
VARSTR_HEADER_SIZE
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_BINARY
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_BINARY
;
strcpy
(
pSchema
[
cols
].
name
,
"
alternativeR
ole"
);
strcpy
(
pSchema
[
cols
].
name
,
"
r
ole"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
cols
++
;
...
@@ -645,7 +659,7 @@ static int32_t mnodeRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, vo
...
@@ -645,7 +659,7 @@ static int32_t mnodeRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, vo
cols
++
;
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
*
(
int16_t
*
)
pWrite
=
pDnode
->
totalVnod
es
;
*
(
int16_t
*
)
pWrite
=
pDnode
->
numOfCor
es
;
cols
++
;
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
...
...
src/mnode/src/mnodeMnode.c
浏览文件 @
1e21eaff
...
@@ -35,8 +35,8 @@
...
@@ -35,8 +35,8 @@
static
void
*
tsMnodeSdb
=
NULL
;
static
void
*
tsMnodeSdb
=
NULL
;
static
int32_t
tsMnodeUpdateSize
=
0
;
static
int32_t
tsMnodeUpdateSize
=
0
;
static
SRpc
IpSet
tsMnodeI
pSetForShell
;
static
SRpc
EpSet
tsMnodeE
pSetForShell
;
static
SRpc
IpSet
tsMnodeI
pSetForPeer
;
static
SRpc
EpSet
tsMnodeE
pSetForPeer
;
static
SDMMnodeInfos
tsMnodeInfos
;
static
SDMMnodeInfos
tsMnodeInfos
;
static
int32_t
mnodeGetMnodeMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mnodeGetMnodeMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mnodeRetrieveMnodes
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
int32_t
mnodeRetrieveMnodes
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
...
@@ -123,7 +123,7 @@ static int32_t mnodeMnodeActionRestored() {
...
@@ -123,7 +123,7 @@ static int32_t mnodeMnodeActionRestored() {
sdbFreeIter
(
pIter
);
sdbFreeIter
(
pIter
);
}
}
mnodeUpdateMnode
I
pSet
();
mnodeUpdateMnode
E
pSet
();
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -204,13 +204,13 @@ char *mnodeGetMnodeRoleStr(int32_t role) {
...
@@ -204,13 +204,13 @@ char *mnodeGetMnodeRoleStr(int32_t role) {
}
}
}
}
void
mnodeUpdateMnode
I
pSet
()
{
void
mnodeUpdateMnode
E
pSet
()
{
mInfo
(
"update mnodes
ipset, numOfI
ps:%d "
,
mnodeGetMnodesNum
());
mInfo
(
"update mnodes
epSet, numOfE
ps:%d "
,
mnodeGetMnodesNum
());
mnodeMnodeWrLock
();
mnodeMnodeWrLock
();
memset
(
&
tsMnode
IpSetForShell
,
0
,
sizeof
(
SRpcI
pSet
));
memset
(
&
tsMnode
EpSetForShell
,
0
,
sizeof
(
SRpcE
pSet
));
memset
(
&
tsMnode
IpSetForPeer
,
0
,
sizeof
(
SRpcI
pSet
));
memset
(
&
tsMnode
EpSetForPeer
,
0
,
sizeof
(
SRpcE
pSet
));
memset
(
&
tsMnodeInfos
,
0
,
sizeof
(
SDMMnodeInfos
));
memset
(
&
tsMnodeInfos
,
0
,
sizeof
(
SDMMnodeInfos
));
int32_t
index
=
0
;
int32_t
index
=
0
;
...
@@ -222,20 +222,20 @@ void mnodeUpdateMnodeIpSet() {
...
@@ -222,20 +222,20 @@ void mnodeUpdateMnodeIpSet() {
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
pMnode
->
mnodeId
);
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
pMnode
->
mnodeId
);
if
(
pDnode
!=
NULL
)
{
if
(
pDnode
!=
NULL
)
{
strcpy
(
tsMnode
I
pSetForShell
.
fqdn
[
index
],
pDnode
->
dnodeFqdn
);
strcpy
(
tsMnode
E
pSetForShell
.
fqdn
[
index
],
pDnode
->
dnodeFqdn
);
tsMnode
I
pSetForShell
.
port
[
index
]
=
htons
(
pDnode
->
dnodePort
);
tsMnode
E
pSetForShell
.
port
[
index
]
=
htons
(
pDnode
->
dnodePort
);
mDebug
(
"mnode:%d, for shell fqdn:%s %d"
,
pDnode
->
dnodeId
,
tsMnode
IpSetForShell
.
fqdn
[
index
],
htons
(
tsMnodeI
pSetForShell
.
port
[
index
]));
mDebug
(
"mnode:%d, for shell fqdn:%s %d"
,
pDnode
->
dnodeId
,
tsMnode
EpSetForShell
.
fqdn
[
index
],
htons
(
tsMnodeE
pSetForShell
.
port
[
index
]));
strcpy
(
tsMnode
I
pSetForPeer
.
fqdn
[
index
],
pDnode
->
dnodeFqdn
);
strcpy
(
tsMnode
E
pSetForPeer
.
fqdn
[
index
],
pDnode
->
dnodeFqdn
);
tsMnode
I
pSetForPeer
.
port
[
index
]
=
htons
(
pDnode
->
dnodePort
+
TSDB_PORT_DNODEDNODE
);
tsMnode
E
pSetForPeer
.
port
[
index
]
=
htons
(
pDnode
->
dnodePort
+
TSDB_PORT_DNODEDNODE
);
mDebug
(
"mnode:%d, for peer fqdn:%s %d"
,
pDnode
->
dnodeId
,
tsMnode
IpSetForPeer
.
fqdn
[
index
],
htons
(
tsMnodeI
pSetForPeer
.
port
[
index
]));
mDebug
(
"mnode:%d, for peer fqdn:%s %d"
,
pDnode
->
dnodeId
,
tsMnode
EpSetForPeer
.
fqdn
[
index
],
htons
(
tsMnodeE
pSetForPeer
.
port
[
index
]));
tsMnodeInfos
.
nodeInfos
[
index
].
nodeId
=
htonl
(
pMnode
->
mnodeId
);
tsMnodeInfos
.
nodeInfos
[
index
].
nodeId
=
htonl
(
pMnode
->
mnodeId
);
strcpy
(
tsMnodeInfos
.
nodeInfos
[
index
].
nodeEp
,
pDnode
->
dnodeEp
);
strcpy
(
tsMnodeInfos
.
nodeInfos
[
index
].
nodeEp
,
pDnode
->
dnodeEp
);
if
(
pMnode
->
role
==
TAOS_SYNC_ROLE_MASTER
)
{
if
(
pMnode
->
role
==
TAOS_SYNC_ROLE_MASTER
)
{
tsMnode
I
pSetForShell
.
inUse
=
index
;
tsMnode
E
pSetForShell
.
inUse
=
index
;
tsMnode
I
pSetForPeer
.
inUse
=
index
;
tsMnode
E
pSetForPeer
.
inUse
=
index
;
tsMnodeInfos
.
inUse
=
index
;
tsMnodeInfos
.
inUse
=
index
;
}
}
...
@@ -248,23 +248,23 @@ void mnodeUpdateMnodeIpSet() {
...
@@ -248,23 +248,23 @@ void mnodeUpdateMnodeIpSet() {
}
}
tsMnodeInfos
.
nodeNum
=
index
;
tsMnodeInfos
.
nodeNum
=
index
;
tsMnode
IpSetForShell
.
numOfI
ps
=
index
;
tsMnode
EpSetForShell
.
numOfE
ps
=
index
;
tsMnode
IpSetForPeer
.
numOfI
ps
=
index
;
tsMnode
EpSetForPeer
.
numOfE
ps
=
index
;
sdbFreeIter
(
pIter
);
sdbFreeIter
(
pIter
);
mnodeMnodeUnLock
();
mnodeMnodeUnLock
();
}
}
void
mnodeGetMnode
IpSetForPeer
(
SRpcIpSet
*
i
pSet
)
{
void
mnodeGetMnode
EpSetForPeer
(
SRpcEpSet
*
e
pSet
)
{
mnodeMnodeRdLock
();
mnodeMnodeRdLock
();
*
ipSet
=
tsMnodeI
pSetForPeer
;
*
epSet
=
tsMnodeE
pSetForPeer
;
mnodeMnodeUnLock
();
mnodeMnodeUnLock
();
}
}
void
mnodeGetMnode
IpSetForShell
(
SRpcIpSet
*
i
pSet
)
{
void
mnodeGetMnode
EpSetForShell
(
SRpcEpSet
*
e
pSet
)
{
mnodeMnodeRdLock
();
mnodeMnodeRdLock
();
*
ipSet
=
tsMnodeI
pSetForShell
;
*
epSet
=
tsMnodeE
pSetForShell
;
mnodeMnodeUnLock
();
mnodeMnodeUnLock
();
}
}
...
@@ -295,7 +295,7 @@ int32_t mnodeAddMnode(int32_t dnodeId) {
...
@@ -295,7 +295,7 @@ int32_t mnodeAddMnode(int32_t dnodeId) {
code
=
TSDB_CODE_MND_SDB_ERROR
;
code
=
TSDB_CODE_MND_SDB_ERROR
;
}
}
mnodeUpdateMnode
I
pSet
();
mnodeUpdateMnode
E
pSet
();
return
code
;
return
code
;
}
}
...
@@ -308,7 +308,7 @@ void mnodeDropMnodeLocal(int32_t dnodeId) {
...
@@ -308,7 +308,7 @@ void mnodeDropMnodeLocal(int32_t dnodeId) {
mnodeDecMnodeRef
(
pMnode
);
mnodeDecMnodeRef
(
pMnode
);
}
}
mnodeUpdateMnode
I
pSet
();
mnodeUpdateMnode
E
pSet
();
}
}
int32_t
mnodeDropMnode
(
int32_t
dnodeId
)
{
int32_t
mnodeDropMnode
(
int32_t
dnodeId
)
{
...
@@ -330,7 +330,7 @@ int32_t mnodeDropMnode(int32_t dnodeId) {
...
@@ -330,7 +330,7 @@ int32_t mnodeDropMnode(int32_t dnodeId) {
sdbDecRef
(
tsMnodeSdb
,
pMnode
);
sdbDecRef
(
tsMnodeSdb
,
pMnode
);
mnodeUpdateMnode
I
pSet
();
mnodeUpdateMnode
E
pSet
();
return
code
;
return
code
;
}
}
...
...
src/mnode/src/mnodePeer.c
浏览文件 @
1e21eaff
...
@@ -53,14 +53,14 @@ int32_t mnodeProcessPeerReq(SMnodeMsg *pMsg) {
...
@@ -53,14 +53,14 @@ int32_t mnodeProcessPeerReq(SMnodeMsg *pMsg) {
if
(
!
sdbIsMaster
())
{
if
(
!
sdbIsMaster
())
{
SMnodeRsp
*
rpcRsp
=
&
pMsg
->
rpcRsp
;
SMnodeRsp
*
rpcRsp
=
&
pMsg
->
rpcRsp
;
SRpc
IpSet
*
ipSet
=
rpcMallocCont
(
sizeof
(
SRpcI
pSet
));
SRpc
EpSet
*
epSet
=
rpcMallocCont
(
sizeof
(
SRpcE
pSet
));
mnodeGetMnode
IpSetForPeer
(
i
pSet
);
mnodeGetMnode
EpSetForPeer
(
e
pSet
);
rpcRsp
->
rsp
=
i
pSet
;
rpcRsp
->
rsp
=
e
pSet
;
rpcRsp
->
len
=
sizeof
(
SRpc
I
pSet
);
rpcRsp
->
len
=
sizeof
(
SRpc
E
pSet
);
mDebug
(
"%p, msg:%s in mpeer queue, will be redireced inUse:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
i
pSet
->
inUse
);
mDebug
(
"%p, msg:%s in mpeer queue, will be redireced inUse:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
e
pSet
->
inUse
);
for
(
int32_t
i
=
0
;
i
<
ipSet
->
numOfI
ps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
epSet
->
numOfE
ps
;
++
i
)
{
mDebug
(
"mnode index:%d
ip:%s:%d"
,
i
,
ipSet
->
fqdn
[
i
],
htons
(
i
pSet
->
port
[
i
]));
mDebug
(
"mnode index:%d
ep:%s:%d"
,
i
,
epSet
->
fqdn
[
i
],
htons
(
e
pSet
->
port
[
i
]));
}
}
return
TSDB_CODE_RPC_REDIRECT
;
return
TSDB_CODE_RPC_REDIRECT
;
...
...
src/mnode/src/mnodeRead.c
浏览文件 @
1e21eaff
...
@@ -49,14 +49,14 @@ int32_t mnodeProcessRead(SMnodeMsg *pMsg) {
...
@@ -49,14 +49,14 @@ int32_t mnodeProcessRead(SMnodeMsg *pMsg) {
if
(
!
sdbIsMaster
())
{
if
(
!
sdbIsMaster
())
{
SMnodeRsp
*
rpcRsp
=
&
pMsg
->
rpcRsp
;
SMnodeRsp
*
rpcRsp
=
&
pMsg
->
rpcRsp
;
SRpc
IpSet
*
ipSet
=
rpcMallocCont
(
sizeof
(
SRpcI
pSet
));
SRpc
EpSet
*
epSet
=
rpcMallocCont
(
sizeof
(
SRpcE
pSet
));
mnodeGetMnode
IpSetForShell
(
i
pSet
);
mnodeGetMnode
EpSetForShell
(
e
pSet
);
rpcRsp
->
rsp
=
i
pSet
;
rpcRsp
->
rsp
=
e
pSet
;
rpcRsp
->
len
=
sizeof
(
SRpc
I
pSet
);
rpcRsp
->
len
=
sizeof
(
SRpc
E
pSet
);
mDebug
(
"%p, msg:%s in mread queue, will be redireced, inUse:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
i
pSet
->
inUse
);
mDebug
(
"%p, msg:%s in mread queue, will be redireced, inUse:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
e
pSet
->
inUse
);
for
(
int32_t
i
=
0
;
i
<
ipSet
->
numOfI
ps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
epSet
->
numOfE
ps
;
++
i
)
{
mDebug
(
"mnode index:%d
ip:%s:%d"
,
i
,
ipSet
->
fqdn
[
i
],
htons
(
i
pSet
->
port
[
i
]));
mDebug
(
"mnode index:%d
ep:%s:%d"
,
i
,
epSet
->
fqdn
[
i
],
htons
(
e
pSet
->
port
[
i
]));
}
}
return
TSDB_CODE_RPC_REDIRECT
;
return
TSDB_CODE_RPC_REDIRECT
;
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
1e21eaff
...
@@ -77,11 +77,6 @@ typedef struct {
...
@@ -77,11 +77,6 @@ typedef struct {
pthread_mutex_t
mutex
;
pthread_mutex_t
mutex
;
}
SSdbObject
;
}
SSdbObject
;
typedef
struct
{
int32_t
rowSize
;
void
*
row
;
}
SSdbRow
;
typedef
struct
{
typedef
struct
{
pthread_t
thread
;
pthread_t
thread
;
int32_t
workerId
;
int32_t
workerId
;
...
@@ -219,7 +214,7 @@ void sdbUpdateMnodeRoles() {
...
@@ -219,7 +214,7 @@ void sdbUpdateMnodeRoles() {
}
}
}
}
mnodeUpdateMnode
I
pSet
();
mnodeUpdateMnode
E
pSet
();
}
}
static
uint32_t
sdbGetFileInfo
(
void
*
ahandle
,
char
*
name
,
uint32_t
*
index
,
uint32_t
eindex
,
int32_t
*
size
,
uint64_t
*
fversion
)
{
static
uint32_t
sdbGetFileInfo
(
void
*
ahandle
,
char
*
name
,
uint32_t
*
index
,
uint32_t
eindex
,
int32_t
*
size
,
uint64_t
*
fversion
)
{
...
@@ -419,32 +414,28 @@ void sdbDecRef(void *handle, void *pObj) {
...
@@ -419,32 +414,28 @@ void sdbDecRef(void *handle, void *pObj) {
}
}
}
}
static
SSdbRow
*
sdbGetRowMeta
(
SSdbTable
*
pTable
,
void
*
key
)
{
static
void
*
sdbGetRowMeta
(
SSdbTable
*
pTable
,
void
*
key
)
{
if
(
pTable
==
NULL
)
return
NULL
;
if
(
pTable
==
NULL
)
return
NULL
;
int32_t
keySize
=
sizeof
(
int32_t
);
int32_t
keySize
=
sizeof
(
int32_t
);
if
(
pTable
->
keyType
==
SDB_KEY_STRING
||
pTable
->
keyType
==
SDB_KEY_VAR_STRING
)
{
if
(
pTable
->
keyType
==
SDB_KEY_STRING
||
pTable
->
keyType
==
SDB_KEY_VAR_STRING
)
{
keySize
=
strlen
((
char
*
)
key
);
keySize
=
strlen
((
char
*
)
key
);
}
}
return
taosHashGet
(
pTable
->
iHandle
,
key
,
keySize
);
void
**
ppRow
=
(
void
**
)
taosHashGet
(
pTable
->
iHandle
,
key
,
keySize
);
if
(
ppRow
==
NULL
)
return
NULL
;
return
*
ppRow
;
}
}
static
SSdbRow
*
sdbGetRowMetaFromObj
(
SSdbTable
*
pTable
,
void
*
key
)
{
static
void
*
sdbGetRowMetaFromObj
(
SSdbTable
*
pTable
,
void
*
key
)
{
return
sdbGetRowMeta
(
pTable
,
sdbGetObjKey
(
pTable
,
key
));
return
sdbGetRowMeta
(
pTable
,
sdbGetObjKey
(
pTable
,
key
));
}
}
void
*
sdbGetRow
(
void
*
handle
,
void
*
key
)
{
void
*
sdbGetRow
(
void
*
handle
,
void
*
key
)
{
SSdbTable
*
pTable
=
(
SSdbTable
*
)
handle
;
void
*
pRow
=
sdbGetRowMeta
(
handle
,
key
);
int32_t
keySize
=
sizeof
(
int32_t
);
if
(
pRow
)
{
if
(
pTable
->
keyType
==
SDB_KEY_STRING
||
pTable
->
keyType
==
SDB_KEY_VAR_STRING
)
{
sdbIncRef
(
handle
,
pRow
);
keySize
=
strlen
((
char
*
)
key
);
return
pRow
;
}
SSdbRow
*
pMeta
=
taosHashGet
(
pTable
->
iHandle
,
key
,
keySize
);
if
(
pMeta
)
{
sdbIncRef
(
pTable
,
pMeta
->
row
);
return
pMeta
->
row
;
}
else
{
}
else
{
return
NULL
;
return
NULL
;
}
}
...
@@ -455,10 +446,6 @@ static void *sdbGetRowFromObj(SSdbTable *pTable, void *key) {
...
@@ -455,10 +446,6 @@ static void *sdbGetRowFromObj(SSdbTable *pTable, void *key) {
}
}
static
int32_t
sdbInsertHash
(
SSdbTable
*
pTable
,
SSdbOper
*
pOper
)
{
static
int32_t
sdbInsertHash
(
SSdbTable
*
pTable
,
SSdbOper
*
pOper
)
{
SSdbRow
rowMeta
;
rowMeta
.
rowSize
=
pOper
->
rowSize
;
rowMeta
.
row
=
pOper
->
pObj
;
void
*
key
=
sdbGetObjKey
(
pTable
,
pOper
->
pObj
);
void
*
key
=
sdbGetObjKey
(
pTable
,
pOper
->
pObj
);
int32_t
keySize
=
sizeof
(
int32_t
);
int32_t
keySize
=
sizeof
(
int32_t
);
...
@@ -466,7 +453,7 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) {
...
@@ -466,7 +453,7 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) {
keySize
=
strlen
((
char
*
)
key
);
keySize
=
strlen
((
char
*
)
key
);
}
}
taosHashPut
(
pTable
->
iHandle
,
key
,
keySize
,
&
rowMeta
,
sizeof
(
SSdbRow
));
taosHashPut
(
pTable
->
iHandle
,
key
,
keySize
,
&
pOper
->
pObj
,
sizeof
(
void
**
));
sdbIncRef
(
pTable
,
pOper
->
pObj
);
sdbIncRef
(
pTable
,
pOper
->
pObj
);
atomic_add_fetch_32
(
&
pTable
->
numOfRows
,
1
);
atomic_add_fetch_32
(
&
pTable
->
numOfRows
,
1
);
...
@@ -586,17 +573,17 @@ static int sdbWrite(void *param, void *data, int type) {
...
@@ -586,17 +573,17 @@ static int sdbWrite(void *param, void *data, int type) {
code
=
(
*
pTable
->
decodeFp
)(
&
oper
);
code
=
(
*
pTable
->
decodeFp
)(
&
oper
);
return
sdbInsertHash
(
pTable
,
&
oper
);
return
sdbInsertHash
(
pTable
,
&
oper
);
}
else
if
(
action
==
SDB_ACTION_DELETE
)
{
}
else
if
(
action
==
SDB_ACTION_DELETE
)
{
SSdbRow
*
rowMeta
=
sdbGetRowMeta
(
pTable
,
pHead
->
cont
);
void
*
pRow
=
sdbGetRowMeta
(
pTable
,
pHead
->
cont
);
if
(
rowMeta
==
NULL
||
rowMeta
->
r
ow
==
NULL
)
{
if
(
pR
ow
==
NULL
)
{
sdbError
(
"table:%s, failed to get object:%s from wal while dispose delete action"
,
pTable
->
tableName
,
sdbError
(
"table:%s, failed to get object:%s from wal while dispose delete action"
,
pTable
->
tableName
,
pHead
->
cont
);
pHead
->
cont
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
SSdbOper
oper
=
{.
table
=
pTable
,
.
pObj
=
rowMeta
->
r
ow
};
SSdbOper
oper
=
{.
table
=
pTable
,
.
pObj
=
pR
ow
};
return
sdbDeleteHash
(
pTable
,
&
oper
);
return
sdbDeleteHash
(
pTable
,
&
oper
);
}
else
if
(
action
==
SDB_ACTION_UPDATE
)
{
}
else
if
(
action
==
SDB_ACTION_UPDATE
)
{
SSdbRow
*
rowMeta
=
sdbGetRowMeta
(
pTable
,
pHead
->
cont
);
void
*
pRow
=
sdbGetRowMeta
(
pTable
,
pHead
->
cont
);
if
(
rowMeta
==
NULL
||
rowMeta
->
r
ow
==
NULL
)
{
if
(
pR
ow
==
NULL
)
{
sdbError
(
"table:%s, failed to get object:%s from wal while dispose update action"
,
pTable
->
tableName
,
sdbError
(
"table:%s, failed to get object:%s from wal while dispose update action"
,
pTable
->
tableName
,
pHead
->
cont
);
pHead
->
cont
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -675,18 +662,12 @@ int32_t sdbDeleteRow(SSdbOper *pOper) {
...
@@ -675,18 +662,12 @@ int32_t sdbDeleteRow(SSdbOper *pOper) {
SSdbTable
*
pTable
=
(
SSdbTable
*
)
pOper
->
table
;
SSdbTable
*
pTable
=
(
SSdbTable
*
)
pOper
->
table
;
if
(
pTable
==
NULL
)
return
TSDB_CODE_MND_SDB_INVALID_TABLE_TYPE
;
if
(
pTable
==
NULL
)
return
TSDB_CODE_MND_SDB_INVALID_TABLE_TYPE
;
SSdbRow
*
pMeta
=
sdbGetRowMetaFromObj
(
pTable
,
pOper
->
pObj
);
void
*
pRow
=
sdbGetRowMetaFromObj
(
pTable
,
pOper
->
pObj
);
if
(
p
Meta
==
NULL
)
{
if
(
p
Row
==
NULL
)
{
sdbDebug
(
"table:%s, record is not there, delete failed"
,
pTable
->
tableName
);
sdbDebug
(
"table:%s, record is not there, delete failed"
,
pTable
->
tableName
);
return
TSDB_CODE_MND_SDB_OBJ_NOT_THERE
;
return
TSDB_CODE_MND_SDB_OBJ_NOT_THERE
;
}
}
void
*
pMetaRow
=
pMeta
->
row
;
if
(
pMetaRow
==
NULL
)
{
sdbError
(
"table:%s, record meta is null"
,
pTable
->
tableName
);
return
TSDB_CODE_MND_SDB_INVAID_META_ROW
;
}
sdbIncRef
(
pTable
,
pOper
->
pObj
);
sdbIncRef
(
pTable
,
pOper
->
pObj
);
int32_t
code
=
sdbDeleteHash
(
pTable
,
pOper
);
int32_t
code
=
sdbDeleteHash
(
pTable
,
pOper
);
...
@@ -728,18 +709,12 @@ int32_t sdbUpdateRow(SSdbOper *pOper) {
...
@@ -728,18 +709,12 @@ int32_t sdbUpdateRow(SSdbOper *pOper) {
SSdbTable
*
pTable
=
(
SSdbTable
*
)
pOper
->
table
;
SSdbTable
*
pTable
=
(
SSdbTable
*
)
pOper
->
table
;
if
(
pTable
==
NULL
)
return
TSDB_CODE_MND_SDB_INVALID_TABLE_TYPE
;
if
(
pTable
==
NULL
)
return
TSDB_CODE_MND_SDB_INVALID_TABLE_TYPE
;
SSdbRow
*
pMeta
=
sdbGetRowMetaFromObj
(
pTable
,
pOper
->
pObj
);
void
*
pRow
=
sdbGetRowMetaFromObj
(
pTable
,
pOper
->
pObj
);
if
(
p
Meta
==
NULL
)
{
if
(
p
Row
==
NULL
)
{
sdbDebug
(
"table:%s, record is not there, update failed"
,
pTable
->
tableName
);
sdbDebug
(
"table:%s, record is not there, update failed"
,
pTable
->
tableName
);
return
TSDB_CODE_MND_SDB_OBJ_NOT_THERE
;
return
TSDB_CODE_MND_SDB_OBJ_NOT_THERE
;
}
}
void
*
pMetaRow
=
pMeta
->
row
;
if
(
pMetaRow
==
NULL
)
{
sdbError
(
"table:%s, record meta is null"
,
pTable
->
tableName
);
return
TSDB_CODE_MND_SDB_INVAID_META_ROW
;
}
int32_t
code
=
sdbUpdateHash
(
pTable
,
pOper
);
int32_t
code
=
sdbUpdateHash
(
pTable
,
pOper
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
sdbError
(
"table:%s, failed to update hash"
,
pTable
->
tableName
);
sdbError
(
"table:%s, failed to update hash"
,
pTable
->
tableName
);
...
@@ -789,14 +764,14 @@ void *sdbFetchRow(void *handle, void *pNode, void **ppRow) {
...
@@ -789,14 +764,14 @@ void *sdbFetchRow(void *handle, void *pNode, void **ppRow) {
return
NULL
;
return
NULL
;
}
}
SSdbRow
*
pMeta
=
taosHashIterGet
(
pIter
);
void
**
ppMetaRow
=
taosHashIterGet
(
pIter
);
if
(
p
Meta
==
NULL
)
{
if
(
p
pMetaRow
==
NULL
)
{
taosHashDestroyIter
(
pIter
);
taosHashDestroyIter
(
pIter
);
return
NULL
;
return
NULL
;
}
}
*
ppRow
=
pMeta
->
r
ow
;
*
ppRow
=
*
ppMetaR
ow
;
sdbIncRef
(
handle
,
pMeta
->
r
ow
);
sdbIncRef
(
handle
,
*
ppMetaR
ow
);
return
pIter
;
return
pIter
;
}
}
...
@@ -846,11 +821,11 @@ void sdbCloseTable(void *handle) {
...
@@ -846,11 +821,11 @@ void sdbCloseTable(void *handle) {
SHashMutableIterator
*
pIter
=
taosHashCreateIter
(
pTable
->
iHandle
);
SHashMutableIterator
*
pIter
=
taosHashCreateIter
(
pTable
->
iHandle
);
while
(
taosHashIterNext
(
pIter
))
{
while
(
taosHashIterNext
(
pIter
))
{
SSdbRow
*
pMeta
=
taosHashIterGet
(
pIter
);
void
**
ppRow
=
taosHashIterGet
(
pIter
);
if
(
p
Meta
==
NULL
)
continue
;
if
(
p
pRow
==
NULL
)
continue
;
SSdbOper
oper
=
{
SSdbOper
oper
=
{
.
pObj
=
pMeta
->
r
ow
,
.
pObj
=
*
ppR
ow
,
.
table
=
pTable
,
.
table
=
pTable
,
};
};
...
...
src/mnode/src/mnodeShow.c
浏览文件 @
1e21eaff
...
@@ -270,7 +270,7 @@ static int32_t mnodeProcessHeartBeatMsg(SMnodeMsg *pMsg) {
...
@@ -270,7 +270,7 @@ static int32_t mnodeProcessHeartBeatMsg(SMnodeMsg *pMsg) {
pHBRsp
->
onlineDnodes
=
htonl
(
mnodeGetOnlinDnodesNum
());
pHBRsp
->
onlineDnodes
=
htonl
(
mnodeGetOnlinDnodesNum
());
pHBRsp
->
totalDnodes
=
htonl
(
mnodeGetDnodesNum
());
pHBRsp
->
totalDnodes
=
htonl
(
mnodeGetDnodesNum
());
mnodeGetMnode
IpSetForShell
(
&
pHBRsp
->
ipLis
t
);
mnodeGetMnode
EpSetForShell
(
&
pHBRsp
->
epSe
t
);
pMsg
->
rpcRsp
.
rsp
=
pHBRsp
;
pMsg
->
rpcRsp
.
rsp
=
pHBRsp
;
pMsg
->
rpcRsp
.
len
=
sizeof
(
SCMHeartBeatRsp
);
pMsg
->
rpcRsp
.
len
=
sizeof
(
SCMHeartBeatRsp
);
...
@@ -335,7 +335,7 @@ static int32_t mnodeProcessConnectMsg(SMnodeMsg *pMsg) {
...
@@ -335,7 +335,7 @@ static int32_t mnodeProcessConnectMsg(SMnodeMsg *pMsg) {
pConnectRsp
->
writeAuth
=
pUser
->
writeAuth
;
pConnectRsp
->
writeAuth
=
pUser
->
writeAuth
;
pConnectRsp
->
superAuth
=
pUser
->
superAuth
;
pConnectRsp
->
superAuth
=
pUser
->
superAuth
;
mnodeGetMnode
IpSetForShell
(
&
pConnectRsp
->
ipLis
t
);
mnodeGetMnode
EpSetForShell
(
&
pConnectRsp
->
epSe
t
);
connect_over:
connect_over:
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
1e21eaff
...
@@ -107,42 +107,41 @@ static int32_t mnodeChildTableActionInsert(SSdbOper *pOper) {
...
@@ -107,42 +107,41 @@ static int32_t mnodeChildTableActionInsert(SSdbOper *pOper) {
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
pTable
->
vgId
);
SVgObj
*
pVgroup
=
mnodeGetVgroup
(
pTable
->
vgId
);
if
(
pVgroup
==
NULL
)
{
if
(
pVgroup
==
NULL
)
{
mError
(
"ctable:%s, not in vgId:%d"
,
pTable
->
info
.
tableId
,
pTable
->
vgId
);
mError
(
"ctable:%s, not in vgId:%d"
,
pTable
->
info
.
tableId
,
pTable
->
vgId
);
return
TSDB_CODE_MND_VGROUP_NOT_EXIST
;
}
}
mnodeDecVgroupRef
(
pVgroup
);
SDbObj
*
pDb
=
mnodeGetDb
(
pVgroup
->
dbName
);
SDbObj
*
pDb
=
NULL
;
if
(
pDb
==
NULL
)
{
if
(
pVgroup
!=
NULL
)
{
mError
(
"ctable:%s, vgId:%d not in db:%s"
,
pTable
->
info
.
tableId
,
pVgroup
->
vgId
,
pVgroup
->
dbName
);
pDb
=
mnodeGetDb
(
pVgroup
->
dbName
);
return
TSDB_CODE_MND_INVALID_DB
;
if
(
pDb
==
NULL
)
{
}
mError
(
"ctable:%s, vgId:%d not in db:%s"
,
pTable
->
info
.
tableId
,
pVgroup
->
vgId
,
pVgroup
->
dbName
);
}
if
(
pDb
->
status
!=
TSDB_DB_STATUS_READY
)
{
mError
(
"db:%s, status:%d, in dropping"
,
pDb
->
name
,
pDb
->
status
);
return
TSDB_CODE_MND_DB_IN_DROPPING
;
}
}
mnodeDecDbRef
(
pDb
);
SAcctObj
*
pAcct
=
mnodeGetAcct
(
pDb
->
acct
);
SAcctObj
*
pAcct
=
NULL
;
if
(
pAcct
==
NULL
)
{
if
(
pDb
!=
NULL
)
{
mError
(
"ctable:%s, acct:%s not exists"
,
pTable
->
info
.
tableId
,
pDb
->
acct
);
pAcct
=
mnodeGetAcct
(
pDb
->
acct
);
return
TSDB_CODE_MND_INVALID_ACCT
;
if
(
pAcct
==
NULL
)
{
mError
(
"ctable:%s, acct:%s not exists"
,
pTable
->
info
.
tableId
,
pDb
->
acct
);
}
}
}
mnodeDecAcctRef
(
pAcct
);
if
(
pTable
->
info
.
type
==
TSDB_CHILD_TABLE
)
{
if
(
pTable
->
info
.
type
==
TSDB_CHILD_TABLE
)
{
// add ref
// add ref
pTable
->
superTable
=
mnodeGetSuperTableByUid
(
pTable
->
suid
);
pTable
->
superTable
=
mnodeGetSuperTableByUid
(
pTable
->
suid
);
mnodeAddTableIntoStable
(
pTable
->
superTable
,
pTable
);
mnodeAddTableIntoStable
(
pTable
->
superTable
,
pTable
);
grantAdd
(
TSDB_GRANT_TIMESERIES
,
pTable
->
superTable
->
numOfColumns
-
1
);
grantAdd
(
TSDB_GRANT_TIMESERIES
,
pTable
->
superTable
->
numOfColumns
-
1
);
pAcct
->
acctInfo
.
numOfTimeSeries
+=
(
pTable
->
superTable
->
numOfColumns
-
1
);
if
(
pAcct
)
pAcct
->
acctInfo
.
numOfTimeSeries
+=
(
pTable
->
superTable
->
numOfColumns
-
1
);
}
else
{
}
else
{
grantAdd
(
TSDB_GRANT_TIMESERIES
,
pTable
->
numOfColumns
-
1
);
grantAdd
(
TSDB_GRANT_TIMESERIES
,
pTable
->
numOfColumns
-
1
);
pAcct
->
acctInfo
.
numOfTimeSeries
+=
(
pTable
->
numOfColumns
-
1
);
if
(
pAcct
)
pAcct
->
acctInfo
.
numOfTimeSeries
+=
(
pTable
->
numOfColumns
-
1
);
}
}
mnodeAddTableIntoDb
(
pDb
);
if
(
pDb
)
mnodeAddTableIntoDb
(
pDb
);
mnodeAddTableIntoVgroup
(
pVgroup
,
pTable
);
if
(
pVgroup
)
mnodeAddTableIntoVgroup
(
pVgroup
,
pTable
);
mnodeDecVgroupRef
(
pVgroup
);
mnodeDecDbRef
(
pDb
);
mnodeDecAcctRef
(
pAcct
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -910,9 +909,9 @@ static int32_t mnodeProcessDropSuperTableMsg(SMnodeMsg *pMsg) {
...
@@ -910,9 +909,9 @@ static int32_t mnodeProcessDropSuperTableMsg(SMnodeMsg *pMsg) {
mInfo
(
"app:%p:%p, stable:%s, send drop stable msg to vgId:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
mInfo
(
"app:%p:%p, stable:%s, send drop stable msg to vgId:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
pVgroup
->
vgId
);
pVgroup
->
vgId
);
SRpc
IpSet
ipSet
=
mnodeGetI
pSetFromVgroup
(
pVgroup
);
SRpc
EpSet
epSet
=
mnodeGetE
pSetFromVgroup
(
pVgroup
);
SRpcMsg
rpcMsg
=
{.
pCont
=
pDrop
,
.
contLen
=
sizeof
(
SMDDropSTableMsg
),
.
msgType
=
TSDB_MSG_TYPE_MD_DROP_STABLE
};
SRpcMsg
rpcMsg
=
{.
pCont
=
pDrop
,
.
contLen
=
sizeof
(
SMDDropSTableMsg
),
.
msgType
=
TSDB_MSG_TYPE_MD_DROP_STABLE
};
dnodeSendMsgToDnode
(
&
i
pSet
,
&
rpcMsg
);
dnodeSendMsgToDnode
(
&
e
pSet
,
&
rpcMsg
);
mnodeDecVgroupRef
(
pVgroup
);
mnodeDecVgroupRef
(
pVgroup
);
}
}
taosHashDestroyIter
(
pIter
);
taosHashDestroyIter
(
pIter
);
...
@@ -1484,10 +1483,10 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) {
...
@@ -1484,10 +1483,10 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) {
SDnodeObj
*
pDnode
=
pVgroup
->
vnodeGid
[
vn
].
pDnode
;
SDnodeObj
*
pDnode
=
pVgroup
->
vnodeGid
[
vn
].
pDnode
;
if
(
pDnode
==
NULL
)
break
;
if
(
pDnode
==
NULL
)
break
;
tstrncpy
(
pVgroupInfo
->
vgroups
[
vgSize
].
i
pAddr
[
vn
].
fqdn
,
pDnode
->
dnodeFqdn
,
TSDB_FQDN_LEN
);
tstrncpy
(
pVgroupInfo
->
vgroups
[
vgSize
].
e
pAddr
[
vn
].
fqdn
,
pDnode
->
dnodeFqdn
,
TSDB_FQDN_LEN
);
pVgroupInfo
->
vgroups
[
vgSize
].
i
pAddr
[
vn
].
port
=
htons
(
pDnode
->
dnodePort
);
pVgroupInfo
->
vgroups
[
vgSize
].
e
pAddr
[
vn
].
port
=
htons
(
pDnode
->
dnodePort
);
pVgroupInfo
->
vgroups
[
vgSize
].
numOf
I
ps
++
;
pVgroupInfo
->
vgroups
[
vgSize
].
numOf
E
ps
++
;
}
}
vgSize
++
;
vgSize
++
;
...
@@ -1615,7 +1614,7 @@ static int32_t mnodeDoCreateChildTableCb(SMnodeMsg *pMsg, int32_t code) {
...
@@ -1615,7 +1614,7 @@ static int32_t mnodeDoCreateChildTableCb(SMnodeMsg *pMsg, int32_t code) {
return
terrno
;
return
terrno
;
}
}
SRpc
IpSet
ipSet
=
mnodeGetI
pSetFromVgroup
(
pMsg
->
pVgroup
);
SRpc
EpSet
epSet
=
mnodeGetE
pSetFromVgroup
(
pMsg
->
pVgroup
);
SRpcMsg
rpcMsg
=
{
SRpcMsg
rpcMsg
=
{
.
ahandle
=
pMsg
,
.
ahandle
=
pMsg
,
.
pCont
=
pMDCreate
,
.
pCont
=
pMDCreate
,
...
@@ -1624,7 +1623,7 @@ static int32_t mnodeDoCreateChildTableCb(SMnodeMsg *pMsg, int32_t code) {
...
@@ -1624,7 +1623,7 @@ static int32_t mnodeDoCreateChildTableCb(SMnodeMsg *pMsg, int32_t code) {
.
msgType
=
TSDB_MSG_TYPE_MD_CREATE_TABLE
.
msgType
=
TSDB_MSG_TYPE_MD_CREATE_TABLE
};
};
dnodeSendMsgToDnode
(
&
i
pSet
,
&
rpcMsg
);
dnodeSendMsgToDnode
(
&
e
pSet
,
&
rpcMsg
);
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
}
...
@@ -1788,7 +1787,7 @@ static int32_t mnodeProcessDropChildTableMsg(SMnodeMsg *pMsg, bool needReturn) {
...
@@ -1788,7 +1787,7 @@ static int32_t mnodeProcessDropChildTableMsg(SMnodeMsg *pMsg, bool needReturn) {
pDrop
->
sid
=
htonl
(
pTable
->
sid
);
pDrop
->
sid
=
htonl
(
pTable
->
sid
);
pDrop
->
uid
=
htobe64
(
pTable
->
uid
);
pDrop
->
uid
=
htobe64
(
pTable
->
uid
);
SRpc
IpSet
ipSet
=
mnodeGetI
pSetFromVgroup
(
pMsg
->
pVgroup
);
SRpc
EpSet
epSet
=
mnodeGetE
pSetFromVgroup
(
pMsg
->
pVgroup
);
mInfo
(
"app:%p:%p, table:%s, send drop ctable msg, vgId:%d sid:%d uid:%"
PRIu64
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
mInfo
(
"app:%p:%p, table:%s, send drop ctable msg, vgId:%d sid:%d uid:%"
PRIu64
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pDrop
->
tableId
,
pTable
->
vgId
,
pTable
->
sid
,
pTable
->
uid
);
pDrop
->
tableId
,
pTable
->
vgId
,
pTable
->
sid
,
pTable
->
uid
);
...
@@ -1803,7 +1802,7 @@ static int32_t mnodeProcessDropChildTableMsg(SMnodeMsg *pMsg, bool needReturn) {
...
@@ -1803,7 +1802,7 @@ static int32_t mnodeProcessDropChildTableMsg(SMnodeMsg *pMsg, bool needReturn) {
if
(
!
needReturn
)
rpcMsg
.
ahandle
=
NULL
;
if
(
!
needReturn
)
rpcMsg
.
ahandle
=
NULL
;
dnodeSendMsgToDnode
(
&
i
pSet
,
&
rpcMsg
);
dnodeSendMsgToDnode
(
&
e
pSet
,
&
rpcMsg
);
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
}
...
@@ -1842,7 +1841,7 @@ static int32_t mnodeAlterNormalTableColumnCb(SMnodeMsg *pMsg, int32_t code) {
...
@@ -1842,7 +1841,7 @@ static int32_t mnodeAlterNormalTableColumnCb(SMnodeMsg *pMsg, int32_t code) {
}
}
}
}
SRpc
IpSet
ipSet
=
mnodeGetI
pSetFromVgroup
(
pMsg
->
pVgroup
);
SRpc
EpSet
epSet
=
mnodeGetE
pSetFromVgroup
(
pMsg
->
pVgroup
);
SRpcMsg
rpcMsg
=
{
SRpcMsg
rpcMsg
=
{
.
ahandle
=
pMsg
,
.
ahandle
=
pMsg
,
.
pCont
=
pMDCreate
,
.
pCont
=
pMDCreate
,
...
@@ -1854,7 +1853,7 @@ static int32_t mnodeAlterNormalTableColumnCb(SMnodeMsg *pMsg, int32_t code) {
...
@@ -1854,7 +1853,7 @@ static int32_t mnodeAlterNormalTableColumnCb(SMnodeMsg *pMsg, int32_t code) {
mDebug
(
"app:%p:%p, ctable %s, send alter column msg to vgId:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
mDebug
(
"app:%p:%p, ctable %s, send alter column msg to vgId:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
pMsg
->
pVgroup
->
vgId
);
pMsg
->
pVgroup
->
vgId
);
dnodeSendMsgToDnode
(
&
i
pSet
,
&
rpcMsg
);
dnodeSendMsgToDnode
(
&
e
pSet
,
&
rpcMsg
);
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
}
...
@@ -1996,9 +1995,9 @@ static int32_t mnodeDoGetChildTableMeta(SMnodeMsg *pMsg, STableMetaMsg *pMeta) {
...
@@ -1996,9 +1995,9 @@ static int32_t mnodeDoGetChildTableMeta(SMnodeMsg *pMsg, STableMetaMsg *pMeta) {
for
(
int32_t
i
=
0
;
i
<
pMsg
->
pVgroup
->
numOfVnodes
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pMsg
->
pVgroup
->
numOfVnodes
;
++
i
)
{
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
pMsg
->
pVgroup
->
vnodeGid
[
i
].
dnodeId
);
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
pMsg
->
pVgroup
->
vnodeGid
[
i
].
dnodeId
);
if
(
pDnode
==
NULL
)
break
;
if
(
pDnode
==
NULL
)
break
;
strcpy
(
pMeta
->
vgroup
.
i
pAddr
[
i
].
fqdn
,
pDnode
->
dnodeFqdn
);
strcpy
(
pMeta
->
vgroup
.
e
pAddr
[
i
].
fqdn
,
pDnode
->
dnodeFqdn
);
pMeta
->
vgroup
.
i
pAddr
[
i
].
port
=
htons
(
pDnode
->
dnodePort
+
TSDB_PORT_DNODESHELL
);
pMeta
->
vgroup
.
e
pAddr
[
i
].
port
=
htons
(
pDnode
->
dnodePort
+
TSDB_PORT_DNODESHELL
);
pMeta
->
vgroup
.
numOf
I
ps
++
;
pMeta
->
vgroup
.
numOf
E
ps
++
;
mnodeDecDnodeRef
(
pDnode
);
mnodeDecDnodeRef
(
pDnode
);
}
}
pMeta
->
vgroup
.
vgId
=
htonl
(
pMsg
->
pVgroup
->
vgId
);
pMeta
->
vgroup
.
vgId
=
htonl
(
pMsg
->
pVgroup
->
vgId
);
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
1e21eaff
...
@@ -317,9 +317,9 @@ void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVl
...
@@ -317,9 +317,9 @@ void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVl
}
}
if
(
!
dnodeExist
)
{
if
(
!
dnodeExist
)
{
SRpc
IpSet
ipSet
=
mnodeGetI
pSetFromIp
(
pDnode
->
dnodeEp
);
SRpc
EpSet
epSet
=
mnodeGetE
pSetFromIp
(
pDnode
->
dnodeEp
);
mError
(
"vgId:%d, dnode:%d not exist in mnode, drop it"
,
pVload
->
vgId
,
pDnode
->
dnodeId
);
mError
(
"vgId:%d, dnode:%d not exist in mnode, drop it"
,
pVload
->
vgId
,
pDnode
->
dnodeId
);
mnodeSendDropVnodeMsg
(
pVload
->
vgId
,
&
i
pSet
,
NULL
);
mnodeSendDropVnodeMsg
(
pVload
->
vgId
,
&
e
pSet
,
NULL
);
return
;
return
;
}
}
...
@@ -585,9 +585,9 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
...
@@ -585,9 +585,9 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
cols
++
;
pShow
->
bytes
[
cols
]
=
4
;
pShow
->
bytes
[
cols
]
=
12
+
VARSTR_HEADER_SIZE
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_
INT
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_
BINARY
;
strcpy
(
pSchema
[
cols
].
name
,
"
poolSize
"
);
strcpy
(
pSchema
[
cols
].
name
,
"
status
"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
cols
++
;
...
@@ -688,8 +688,9 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v
...
@@ -688,8 +688,9 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v
*
(
int32_t
*
)
pWrite
=
pVgroup
->
numOfTables
;
*
(
int32_t
*
)
pWrite
=
pVgroup
->
numOfTables
;
cols
++
;
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
*
(
int32_t
*
)
pWrite
=
taosIdPoolMaxSize
(
pVgroup
->
idPool
);
char
*
status
=
vgroupStatus
[
pVgroup
->
status
];
STR_TO_VARSTR
(
pWrite
,
status
);
cols
++
;
cols
++
;
int32_t
onlineVnodes
=
0
;
int32_t
onlineVnodes
=
0
;
...
@@ -808,29 +809,29 @@ static SMDCreateVnodeMsg *mnodeBuildVnodeMsg(SVgObj *pVgroup) {
...
@@ -808,29 +809,29 @@ static SMDCreateVnodeMsg *mnodeBuildVnodeMsg(SVgObj *pVgroup) {
return
pVnode
;
return
pVnode
;
}
}
SRpc
IpSet
mnodeGetI
pSetFromVgroup
(
SVgObj
*
pVgroup
)
{
SRpc
EpSet
mnodeGetE
pSetFromVgroup
(
SVgObj
*
pVgroup
)
{
SRpc
IpSet
i
pSet
=
{
SRpc
EpSet
e
pSet
=
{
.
numOf
I
ps
=
pVgroup
->
numOfVnodes
,
.
numOf
E
ps
=
pVgroup
->
numOfVnodes
,
.
inUse
=
0
,
.
inUse
=
0
,
};
};
for
(
int
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
for
(
int
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
strcpy
(
i
pSet
.
fqdn
[
i
],
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeFqdn
);
strcpy
(
e
pSet
.
fqdn
[
i
],
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeFqdn
);
i
pSet
.
port
[
i
]
=
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodePort
+
TSDB_PORT_DNODEDNODE
;
e
pSet
.
port
[
i
]
=
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodePort
+
TSDB_PORT_DNODEDNODE
;
}
}
return
i
pSet
;
return
e
pSet
;
}
}
SRpc
IpSet
mnodeGetI
pSetFromIp
(
char
*
ep
)
{
SRpc
EpSet
mnodeGetE
pSetFromIp
(
char
*
ep
)
{
SRpc
IpSet
i
pSet
;
SRpc
EpSet
e
pSet
;
ipSet
.
numOfI
ps
=
1
;
epSet
.
numOfE
ps
=
1
;
i
pSet
.
inUse
=
0
;
e
pSet
.
inUse
=
0
;
taosGetFqdnPortFromEp
(
ep
,
ipSet
.
fqdn
[
0
],
&
i
pSet
.
port
[
0
]);
taosGetFqdnPortFromEp
(
ep
,
epSet
.
fqdn
[
0
],
&
e
pSet
.
port
[
0
]);
i
pSet
.
port
[
0
]
+=
TSDB_PORT_DNODEDNODE
;
e
pSet
.
port
[
0
]
+=
TSDB_PORT_DNODEDNODE
;
return
i
pSet
;
return
e
pSet
;
}
}
static
void
mnodeSendAlterVnodeMsg
(
SVgObj
*
pVgroup
,
SRpc
IpSet
*
i
pSet
)
{
static
void
mnodeSendAlterVnodeMsg
(
SVgObj
*
pVgroup
,
SRpc
EpSet
*
e
pSet
)
{
SMDAlterVnodeMsg
*
pAlter
=
mnodeBuildVnodeMsg
(
pVgroup
);
SMDAlterVnodeMsg
*
pAlter
=
mnodeBuildVnodeMsg
(
pVgroup
);
SRpcMsg
rpcMsg
=
{
SRpcMsg
rpcMsg
=
{
.
ahandle
=
NULL
,
.
ahandle
=
NULL
,
...
@@ -839,21 +840,21 @@ static void mnodeSendAlterVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet) {
...
@@ -839,21 +840,21 @@ static void mnodeSendAlterVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet) {
.
code
=
0
,
.
code
=
0
,
.
msgType
=
TSDB_MSG_TYPE_MD_ALTER_VNODE
.
msgType
=
TSDB_MSG_TYPE_MD_ALTER_VNODE
};
};
dnodeSendMsgToDnode
(
i
pSet
,
&
rpcMsg
);
dnodeSendMsgToDnode
(
e
pSet
,
&
rpcMsg
);
}
}
void
mnodeSendAlterVgroupMsg
(
SVgObj
*
pVgroup
)
{
void
mnodeSendAlterVgroupMsg
(
SVgObj
*
pVgroup
)
{
mDebug
(
"vgId:%d, send alter all vnodes msg, numOfVnodes:%d db:%s"
,
pVgroup
->
vgId
,
pVgroup
->
numOfVnodes
,
mDebug
(
"vgId:%d, send alter all vnodes msg, numOfVnodes:%d db:%s"
,
pVgroup
->
vgId
,
pVgroup
->
numOfVnodes
,
pVgroup
->
dbName
);
pVgroup
->
dbName
);
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
SRpc
IpSet
ipSet
=
mnodeGetI
pSetFromIp
(
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
);
SRpc
EpSet
epSet
=
mnodeGetE
pSetFromIp
(
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
);
mDebug
(
"vgId:%d, index:%d, send alter vnode msg to dnode %s"
,
pVgroup
->
vgId
,
i
,
mDebug
(
"vgId:%d, index:%d, send alter vnode msg to dnode %s"
,
pVgroup
->
vgId
,
i
,
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
);
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
);
mnodeSendAlterVnodeMsg
(
pVgroup
,
&
i
pSet
);
mnodeSendAlterVnodeMsg
(
pVgroup
,
&
e
pSet
);
}
}
}
}
static
void
mnodeSendCreateVnodeMsg
(
SVgObj
*
pVgroup
,
SRpc
IpSet
*
i
pSet
,
void
*
ahandle
)
{
static
void
mnodeSendCreateVnodeMsg
(
SVgObj
*
pVgroup
,
SRpc
EpSet
*
e
pSet
,
void
*
ahandle
)
{
SMDCreateVnodeMsg
*
pCreate
=
mnodeBuildVnodeMsg
(
pVgroup
);
SMDCreateVnodeMsg
*
pCreate
=
mnodeBuildVnodeMsg
(
pVgroup
);
SRpcMsg
rpcMsg
=
{
SRpcMsg
rpcMsg
=
{
.
ahandle
=
ahandle
,
.
ahandle
=
ahandle
,
...
@@ -862,17 +863,17 @@ static void mnodeSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *aha
...
@@ -862,17 +863,17 @@ static void mnodeSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *aha
.
code
=
0
,
.
code
=
0
,
.
msgType
=
TSDB_MSG_TYPE_MD_CREATE_VNODE
.
msgType
=
TSDB_MSG_TYPE_MD_CREATE_VNODE
};
};
dnodeSendMsgToDnode
(
i
pSet
,
&
rpcMsg
);
dnodeSendMsgToDnode
(
e
pSet
,
&
rpcMsg
);
}
}
void
mnodeSendCreateVgroupMsg
(
SVgObj
*
pVgroup
,
void
*
ahandle
)
{
void
mnodeSendCreateVgroupMsg
(
SVgObj
*
pVgroup
,
void
*
ahandle
)
{
mDebug
(
"vgId:%d, send create all vnodes msg, numOfVnodes:%d db:%s"
,
pVgroup
->
vgId
,
pVgroup
->
numOfVnodes
,
mDebug
(
"vgId:%d, send create all vnodes msg, numOfVnodes:%d db:%s"
,
pVgroup
->
vgId
,
pVgroup
->
numOfVnodes
,
pVgroup
->
dbName
);
pVgroup
->
dbName
);
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
SRpc
IpSet
ipSet
=
mnodeGetI
pSetFromIp
(
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
);
SRpc
EpSet
epSet
=
mnodeGetE
pSetFromIp
(
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
);
mDebug
(
"vgId:%d, index:%d, send create vnode msg to dnode %s, ahandle:%p"
,
pVgroup
->
vgId
,
mDebug
(
"vgId:%d, index:%d, send create vnode msg to dnode %s, ahandle:%p"
,
pVgroup
->
vgId
,
i
,
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
,
ahandle
);
i
,
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
,
ahandle
);
mnodeSendCreateVnodeMsg
(
pVgroup
,
&
i
pSet
,
ahandle
);
mnodeSendCreateVnodeMsg
(
pVgroup
,
&
e
pSet
,
ahandle
);
}
}
}
}
...
@@ -925,7 +926,7 @@ static SMDDropVnodeMsg *mnodeBuildDropVnodeMsg(int32_t vgId) {
...
@@ -925,7 +926,7 @@ static SMDDropVnodeMsg *mnodeBuildDropVnodeMsg(int32_t vgId) {
return
pDrop
;
return
pDrop
;
}
}
void
mnodeSendDropVnodeMsg
(
int32_t
vgId
,
SRpc
IpSet
*
i
pSet
,
void
*
ahandle
)
{
void
mnodeSendDropVnodeMsg
(
int32_t
vgId
,
SRpc
EpSet
*
e
pSet
,
void
*
ahandle
)
{
SMDDropVnodeMsg
*
pDrop
=
mnodeBuildDropVnodeMsg
(
vgId
);
SMDDropVnodeMsg
*
pDrop
=
mnodeBuildDropVnodeMsg
(
vgId
);
SRpcMsg
rpcMsg
=
{
SRpcMsg
rpcMsg
=
{
.
ahandle
=
ahandle
,
.
ahandle
=
ahandle
,
...
@@ -934,16 +935,16 @@ void mnodeSendDropVnodeMsg(int32_t vgId, SRpcIpSet *ipSet, void *ahandle) {
...
@@ -934,16 +935,16 @@ void mnodeSendDropVnodeMsg(int32_t vgId, SRpcIpSet *ipSet, void *ahandle) {
.
code
=
0
,
.
code
=
0
,
.
msgType
=
TSDB_MSG_TYPE_MD_DROP_VNODE
.
msgType
=
TSDB_MSG_TYPE_MD_DROP_VNODE
};
};
dnodeSendMsgToDnode
(
i
pSet
,
&
rpcMsg
);
dnodeSendMsgToDnode
(
e
pSet
,
&
rpcMsg
);
}
}
static
void
mnodeSendDropVgroupMsg
(
SVgObj
*
pVgroup
,
void
*
ahandle
)
{
static
void
mnodeSendDropVgroupMsg
(
SVgObj
*
pVgroup
,
void
*
ahandle
)
{
pVgroup
->
status
=
TAOS_VG_STATUS_DROPPING
;
// deleting
pVgroup
->
status
=
TAOS_VG_STATUS_DROPPING
;
// deleting
mDebug
(
"vgId:%d, send drop all vnodes msg, ahandle:%p"
,
pVgroup
->
vgId
,
ahandle
);
mDebug
(
"vgId:%d, send drop all vnodes msg, ahandle:%p"
,
pVgroup
->
vgId
,
ahandle
);
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
SRpc
IpSet
ipSet
=
mnodeGetI
pSetFromIp
(
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
);
SRpc
EpSet
epSet
=
mnodeGetE
pSetFromIp
(
pVgroup
->
vnodeGid
[
i
].
pDnode
->
dnodeEp
);
mDebug
(
"vgId:%d, send drop vnode msg to dnode:%d, ahandle:%p"
,
pVgroup
->
vgId
,
pVgroup
->
vnodeGid
[
i
].
dnodeId
,
ahandle
);
mDebug
(
"vgId:%d, send drop vnode msg to dnode:%d, ahandle:%p"
,
pVgroup
->
vgId
,
pVgroup
->
vnodeGid
[
i
].
dnodeId
,
ahandle
);
mnodeSendDropVnodeMsg
(
pVgroup
->
vgId
,
&
i
pSet
,
ahandle
);
mnodeSendDropVnodeMsg
(
pVgroup
->
vgId
,
&
e
pSet
,
ahandle
);
}
}
}
}
...
@@ -997,8 +998,8 @@ static int32_t mnodeProcessVnodeCfgMsg(SMnodeMsg *pMsg) {
...
@@ -997,8 +998,8 @@ static int32_t mnodeProcessVnodeCfgMsg(SMnodeMsg *pMsg) {
}
}
mDebug
(
"vgId:%d, send create vnode msg to dnode %s for vnode cfg msg"
,
pVgroup
->
vgId
,
pDnode
->
dnodeEp
);
mDebug
(
"vgId:%d, send create vnode msg to dnode %s for vnode cfg msg"
,
pVgroup
->
vgId
,
pDnode
->
dnodeEp
);
SRpc
IpSet
ipSet
=
mnodeGetI
pSetFromIp
(
pDnode
->
dnodeEp
);
SRpc
EpSet
epSet
=
mnodeGetE
pSetFromIp
(
pDnode
->
dnodeEp
);
mnodeSendCreateVnodeMsg
(
pVgroup
,
&
i
pSet
,
NULL
);
mnodeSendCreateVnodeMsg
(
pVgroup
,
&
e
pSet
,
NULL
);
mnodeDecDnodeRef
(
pDnode
);
mnodeDecDnodeRef
(
pDnode
);
mnodeDecVgroupRef
(
pVgroup
);
mnodeDecVgroupRef
(
pVgroup
);
...
...
src/mnode/src/mnodeWrite.c
浏览文件 @
1e21eaff
...
@@ -49,16 +49,16 @@ int32_t mnodeProcessWrite(SMnodeMsg *pMsg) {
...
@@ -49,16 +49,16 @@ int32_t mnodeProcessWrite(SMnodeMsg *pMsg) {
if
(
!
sdbIsMaster
())
{
if
(
!
sdbIsMaster
())
{
SMnodeRsp
*
rpcRsp
=
&
pMsg
->
rpcRsp
;
SMnodeRsp
*
rpcRsp
=
&
pMsg
->
rpcRsp
;
SRpc
IpSet
*
ipSet
=
rpcMallocCont
(
sizeof
(
SRpcI
pSet
));
SRpc
EpSet
*
epSet
=
rpcMallocCont
(
sizeof
(
SRpcE
pSet
));
mnodeGetMnode
IpSetForShell
(
i
pSet
);
mnodeGetMnode
EpSetForShell
(
e
pSet
);
rpcRsp
->
rsp
=
i
pSet
;
rpcRsp
->
rsp
=
e
pSet
;
rpcRsp
->
len
=
sizeof
(
SRpc
I
pSet
);
rpcRsp
->
len
=
sizeof
(
SRpc
E
pSet
);
mDebug
(
"app:%p:%p, msg:%s will be redireced inUse:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
mDebug
(
"app:%p:%p, msg:%s will be redireced inUse:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
taosMsg
[
pMsg
->
rpcMsg
.
msgType
],
i
pSet
->
inUse
);
e
pSet
->
inUse
);
for
(
int32_t
i
=
0
;
i
<
ipSet
->
numOfI
ps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
epSet
->
numOfE
ps
;
++
i
)
{
mDebug
(
"app:%p:%p, mnode index:%d
ip:%s:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
i
,
i
pSet
->
fqdn
[
i
],
mDebug
(
"app:%p:%p, mnode index:%d
ep:%s:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
i
,
e
pSet
->
fqdn
[
i
],
htons
(
i
pSet
->
port
[
i
]));
htons
(
e
pSet
->
port
[
i
]));
}
}
return
TSDB_CODE_RPC_REDIRECT
;
return
TSDB_CODE_RPC_REDIRECT
;
...
...
src/plugins/monitor/src/monitorMain.c
浏览文件 @
1e21eaff
...
@@ -76,6 +76,8 @@ static void monitorInitDatabase();
...
@@ -76,6 +76,8 @@ static void monitorInitDatabase();
static
void
monitorInitDatabaseCb
(
void
*
param
,
TAOS_RES
*
result
,
int32_t
code
);
static
void
monitorInitDatabaseCb
(
void
*
param
,
TAOS_RES
*
result
,
int32_t
code
);
static
void
monitorStartTimer
();
static
void
monitorStartTimer
();
static
void
monitorSaveSystemInfo
();
static
void
monitorSaveSystemInfo
();
extern
int32_t
(
*
monitorStartSystemFp
)();
extern
void
(
*
monitorStopSystemFp
)();
static
void
monitorCheckDiskUsage
(
void
*
para
,
void
*
unused
)
{
static
void
monitorCheckDiskUsage
(
void
*
para
,
void
*
unused
)
{
taosGetDisk
();
taosGetDisk
();
...
@@ -85,6 +87,8 @@ static void monitorCheckDiskUsage(void *para, void *unused) {
...
@@ -85,6 +87,8 @@ static void monitorCheckDiskUsage(void *para, void *unused) {
int32_t
monitorInitSystem
()
{
int32_t
monitorInitSystem
()
{
taos_init
();
taos_init
();
taosTmrReset
(
monitorCheckDiskUsage
,
CHECK_INTERVAL
,
NULL
,
tscTmr
,
&
tsMonitorConn
.
diskTimer
);
taosTmrReset
(
monitorCheckDiskUsage
,
CHECK_INTERVAL
,
NULL
,
tscTmr
,
&
tsMonitorConn
.
diskTimer
);
monitorStartSystemFp
=
monitorStartSystem
;
monitorStopSystemFp
=
monitorStopSystem
;
return
0
;
return
0
;
}
}
...
...
src/query/src/qExecutor.c
浏览文件 @
1e21eaff
...
@@ -2236,6 +2236,27 @@ static void ensureOutputBuffer(SQueryRuntimeEnv* pRuntimeEnv, SDataBlockInfo* pB
...
@@ -2236,6 +2236,27 @@ static void ensureOutputBuffer(SQueryRuntimeEnv* pRuntimeEnv, SDataBlockInfo* pB
}
}
}
}
static
void
doSetInitialTimewindow
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SDataBlockInfo
*
pBlockInfo
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
if
(
QUERY_IS_INTERVAL_QUERY
(
pQuery
)
&&
pRuntimeEnv
->
windowResInfo
.
prevSKey
==
TSKEY_INITIAL_VAL
)
{
STimeWindow
w
=
TSWINDOW_INITIALIZER
;
SWindowResInfo
*
pWindowResInfo
=
&
pRuntimeEnv
->
windowResInfo
;
if
(
QUERY_IS_ASC_QUERY
(
pQuery
))
{
getAlignQueryTimeWindow
(
pQuery
,
pBlockInfo
->
window
.
skey
,
pBlockInfo
->
window
.
skey
,
pQuery
->
window
.
ekey
,
&
w
);
pWindowResInfo
->
startTime
=
w
.
skey
;
pWindowResInfo
->
prevSKey
=
w
.
skey
;
}
else
{
// the start position of the first time window in the endpoint that spreads beyond the queried last timestamp
getAlignQueryTimeWindow
(
pQuery
,
pBlockInfo
->
window
.
ekey
,
pQuery
->
window
.
ekey
,
pBlockInfo
->
window
.
ekey
,
&
w
);
pWindowResInfo
->
startTime
=
pQuery
->
window
.
skey
;
pWindowResInfo
->
prevSKey
=
w
.
skey
;
}
}
}
static
int64_t
doScanAllDataBlocks
(
SQueryRuntimeEnv
*
pRuntimeEnv
)
{
static
int64_t
doScanAllDataBlocks
(
SQueryRuntimeEnv
*
pRuntimeEnv
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
STableQueryInfo
*
pTableQueryInfo
=
pQuery
->
current
;
STableQueryInfo
*
pTableQueryInfo
=
pQuery
->
current
;
...
@@ -2263,24 +2284,7 @@ static int64_t doScanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
...
@@ -2263,24 +2284,7 @@ static int64_t doScanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
}
}
tsdbRetrieveDataBlockInfo
(
pQueryHandle
,
&
blockInfo
);
tsdbRetrieveDataBlockInfo
(
pQueryHandle
,
&
blockInfo
);
doSetInitialTimewindow
(
pRuntimeEnv
,
&
blockInfo
);
// todo extract methods
if
(
QUERY_IS_INTERVAL_QUERY
(
pQuery
)
&&
pRuntimeEnv
->
windowResInfo
.
prevSKey
==
TSKEY_INITIAL_VAL
)
{
STimeWindow
w
=
TSWINDOW_INITIALIZER
;
SWindowResInfo
*
pWindowResInfo
=
&
pRuntimeEnv
->
windowResInfo
;
if
(
QUERY_IS_ASC_QUERY
(
pQuery
))
{
getAlignQueryTimeWindow
(
pQuery
,
blockInfo
.
window
.
skey
,
blockInfo
.
window
.
skey
,
pQuery
->
window
.
ekey
,
&
w
);
pWindowResInfo
->
startTime
=
w
.
skey
;
pWindowResInfo
->
prevSKey
=
w
.
skey
;
}
else
{
// the start position of the first time window in the endpoint that spreads beyond the queried last timestamp
getAlignQueryTimeWindow
(
pQuery
,
blockInfo
.
window
.
ekey
,
pQuery
->
window
.
ekey
,
blockInfo
.
window
.
ekey
,
&
w
);
pWindowResInfo
->
startTime
=
pQuery
->
window
.
skey
;
pWindowResInfo
->
prevSKey
=
w
.
skey
;
}
}
// in case of prj/diff query, ensure the output buffer is sufficient to accommodate the results of current block
// in case of prj/diff query, ensure the output buffer is sufficient to accommodate the results of current block
ensureOutputBuffer
(
pRuntimeEnv
,
&
blockInfo
);
ensureOutputBuffer
(
pRuntimeEnv
,
&
blockInfo
);
...
@@ -2314,7 +2318,6 @@ static int64_t doScanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
...
@@ -2314,7 +2318,6 @@ static int64_t doScanAllDataBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
if
(
QUERY_IS_INTERVAL_QUERY
(
pQuery
)
&&
IS_MASTER_SCAN
(
pRuntimeEnv
))
{
if
(
QUERY_IS_INTERVAL_QUERY
(
pQuery
)
&&
IS_MASTER_SCAN
(
pRuntimeEnv
))
{
if
(
Q_STATUS_EQUAL
(
pQuery
->
status
,
QUERY_COMPLETED
))
{
if
(
Q_STATUS_EQUAL
(
pQuery
->
status
,
QUERY_COMPLETED
))
{
closeAllTimeWindow
(
&
pRuntimeEnv
->
windowResInfo
);
closeAllTimeWindow
(
&
pRuntimeEnv
->
windowResInfo
);
// removeRedundantWindow(&pRuntimeEnv->windowResInfo, pTableQueryInfo->lastKey - step, step);
pRuntimeEnv
->
windowResInfo
.
curIndex
=
pRuntimeEnv
->
windowResInfo
.
size
-
1
;
// point to the last time window
pRuntimeEnv
->
windowResInfo
.
curIndex
=
pRuntimeEnv
->
windowResInfo
.
size
-
1
;
// point to the last time window
}
else
{
}
else
{
assert
(
Q_STATUS_EQUAL
(
pQuery
->
status
,
QUERY_RESBUF_FULL
));
assert
(
Q_STATUS_EQUAL
(
pQuery
->
status
,
QUERY_RESBUF_FULL
));
...
@@ -3223,6 +3226,13 @@ static void setEnvBeforeReverseScan(SQueryRuntimeEnv *pRuntimeEnv, SQueryStatusI
...
@@ -3223,6 +3226,13 @@ static void setEnvBeforeReverseScan(SQueryRuntimeEnv *pRuntimeEnv, SQueryStatusI
SWAP
(
pQuery
->
window
.
skey
,
pQuery
->
window
.
ekey
,
TSKEY
);
SWAP
(
pQuery
->
window
.
skey
,
pQuery
->
window
.
ekey
,
TSKEY
);
SWITCH_ORDER
(
pQuery
->
order
.
order
);
SWITCH_ORDER
(
pQuery
->
order
.
order
);
if
(
QUERY_IS_ASC_QUERY
(
pQuery
))
{
assert
(
pQuery
->
window
.
skey
<=
pQuery
->
window
.
ekey
);
}
else
{
assert
(
pQuery
->
window
.
skey
>=
pQuery
->
window
.
ekey
);
}
SET_REVERSE_SCAN_FLAG
(
pRuntimeEnv
);
SET_REVERSE_SCAN_FLAG
(
pRuntimeEnv
);
STsdbQueryCond
cond
=
{
STsdbQueryCond
cond
=
{
...
@@ -3262,8 +3272,7 @@ static void clearEnvAfterReverseScan(SQueryRuntimeEnv *pRuntimeEnv, SQueryStatus
...
@@ -3262,8 +3272,7 @@ static void clearEnvAfterReverseScan(SQueryRuntimeEnv *pRuntimeEnv, SQueryStatus
SET_MASTER_SCAN_FLAG
(
pRuntimeEnv
);
SET_MASTER_SCAN_FLAG
(
pRuntimeEnv
);
// update the pQuery->window.skey and pQuery->window.ekey to limit the scan scope of sliding query
// update the pQuery->window.skey and pQuery->window.ekey to limit the scan scope of sliding query during reverse scan
// during reverse scan
pTableQueryInfo
->
lastKey
=
pStatus
->
lastKey
;
pTableQueryInfo
->
lastKey
=
pStatus
->
lastKey
;
pQuery
->
status
=
pStatus
->
status
;
pQuery
->
status
=
pStatus
->
status
;
...
@@ -3289,7 +3298,12 @@ void scanOneTableDataBlocks(SQueryRuntimeEnv *pRuntimeEnv, TSKEY start) {
...
@@ -3289,7 +3298,12 @@ void scanOneTableDataBlocks(SQueryRuntimeEnv *pRuntimeEnv, TSKEY start) {
if
(
pRuntimeEnv
->
scanFlag
==
MASTER_SCAN
)
{
if
(
pRuntimeEnv
->
scanFlag
==
MASTER_SCAN
)
{
qstatus
.
status
=
pQuery
->
status
;
qstatus
.
status
=
pQuery
->
status
;
qstatus
.
curWindow
.
ekey
=
pTableQueryInfo
->
lastKey
-
step
;
// do nothing if no data blocks are found qualified during scan
if
(
qstatus
.
lastKey
!=
pTableQueryInfo
->
lastKey
)
{
qstatus
.
curWindow
.
ekey
=
pTableQueryInfo
->
lastKey
-
step
;
}
qstatus
.
lastKey
=
pTableQueryInfo
->
lastKey
;
qstatus
.
lastKey
=
pTableQueryInfo
->
lastKey
;
}
}
...
@@ -5859,7 +5873,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList,
...
@@ -5859,7 +5873,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList,
return
pQInfo
;
return
pQInfo
;
_cleanup_qinfo:
_cleanup_qinfo:
tsdbDest
or
yTableGroup
(
pTableGroupInfo
);
tsdbDest
ro
yTableGroup
(
pTableGroupInfo
);
_cleanup_query:
_cleanup_query:
taosArrayDestroy
(
pGroupbyExpr
->
columnInfo
);
taosArrayDestroy
(
pGroupbyExpr
->
columnInfo
);
...
@@ -6009,7 +6023,7 @@ static void freeQInfo(SQInfo *pQInfo) {
...
@@ -6009,7 +6023,7 @@ static void freeQInfo(SQInfo *pQInfo) {
tfree
(
pQInfo
->
pBuf
);
tfree
(
pQInfo
->
pBuf
);
taosArrayDestroy
(
pQInfo
->
tableqinfoGroupInfo
.
pGroupList
);
taosArrayDestroy
(
pQInfo
->
tableqinfoGroupInfo
.
pGroupList
);
taosHashCleanup
(
pQInfo
->
tableqinfoGroupInfo
.
map
);
taosHashCleanup
(
pQInfo
->
tableqinfoGroupInfo
.
map
);
tsdbDest
or
yTableGroup
(
&
pQInfo
->
tableGroupInfo
);
tsdbDest
ro
yTableGroup
(
&
pQInfo
->
tableGroupInfo
);
taosArrayDestroy
(
pQInfo
->
arrTableIdInfo
);
taosArrayDestroy
(
pQInfo
->
arrTableIdInfo
);
if
(
pQuery
->
pGroupbyExpr
!=
NULL
)
{
if
(
pQuery
->
pGroupbyExpr
!=
NULL
)
{
...
@@ -6282,7 +6296,7 @@ void qTableQuery(qinfo_t qinfo) {
...
@@ -6282,7 +6296,7 @@ void qTableQuery(qinfo_t qinfo) {
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
if
(
onlyQueryTags
(
pQInfo
->
runtimeEnv
.
pQuery
))
{
if
(
onlyQueryTags
(
pQInfo
->
runtimeEnv
.
pQuery
))
{
assert
(
pQInfo
->
runtimeEnv
.
pQueryHandle
==
NULL
);
assert
(
pQInfo
->
runtimeEnv
.
pQueryHandle
==
NULL
);
buildTagQueryResult
(
pQInfo
);
// todo support the limit/offset
buildTagQueryResult
(
pQInfo
);
}
else
if
(
pQInfo
->
runtimeEnv
.
stableQuery
)
{
}
else
if
(
pQInfo
->
runtimeEnv
.
stableQuery
)
{
stableQueryImpl
(
pQInfo
);
stableQueryImpl
(
pQInfo
);
}
else
{
}
else
{
...
@@ -6403,6 +6417,22 @@ int32_t qKillQuery(qinfo_t qinfo) {
...
@@ -6403,6 +6417,22 @@ int32_t qKillQuery(qinfo_t qinfo) {
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
static
void
doSetTagValueToResultBuf
(
char
*
output
,
const
char
*
val
,
int16_t
type
,
int16_t
bytes
)
{
if
(
type
==
TSDB_DATA_TYPE_BINARY
||
type
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
val
==
NULL
)
{
setVardataNull
(
output
,
type
);
}
else
{
memcpy
(
output
,
val
,
varDataTLen
(
val
));
}
}
else
{
if
(
val
==
NULL
)
{
setNull
(
output
,
type
,
bytes
);
}
else
{
// todo here stop will cause client crash
memcpy
(
output
,
val
,
bytes
);
}
}
}
static
void
buildTagQueryResult
(
SQInfo
*
pQInfo
)
{
static
void
buildTagQueryResult
(
SQInfo
*
pQInfo
)
{
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
...
@@ -6459,25 +6489,11 @@ static void buildTagQueryResult(SQInfo* pQInfo) {
...
@@ -6459,25 +6489,11 @@ static void buildTagQueryResult(SQInfo* pQInfo) {
output
+=
sizeof
(
pQInfo
->
vgId
);
output
+=
sizeof
(
pQInfo
->
vgId
);
if
(
pExprInfo
->
base
.
colInfo
.
colId
==
TSDB_TBNAME_COLUMN_INDEX
)
{
if
(
pExprInfo
->
base
.
colInfo
.
colId
==
TSDB_TBNAME_COLUMN_INDEX
)
{
char
*
data
=
tsdbGetTableName
(
item
->
pTable
);
char
*
data
=
tsdbGetTableName
(
item
->
pTable
);
memcpy
(
output
,
data
,
varDataTLen
(
data
));
memcpy
(
output
,
data
,
varDataTLen
(
data
));
}
else
{
}
else
{
char
*
val
=
tsdbGetTableTagVal
(
item
->
pTable
,
pExprInfo
->
base
.
colInfo
.
colId
,
type
,
bytes
);
char
*
data
=
tsdbGetTableTagVal
(
item
->
pTable
,
pExprInfo
->
base
.
colInfo
.
colId
,
type
,
bytes
);
doSetTagValueToResultBuf
(
output
,
data
,
type
,
bytes
);
// todo refactor
if
(
type
==
TSDB_DATA_TYPE_BINARY
||
type
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
val
==
NULL
)
{
setVardataNull
(
output
,
type
);
}
else
{
memcpy
(
output
,
val
,
varDataTLen
(
val
));
}
}
else
{
if
(
val
==
NULL
)
{
setNull
(
output
,
type
,
bytes
);
}
else
{
// todo here stop will cause client crash
memcpy
(
output
,
val
,
bytes
);
}
}
}
}
count
+=
1
;
count
+=
1
;
...
@@ -6494,38 +6510,44 @@ static void buildTagQueryResult(SQInfo* pQInfo) {
...
@@ -6494,38 +6510,44 @@ static void buildTagQueryResult(SQInfo* pQInfo) {
}
else
{
// return only the tags|table name etc.
}
else
{
// return only the tags|table name etc.
count
=
0
;
count
=
0
;
SSchema
tbnameSchema
=
tGetTableNameColumnSchema
();
SSchema
tbnameSchema
=
tGetTableNameColumnSchema
();
while
(
pQInfo
->
tableIndex
<
num
&&
count
<
pQuery
->
rec
.
capacity
)
{
int32_t
maxNumOfTables
=
pQuery
->
rec
.
capacity
;
if
(
pQuery
->
limit
.
limit
>=
0
&&
pQuery
->
limit
.
limit
<
pQuery
->
rec
.
capacity
)
{
maxNumOfTables
=
pQuery
->
limit
.
limit
;
}
while
(
pQInfo
->
tableIndex
<
num
&&
count
<
maxNumOfTables
)
{
int32_t
i
=
pQInfo
->
tableIndex
++
;
int32_t
i
=
pQInfo
->
tableIndex
++
;
// discard current result due to offset
if
(
pQuery
->
limit
.
offset
>
0
)
{
pQuery
->
limit
.
offset
-=
1
;
continue
;
}
SExprInfo
*
pExprInfo
=
pQuery
->
pSelectExpr
;
SExprInfo
*
pExprInfo
=
pQuery
->
pSelectExpr
;
STableQueryInfo
*
item
=
taosArrayGetP
(
pa
,
i
);
STableQueryInfo
*
item
=
taosArrayGetP
(
pa
,
i
);
char
*
data
=
NULL
,
*
dst
=
NULL
;
int16_t
type
=
0
,
bytes
=
0
;
for
(
int32_t
j
=
0
;
j
<
pQuery
->
numOfOutput
;
++
j
)
{
for
(
int32_t
j
=
0
;
j
<
pQuery
->
numOfOutput
;
++
j
)
{
if
(
pExprInfo
[
j
].
base
.
colInfo
.
colId
==
TSDB_TBNAME_COLUMN_INDEX
)
{
if
(
pExprInfo
[
j
].
base
.
colInfo
.
colId
==
TSDB_TBNAME_COLUMN_INDEX
)
{
char
*
data
=
tsdbGetTableName
(
item
->
pTable
);
bytes
=
tbnameSchema
.
bytes
;
char
*
dst
=
pQuery
->
sdata
[
j
]
->
data
+
count
*
tbnameSchema
.
bytes
;
type
=
tbnameSchema
.
type
;
memcpy
(
dst
,
data
,
varDataTLen
(
data
));
}
else
{
// todo refactor
data
=
tsdbGetTableName
(
item
->
pTable
);
int16_t
type
=
pExprInfo
[
j
].
type
;
dst
=
pQuery
->
sdata
[
j
]
->
data
+
count
*
tbnameSchema
.
bytes
;
int16_t
bytes
=
pExprInfo
[
j
].
bytes
;
}
else
{
type
=
pExprInfo
[
j
].
type
;
bytes
=
pExprInfo
[
j
].
bytes
;
char
*
data
=
tsdbGetTableTagVal
(
item
->
pTable
,
pExprInfo
[
j
].
base
.
colInfo
.
colId
,
type
,
bytes
);
data
=
tsdbGetTableTagVal
(
item
->
pTable
,
pExprInfo
[
j
].
base
.
colInfo
.
colId
,
type
,
bytes
);
char
*
dst
=
pQuery
->
sdata
[
j
]
->
data
+
count
*
pExprInfo
[
j
].
bytes
;
dst
=
pQuery
->
sdata
[
j
]
->
data
+
count
*
pExprInfo
[
j
].
bytes
;
if
(
type
==
TSDB_DATA_TYPE_BINARY
||
type
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
data
==
NULL
)
{
setVardataNull
(
dst
,
type
);
}
else
{
memcpy
(
dst
,
data
,
varDataTLen
(
data
));
}
}
else
{
if
(
data
==
NULL
)
{
setNull
(
dst
,
type
,
bytes
);
}
else
{
memcpy
(
dst
,
data
,
pExprInfo
[
j
].
bytes
);
}
}
}
}
doSetTagValueToResultBuf
(
dst
,
data
,
type
,
bytes
);
}
}
count
+=
1
;
count
+=
1
;
}
}
...
...
src/rpc/src/rpcMain.c
浏览文件 @
1e21eaff
...
@@ -55,7 +55,7 @@ typedef struct {
...
@@ -55,7 +55,7 @@ typedef struct {
char
secret
[
TSDB_KEY_LEN
];
// secret for the link
char
secret
[
TSDB_KEY_LEN
];
// secret for the link
char
ckey
[
TSDB_KEY_LEN
];
// ciphering key
char
ckey
[
TSDB_KEY_LEN
];
// ciphering key
void
(
*
cfp
)(
SRpcMsg
*
,
SRpc
I
pSet
*
);
void
(
*
cfp
)(
SRpcMsg
*
,
SRpc
E
pSet
*
);
int
(
*
afp
)(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
int
(
*
afp
)(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
int32_t
refCount
;
int32_t
refCount
;
...
@@ -71,7 +71,7 @@ typedef struct {
...
@@ -71,7 +71,7 @@ typedef struct {
typedef
struct
{
typedef
struct
{
SRpcInfo
*
pRpc
;
// associated SRpcInfo
SRpcInfo
*
pRpc
;
// associated SRpcInfo
SRpc
IpSet
i
pSet
;
// ip list provided by app
SRpc
EpSet
e
pSet
;
// ip list provided by app
void
*
ahandle
;
// handle provided by app
void
*
ahandle
;
// handle provided by app
void
*
signature
;
// for validation
void
*
signature
;
// for validation
struct
SRpcConn
*
pConn
;
// pConn allocated
struct
SRpcConn
*
pConn
;
// pConn allocated
...
@@ -80,12 +80,12 @@ typedef struct {
...
@@ -80,12 +80,12 @@ typedef struct {
int32_t
contLen
;
// content length
int32_t
contLen
;
// content length
int32_t
code
;
// error code
int32_t
code
;
// error code
int16_t
numOfTry
;
// number of try for different servers
int16_t
numOfTry
;
// number of try for different servers
int8_t
oldInUse
;
// server
I
P inUse passed by app
int8_t
oldInUse
;
// server
E
P inUse passed by app
int8_t
redirect
;
// flag to indicate redirect
int8_t
redirect
;
// flag to indicate redirect
int8_t
connType
;
// connection type
int8_t
connType
;
// connection type
SRpcMsg
*
pRsp
;
// for synchronous API
SRpcMsg
*
pRsp
;
// for synchronous API
tsem_t
*
pSem
;
// for synchronous API
tsem_t
*
pSem
;
// for synchronous API
SRpc
I
pSet
*
pSet
;
// for synchronous API
SRpc
E
pSet
*
pSet
;
// for synchronous API
char
msg
[
0
];
// RpcHead starts from here
char
msg
[
0
];
// RpcHead starts from here
}
SRpcReqContext
;
}
SRpcReqContext
;
...
@@ -355,7 +355,7 @@ void *rpcReallocCont(void *ptr, int contLen) {
...
@@ -355,7 +355,7 @@ void *rpcReallocCont(void *ptr, int contLen) {
return
start
+
sizeof
(
SRpcReqContext
)
+
sizeof
(
SRpcHead
);
return
start
+
sizeof
(
SRpcReqContext
)
+
sizeof
(
SRpcHead
);
}
}
void
rpcSendRequest
(
void
*
shandle
,
const
SRpc
IpSet
*
pI
pSet
,
SRpcMsg
*
pMsg
)
{
void
rpcSendRequest
(
void
*
shandle
,
const
SRpc
EpSet
*
pE
pSet
,
SRpcMsg
*
pMsg
)
{
SRpcInfo
*
pRpc
=
(
SRpcInfo
*
)
shandle
;
SRpcInfo
*
pRpc
=
(
SRpcInfo
*
)
shandle
;
SRpcReqContext
*
pContext
;
SRpcReqContext
*
pContext
;
...
@@ -364,11 +364,11 @@ void rpcSendRequest(void *shandle, const SRpcIpSet *pIpSet, SRpcMsg *pMsg) {
...
@@ -364,11 +364,11 @@ void rpcSendRequest(void *shandle, const SRpcIpSet *pIpSet, SRpcMsg *pMsg) {
pContext
->
ahandle
=
pMsg
->
ahandle
;
pContext
->
ahandle
=
pMsg
->
ahandle
;
pContext
->
signature
=
pContext
;
pContext
->
signature
=
pContext
;
pContext
->
pRpc
=
(
SRpcInfo
*
)
shandle
;
pContext
->
pRpc
=
(
SRpcInfo
*
)
shandle
;
pContext
->
ipSet
=
*
pI
pSet
;
pContext
->
epSet
=
*
pE
pSet
;
pContext
->
contLen
=
contLen
;
pContext
->
contLen
=
contLen
;
pContext
->
pCont
=
pMsg
->
pCont
;
pContext
->
pCont
=
pMsg
->
pCont
;
pContext
->
msgType
=
pMsg
->
msgType
;
pContext
->
msgType
=
pMsg
->
msgType
;
pContext
->
oldInUse
=
p
I
pSet
->
inUse
;
pContext
->
oldInUse
=
p
E
pSet
->
inUse
;
pContext
->
connType
=
RPC_CONN_UDPC
;
pContext
->
connType
=
RPC_CONN_UDPC
;
if
(
contLen
>
tsRpcMaxUdpSize
)
pContext
->
connType
=
RPC_CONN_TCPC
;
if
(
contLen
>
tsRpcMaxUdpSize
)
pContext
->
connType
=
RPC_CONN_TCPC
;
...
@@ -458,15 +458,15 @@ void rpcSendResponse(const SRpcMsg *pRsp) {
...
@@ -458,15 +458,15 @@ void rpcSendResponse(const SRpcMsg *pRsp) {
return
;
return
;
}
}
void
rpcSendRedirectRsp
(
void
*
thandle
,
const
SRpc
IpSet
*
pI
pSet
)
{
void
rpcSendRedirectRsp
(
void
*
thandle
,
const
SRpc
EpSet
*
pE
pSet
)
{
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
;
memset
(
&
rpcMsg
,
0
,
sizeof
(
rpcMsg
));
memset
(
&
rpcMsg
,
0
,
sizeof
(
rpcMsg
));
rpcMsg
.
contLen
=
sizeof
(
SRpc
I
pSet
);
rpcMsg
.
contLen
=
sizeof
(
SRpc
E
pSet
);
rpcMsg
.
pCont
=
rpcMallocCont
(
rpcMsg
.
contLen
);
rpcMsg
.
pCont
=
rpcMallocCont
(
rpcMsg
.
contLen
);
if
(
rpcMsg
.
pCont
==
NULL
)
return
;
if
(
rpcMsg
.
pCont
==
NULL
)
return
;
memcpy
(
rpcMsg
.
pCont
,
p
IpSet
,
sizeof
(
SRpcI
pSet
));
memcpy
(
rpcMsg
.
pCont
,
p
EpSet
,
sizeof
(
SRpcE
pSet
));
rpcMsg
.
code
=
TSDB_CODE_RPC_REDIRECT
;
rpcMsg
.
code
=
TSDB_CODE_RPC_REDIRECT
;
rpcMsg
.
handle
=
thandle
;
rpcMsg
.
handle
=
thandle
;
...
@@ -488,7 +488,7 @@ int rpcGetConnInfo(void *thandle, SRpcConnInfo *pInfo) {
...
@@ -488,7 +488,7 @@ int rpcGetConnInfo(void *thandle, SRpcConnInfo *pInfo) {
return
0
;
return
0
;
}
}
void
rpcSendRecv
(
void
*
shandle
,
SRpc
IpSet
*
pI
pSet
,
SRpcMsg
*
pMsg
,
SRpcMsg
*
pRsp
)
{
void
rpcSendRecv
(
void
*
shandle
,
SRpc
EpSet
*
pE
pSet
,
SRpcMsg
*
pMsg
,
SRpcMsg
*
pRsp
)
{
SRpcReqContext
*
pContext
;
SRpcReqContext
*
pContext
;
pContext
=
(
SRpcReqContext
*
)
(
pMsg
->
pCont
-
sizeof
(
SRpcHead
)
-
sizeof
(
SRpcReqContext
));
pContext
=
(
SRpcReqContext
*
)
(
pMsg
->
pCont
-
sizeof
(
SRpcHead
)
-
sizeof
(
SRpcReqContext
));
...
@@ -498,9 +498,9 @@ void rpcSendRecv(void *shandle, SRpcIpSet *pIpSet, SRpcMsg *pMsg, SRpcMsg *pRsp)
...
@@ -498,9 +498,9 @@ void rpcSendRecv(void *shandle, SRpcIpSet *pIpSet, SRpcMsg *pMsg, SRpcMsg *pRsp)
tsem_init
(
&
sem
,
0
,
0
);
tsem_init
(
&
sem
,
0
,
0
);
pContext
->
pSem
=
&
sem
;
pContext
->
pSem
=
&
sem
;
pContext
->
pRsp
=
pRsp
;
pContext
->
pRsp
=
pRsp
;
pContext
->
pSet
=
p
I
pSet
;
pContext
->
pSet
=
p
E
pSet
;
rpcSendRequest
(
shandle
,
p
I
pSet
,
pMsg
);
rpcSendRequest
(
shandle
,
p
E
pSet
,
pMsg
);
tsem_wait
(
&
sem
);
tsem_wait
(
&
sem
);
tsem_destroy
(
&
sem
);
tsem_destroy
(
&
sem
);
...
@@ -755,11 +755,11 @@ static SRpcConn *rpcGetConnObj(SRpcInfo *pRpc, int sid, SRecvInfo *pRecv) {
...
@@ -755,11 +755,11 @@ static SRpcConn *rpcGetConnObj(SRpcInfo *pRpc, int sid, SRecvInfo *pRecv) {
static
SRpcConn
*
rpcSetupConnToServer
(
SRpcReqContext
*
pContext
)
{
static
SRpcConn
*
rpcSetupConnToServer
(
SRpcReqContext
*
pContext
)
{
SRpcConn
*
pConn
;
SRpcConn
*
pConn
;
SRpcInfo
*
pRpc
=
pContext
->
pRpc
;
SRpcInfo
*
pRpc
=
pContext
->
pRpc
;
SRpc
IpSet
*
pIpSet
=
&
pContext
->
i
pSet
;
SRpc
EpSet
*
pEpSet
=
&
pContext
->
e
pSet
;
pConn
=
rpcGetConnFromCache
(
pRpc
->
pCache
,
p
IpSet
->
fqdn
[
pIpSet
->
inUse
],
pIpSet
->
port
[
pI
pSet
->
inUse
],
pContext
->
connType
);
pConn
=
rpcGetConnFromCache
(
pRpc
->
pCache
,
p
EpSet
->
fqdn
[
pEpSet
->
inUse
],
pEpSet
->
port
[
pE
pSet
->
inUse
],
pContext
->
connType
);
if
(
pConn
==
NULL
||
pConn
->
user
[
0
]
==
0
)
{
if
(
pConn
==
NULL
||
pConn
->
user
[
0
]
==
0
)
{
pConn
=
rpcOpenConn
(
pRpc
,
p
IpSet
->
fqdn
[
pIpSet
->
inUse
],
pIpSet
->
port
[
pI
pSet
->
inUse
],
pContext
->
connType
);
pConn
=
rpcOpenConn
(
pRpc
,
p
EpSet
->
fqdn
[
pEpSet
->
inUse
],
pEpSet
->
port
[
pE
pSet
->
inUse
],
pContext
->
connType
);
}
}
if
(
pConn
)
{
if
(
pConn
)
{
...
@@ -1020,16 +1020,16 @@ static void rpcNotifyClient(SRpcReqContext *pContext, SRpcMsg *pMsg) {
...
@@ -1020,16 +1020,16 @@ static void rpcNotifyClient(SRpcReqContext *pContext, SRpcMsg *pMsg) {
pContext
->
pConn
=
NULL
;
pContext
->
pConn
=
NULL
;
if
(
pContext
->
pRsp
)
{
if
(
pContext
->
pRsp
)
{
// for synchronous API
// for synchronous API
memcpy
(
pContext
->
pSet
,
&
pContext
->
ipSet
,
sizeof
(
SRpcI
pSet
));
memcpy
(
pContext
->
pSet
,
&
pContext
->
epSet
,
sizeof
(
SRpcE
pSet
));
memcpy
(
pContext
->
pRsp
,
pMsg
,
sizeof
(
SRpcMsg
));
memcpy
(
pContext
->
pRsp
,
pMsg
,
sizeof
(
SRpcMsg
));
tsem_post
(
pContext
->
pSem
);
tsem_post
(
pContext
->
pSem
);
}
else
{
}
else
{
// for asynchronous API
// for asynchronous API
SRpc
IpSet
*
pI
pSet
=
NULL
;
SRpc
EpSet
*
pE
pSet
=
NULL
;
if
(
pContext
->
i
pSet
.
inUse
!=
pContext
->
oldInUse
||
pContext
->
redirect
)
if
(
pContext
->
e
pSet
.
inUse
!=
pContext
->
oldInUse
||
pContext
->
redirect
)
p
IpSet
=
&
pContext
->
i
pSet
;
p
EpSet
=
&
pContext
->
e
pSet
;
(
*
pRpc
->
cfp
)(
pMsg
,
p
I
pSet
);
(
*
pRpc
->
cfp
)(
pMsg
,
p
E
pSet
);
}
}
// free the request message
// free the request message
...
@@ -1070,9 +1070,9 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
...
@@ -1070,9 +1070,9 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
pConn
->
pContext
=
NULL
;
pConn
->
pContext
=
NULL
;
pConn
->
pReqMsg
=
NULL
;
pConn
->
pReqMsg
=
NULL
;
// for UDP, port may be changed by server, the port in
i
pSet shall be used for cache
// for UDP, port may be changed by server, the port in
e
pSet shall be used for cache
if
(
pHead
->
code
!=
TSDB_CODE_RPC_TOO_SLOW
)
{
if
(
pHead
->
code
!=
TSDB_CODE_RPC_TOO_SLOW
)
{
rpcAddConnIntoCache
(
pRpc
->
pCache
,
pConn
,
pConn
->
peerFqdn
,
pContext
->
ipSet
.
port
[
pContext
->
i
pSet
.
inUse
],
pConn
->
connType
);
rpcAddConnIntoCache
(
pRpc
->
pCache
,
pConn
,
pConn
->
peerFqdn
,
pContext
->
epSet
.
port
[
pContext
->
e
pSet
.
inUse
],
pConn
->
connType
);
}
else
{
}
else
{
rpcCloseConn
(
pConn
);
rpcCloseConn
(
pConn
);
}
}
...
@@ -1087,10 +1087,10 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
...
@@ -1087,10 +1087,10 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
if
(
pHead
->
code
==
TSDB_CODE_RPC_REDIRECT
)
{
if
(
pHead
->
code
==
TSDB_CODE_RPC_REDIRECT
)
{
pContext
->
numOfTry
=
0
;
pContext
->
numOfTry
=
0
;
memcpy
(
&
pContext
->
ipSet
,
pHead
->
content
,
sizeof
(
pContext
->
i
pSet
));
memcpy
(
&
pContext
->
epSet
,
pHead
->
content
,
sizeof
(
pContext
->
e
pSet
));
tDebug
(
"%s, redirect is received, numOf
Ips:%d"
,
pConn
->
info
,
pContext
->
ipSet
.
numOfI
ps
);
tDebug
(
"%s, redirect is received, numOf
Eps:%d"
,
pConn
->
info
,
pContext
->
epSet
.
numOfE
ps
);
for
(
int
i
=
0
;
i
<
pContext
->
ipSet
.
numOfI
ps
;
++
i
)
for
(
int
i
=
0
;
i
<
pContext
->
epSet
.
numOfE
ps
;
++
i
)
pContext
->
ipSet
.
port
[
i
]
=
htons
(
pContext
->
i
pSet
.
port
[
i
]);
pContext
->
epSet
.
port
[
i
]
=
htons
(
pContext
->
e
pSet
.
port
[
i
]);
rpcSendReqToServer
(
pRpc
,
pContext
);
rpcSendReqToServer
(
pRpc
,
pContext
);
rpcFreeCont
(
rpcMsg
.
pCont
);
rpcFreeCont
(
rpcMsg
.
pCont
);
}
else
if
(
pHead
->
code
==
TSDB_CODE_RPC_NOT_READY
)
{
}
else
if
(
pHead
->
code
==
TSDB_CODE_RPC_NOT_READY
)
{
...
@@ -1269,7 +1269,7 @@ static void rpcProcessConnError(void *param, void *id) {
...
@@ -1269,7 +1269,7 @@ static void rpcProcessConnError(void *param, void *id) {
tDebug
(
"%s %p, connection error happens"
,
pRpc
->
label
,
pContext
->
ahandle
);
tDebug
(
"%s %p, connection error happens"
,
pRpc
->
label
,
pContext
->
ahandle
);
if
(
pContext
->
numOfTry
>=
pContext
->
ipSet
.
numOfI
ps
)
{
if
(
pContext
->
numOfTry
>=
pContext
->
epSet
.
numOfE
ps
)
{
rpcMsg
.
msgType
=
pContext
->
msgType
+
1
;
rpcMsg
.
msgType
=
pContext
->
msgType
+
1
;
rpcMsg
.
ahandle
=
pContext
->
ahandle
;
rpcMsg
.
ahandle
=
pContext
->
ahandle
;
rpcMsg
.
code
=
pContext
->
code
;
rpcMsg
.
code
=
pContext
->
code
;
...
@@ -1279,8 +1279,8 @@ static void rpcProcessConnError(void *param, void *id) {
...
@@ -1279,8 +1279,8 @@ static void rpcProcessConnError(void *param, void *id) {
rpcNotifyClient
(
pContext
,
&
rpcMsg
);
rpcNotifyClient
(
pContext
,
&
rpcMsg
);
}
else
{
}
else
{
// move to next IP
// move to next IP
pContext
->
i
pSet
.
inUse
++
;
pContext
->
e
pSet
.
inUse
++
;
pContext
->
ipSet
.
inUse
=
pContext
->
ipSet
.
inUse
%
pContext
->
ipSet
.
numOfI
ps
;
pContext
->
epSet
.
inUse
=
pContext
->
epSet
.
inUse
%
pContext
->
epSet
.
numOfE
ps
;
rpcSendReqToServer
(
pRpc
,
pContext
);
rpcSendReqToServer
(
pRpc
,
pContext
);
}
}
}
}
...
...
src/rpc/test/rclient.c
浏览文件 @
1e21eaff
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
typedef
struct
{
typedef
struct
{
int
index
;
int
index
;
SRpc
IpSet
i
pSet
;
SRpc
EpSet
e
pSet
;
int
num
;
int
num
;
int
numOfReqs
;
int
numOfReqs
;
int
msgSize
;
int
msgSize
;
...
@@ -32,11 +32,11 @@ typedef struct {
...
@@ -32,11 +32,11 @@ typedef struct {
void
*
pRpc
;
void
*
pRpc
;
}
SInfo
;
}
SInfo
;
static
void
processResponse
(
SRpcMsg
*
pMsg
,
SRpc
IpSet
*
pI
pSet
)
{
static
void
processResponse
(
SRpcMsg
*
pMsg
,
SRpc
EpSet
*
pE
pSet
)
{
SInfo
*
pInfo
=
(
SInfo
*
)
pMsg
->
ahandle
;
SInfo
*
pInfo
=
(
SInfo
*
)
pMsg
->
ahandle
;
tDebug
(
"thread:%d, response is received, type:%d contLen:%d code:0x%x"
,
pInfo
->
index
,
pMsg
->
msgType
,
pMsg
->
contLen
,
pMsg
->
code
);
tDebug
(
"thread:%d, response is received, type:%d contLen:%d code:0x%x"
,
pInfo
->
index
,
pMsg
->
msgType
,
pMsg
->
contLen
,
pMsg
->
code
);
if
(
p
IpSet
)
pInfo
->
ipSet
=
*
pI
pSet
;
if
(
p
EpSet
)
pInfo
->
epSet
=
*
pE
pSet
;
rpcFreeCont
(
pMsg
->
pCont
);
rpcFreeCont
(
pMsg
->
pCont
);
sem_post
(
&
pInfo
->
rspSem
);
sem_post
(
&
pInfo
->
rspSem
);
...
@@ -57,7 +57,7 @@ static void *sendRequest(void *param) {
...
@@ -57,7 +57,7 @@ static void *sendRequest(void *param) {
rpcMsg
.
ahandle
=
pInfo
;
rpcMsg
.
ahandle
=
pInfo
;
rpcMsg
.
msgType
=
1
;
rpcMsg
.
msgType
=
1
;
tDebug
(
"thread:%d, send request, contLen:%d num:%d"
,
pInfo
->
index
,
pInfo
->
msgSize
,
pInfo
->
num
);
tDebug
(
"thread:%d, send request, contLen:%d num:%d"
,
pInfo
->
index
,
pInfo
->
msgSize
,
pInfo
->
num
);
rpcSendRequest
(
pInfo
->
pRpc
,
&
pInfo
->
i
pSet
,
&
rpcMsg
);
rpcSendRequest
(
pInfo
->
pRpc
,
&
pInfo
->
e
pSet
,
&
rpcMsg
);
if
(
pInfo
->
num
%
20000
==
0
)
if
(
pInfo
->
num
%
20000
==
0
)
tInfo
(
"thread:%d, %d requests have been sent"
,
pInfo
->
index
,
pInfo
->
num
);
tInfo
(
"thread:%d, %d requests have been sent"
,
pInfo
->
index
,
pInfo
->
num
);
sem_wait
(
&
pInfo
->
rspSem
);
sem_wait
(
&
pInfo
->
rspSem
);
...
@@ -71,7 +71,7 @@ static void *sendRequest(void *param) {
...
@@ -71,7 +71,7 @@ static void *sendRequest(void *param) {
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
SRpcInit
rpcInit
;
SRpcInit
rpcInit
;
SRpc
IpSet
i
pSet
;
SRpc
EpSet
e
pSet
;
int
msgSize
=
128
;
int
msgSize
=
128
;
int
numOfReqs
=
0
;
int
numOfReqs
=
0
;
int
appThreads
=
1
;
int
appThreads
=
1
;
...
@@ -82,12 +82,12 @@ int main(int argc, char *argv[]) {
...
@@ -82,12 +82,12 @@ int main(int argc, char *argv[]) {
pthread_attr_t
thattr
;
pthread_attr_t
thattr
;
// server info
// server info
ipSet
.
numOfI
ps
=
1
;
epSet
.
numOfE
ps
=
1
;
i
pSet
.
inUse
=
0
;
e
pSet
.
inUse
=
0
;
i
pSet
.
port
[
0
]
=
7000
;
e
pSet
.
port
[
0
]
=
7000
;
i
pSet
.
port
[
1
]
=
7000
;
e
pSet
.
port
[
1
]
=
7000
;
strcpy
(
i
pSet
.
fqdn
[
0
],
serverIp
);
strcpy
(
e
pSet
.
fqdn
[
0
],
serverIp
);
strcpy
(
i
pSet
.
fqdn
[
1
],
"192.168.0.1"
);
strcpy
(
e
pSet
.
fqdn
[
1
],
"192.168.0.1"
);
// client info
// client info
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
...
@@ -105,9 +105,9 @@ int main(int argc, char *argv[]) {
...
@@ -105,9 +105,9 @@ int main(int argc, char *argv[]) {
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"-p"
)
==
0
&&
i
<
argc
-
1
)
{
if
(
strcmp
(
argv
[
i
],
"-p"
)
==
0
&&
i
<
argc
-
1
)
{
i
pSet
.
port
[
0
]
=
atoi
(
argv
[
++
i
]);
e
pSet
.
port
[
0
]
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-i"
)
==
0
&&
i
<
argc
-
1
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-i"
)
==
0
&&
i
<
argc
-
1
)
{
tstrncpy
(
ipSet
.
fqdn
[
0
],
argv
[
++
i
],
sizeof
(
i
pSet
.
fqdn
[
0
]));
tstrncpy
(
epSet
.
fqdn
[
0
],
argv
[
++
i
],
sizeof
(
e
pSet
.
fqdn
[
0
]));
}
else
if
(
strcmp
(
argv
[
i
],
"-t"
)
==
0
&&
i
<
argc
-
1
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-t"
)
==
0
&&
i
<
argc
-
1
)
{
rpcInit
.
numOfThreads
=
atoi
(
argv
[
++
i
]);
rpcInit
.
numOfThreads
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-m"
)
==
0
&&
i
<
argc
-
1
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-m"
)
==
0
&&
i
<
argc
-
1
)
{
...
@@ -131,7 +131,7 @@ int main(int argc, char *argv[]) {
...
@@ -131,7 +131,7 @@ int main(int argc, char *argv[]) {
}
else
{
}
else
{
printf
(
"
\n
usage: %s [options]
\n
"
,
argv
[
0
]);
printf
(
"
\n
usage: %s [options]
\n
"
,
argv
[
0
]);
printf
(
" [-i ip]: first server IP address, default is:%s
\n
"
,
serverIp
);
printf
(
" [-i ip]: first server IP address, default is:%s
\n
"
,
serverIp
);
printf
(
" [-p port]: server port number, default is:%d
\n
"
,
i
pSet
.
port
[
0
]);
printf
(
" [-p port]: server port number, default is:%d
\n
"
,
e
pSet
.
port
[
0
]);
printf
(
" [-t threads]: number of rpc threads, default is:%d
\n
"
,
rpcInit
.
numOfThreads
);
printf
(
" [-t threads]: number of rpc threads, default is:%d
\n
"
,
rpcInit
.
numOfThreads
);
printf
(
" [-s sessions]: number of rpc sessions, default is:%d
\n
"
,
rpcInit
.
sessions
);
printf
(
" [-s sessions]: number of rpc sessions, default is:%d
\n
"
,
rpcInit
.
sessions
);
printf
(
" [-m msgSize]: message body size, default is:%d
\n
"
,
msgSize
);
printf
(
" [-m msgSize]: message body size, default is:%d
\n
"
,
msgSize
);
...
@@ -168,7 +168,7 @@ int main(int argc, char *argv[]) {
...
@@ -168,7 +168,7 @@ int main(int argc, char *argv[]) {
for
(
int
i
=
0
;
i
<
appThreads
;
++
i
)
{
for
(
int
i
=
0
;
i
<
appThreads
;
++
i
)
{
pInfo
->
index
=
i
;
pInfo
->
index
=
i
;
pInfo
->
ipSet
=
i
pSet
;
pInfo
->
epSet
=
e
pSet
;
pInfo
->
numOfReqs
=
numOfReqs
;
pInfo
->
numOfReqs
=
numOfReqs
;
pInfo
->
msgSize
=
msgSize
;
pInfo
->
msgSize
=
msgSize
;
sem_init
(
&
pInfo
->
rspSem
,
0
,
0
);
sem_init
(
&
pInfo
->
rspSem
,
0
,
0
);
...
...
src/rpc/test/rsclient.c
浏览文件 @
1e21eaff
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
typedef
struct
{
typedef
struct
{
int
index
;
int
index
;
SRpc
IpSet
i
pSet
;
SRpc
EpSet
e
pSet
;
int
num
;
int
num
;
int
numOfReqs
;
int
numOfReqs
;
int
msgSize
;
int
msgSize
;
...
@@ -51,7 +51,7 @@ static void *sendRequest(void *param) {
...
@@ -51,7 +51,7 @@ static void *sendRequest(void *param) {
rpcMsg
.
msgType
=
1
;
rpcMsg
.
msgType
=
1
;
tDebug
(
"thread:%d, send request, contLen:%d num:%d"
,
pInfo
->
index
,
pInfo
->
msgSize
,
pInfo
->
num
);
tDebug
(
"thread:%d, send request, contLen:%d num:%d"
,
pInfo
->
index
,
pInfo
->
msgSize
,
pInfo
->
num
);
rpcSendRecv
(
pInfo
->
pRpc
,
&
pInfo
->
i
pSet
,
&
rpcMsg
,
&
rspMsg
);
rpcSendRecv
(
pInfo
->
pRpc
,
&
pInfo
->
e
pSet
,
&
rpcMsg
,
&
rspMsg
);
// handle response
// handle response
if
(
rspMsg
.
code
!=
0
)
terror
++
;
if
(
rspMsg
.
code
!=
0
)
terror
++
;
...
@@ -72,7 +72,7 @@ static void *sendRequest(void *param) {
...
@@ -72,7 +72,7 @@ static void *sendRequest(void *param) {
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
SRpcInit
rpcInit
;
SRpcInit
rpcInit
;
SRpc
IpSet
i
pSet
;
SRpc
EpSet
e
pSet
;
int
msgSize
=
128
;
int
msgSize
=
128
;
int
numOfReqs
=
0
;
int
numOfReqs
=
0
;
int
appThreads
=
1
;
int
appThreads
=
1
;
...
@@ -83,12 +83,12 @@ int main(int argc, char *argv[]) {
...
@@ -83,12 +83,12 @@ int main(int argc, char *argv[]) {
pthread_attr_t
thattr
;
pthread_attr_t
thattr
;
// server info
// server info
ipSet
.
numOfI
ps
=
1
;
epSet
.
numOfE
ps
=
1
;
i
pSet
.
inUse
=
0
;
e
pSet
.
inUse
=
0
;
i
pSet
.
port
[
0
]
=
7000
;
e
pSet
.
port
[
0
]
=
7000
;
i
pSet
.
port
[
1
]
=
7000
;
e
pSet
.
port
[
1
]
=
7000
;
strcpy
(
i
pSet
.
fqdn
[
0
],
serverIp
);
strcpy
(
e
pSet
.
fqdn
[
0
],
serverIp
);
strcpy
(
i
pSet
.
fqdn
[
1
],
"192.168.0.1"
);
strcpy
(
e
pSet
.
fqdn
[
1
],
"192.168.0.1"
);
// client info
// client info
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
...
@@ -106,9 +106,9 @@ int main(int argc, char *argv[]) {
...
@@ -106,9 +106,9 @@ int main(int argc, char *argv[]) {
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"-p"
)
==
0
&&
i
<
argc
-
1
)
{
if
(
strcmp
(
argv
[
i
],
"-p"
)
==
0
&&
i
<
argc
-
1
)
{
i
pSet
.
port
[
0
]
=
atoi
(
argv
[
++
i
]);
e
pSet
.
port
[
0
]
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-i"
)
==
0
&&
i
<
argc
-
1
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-i"
)
==
0
&&
i
<
argc
-
1
)
{
tstrncpy
(
ipSet
.
fqdn
[
0
],
argv
[
++
i
],
sizeof
(
i
pSet
.
fqdn
[
0
]));
tstrncpy
(
epSet
.
fqdn
[
0
],
argv
[
++
i
],
sizeof
(
e
pSet
.
fqdn
[
0
]));
}
else
if
(
strcmp
(
argv
[
i
],
"-t"
)
==
0
&&
i
<
argc
-
1
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-t"
)
==
0
&&
i
<
argc
-
1
)
{
rpcInit
.
numOfThreads
=
atoi
(
argv
[
++
i
]);
rpcInit
.
numOfThreads
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-m"
)
==
0
&&
i
<
argc
-
1
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-m"
)
==
0
&&
i
<
argc
-
1
)
{
...
@@ -132,7 +132,7 @@ int main(int argc, char *argv[]) {
...
@@ -132,7 +132,7 @@ int main(int argc, char *argv[]) {
}
else
{
}
else
{
printf
(
"
\n
usage: %s [options]
\n
"
,
argv
[
0
]);
printf
(
"
\n
usage: %s [options]
\n
"
,
argv
[
0
]);
printf
(
" [-i ip]: first server IP address, default is:%s
\n
"
,
serverIp
);
printf
(
" [-i ip]: first server IP address, default is:%s
\n
"
,
serverIp
);
printf
(
" [-p port]: server port number, default is:%d
\n
"
,
i
pSet
.
port
[
0
]);
printf
(
" [-p port]: server port number, default is:%d
\n
"
,
e
pSet
.
port
[
0
]);
printf
(
" [-t threads]: number of rpc threads, default is:%d
\n
"
,
rpcInit
.
numOfThreads
);
printf
(
" [-t threads]: number of rpc threads, default is:%d
\n
"
,
rpcInit
.
numOfThreads
);
printf
(
" [-s sessions]: number of rpc sessions, default is:%d
\n
"
,
rpcInit
.
sessions
);
printf
(
" [-s sessions]: number of rpc sessions, default is:%d
\n
"
,
rpcInit
.
sessions
);
printf
(
" [-m msgSize]: message body size, default is:%d
\n
"
,
msgSize
);
printf
(
" [-m msgSize]: message body size, default is:%d
\n
"
,
msgSize
);
...
@@ -168,7 +168,7 @@ int main(int argc, char *argv[]) {
...
@@ -168,7 +168,7 @@ int main(int argc, char *argv[]) {
for
(
int
i
=
0
;
i
<
appThreads
;
++
i
)
{
for
(
int
i
=
0
;
i
<
appThreads
;
++
i
)
{
pInfo
->
index
=
i
;
pInfo
->
index
=
i
;
pInfo
->
ipSet
=
i
pSet
;
pInfo
->
epSet
=
e
pSet
;
pInfo
->
numOfReqs
=
numOfReqs
;
pInfo
->
numOfReqs
=
numOfReqs
;
pInfo
->
msgSize
=
msgSize
;
pInfo
->
msgSize
=
msgSize
;
sem_init
(
&
pInfo
->
rspSem
,
0
,
0
);
sem_init
(
&
pInfo
->
rspSem
,
0
,
0
);
...
...
src/rpc/test/rserver.c
浏览文件 @
1e21eaff
...
@@ -103,7 +103,7 @@ int retrieveAuthInfo(char *meterId, char *spi, char *encrypt, char *secret, char
...
@@ -103,7 +103,7 @@ int retrieveAuthInfo(char *meterId, char *spi, char *encrypt, char *secret, char
return
ret
;
return
ret
;
}
}
void
processRequestMsg
(
SRpcMsg
*
pMsg
,
SRpc
IpSet
*
pI
pSet
)
{
void
processRequestMsg
(
SRpcMsg
*
pMsg
,
SRpc
EpSet
*
pE
pSet
)
{
SRpcMsg
*
pTemp
;
SRpcMsg
*
pTemp
;
pTemp
=
taosAllocateQitem
(
sizeof
(
SRpcMsg
));
pTemp
=
taosAllocateQitem
(
sizeof
(
SRpcMsg
));
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
1e21eaff
...
@@ -148,7 +148,7 @@ void tsdbCloseRepo(TSDB_REPO_T *repo, int toCommit) {
...
@@ -148,7 +148,7 @@ void tsdbCloseRepo(TSDB_REPO_T *repo, int toCommit) {
STsdbRepo
*
pRepo
=
(
STsdbRepo
*
)
repo
;
STsdbRepo
*
pRepo
=
(
STsdbRepo
*
)
repo
;
int
vgId
=
REPO_ID
(
pRepo
);
int
vgId
=
REPO_ID
(
pRepo
);
tsdbStopStream
(
r
epo
);
tsdbStopStream
(
pR
epo
);
if
(
toCommit
)
{
if
(
toCommit
)
{
tsdbAsyncCommit
(
pRepo
);
tsdbAsyncCommit
(
pRepo
);
...
@@ -1126,6 +1126,7 @@ static void tsdbStartStream(STsdbRepo *pRepo) {
...
@@ -1126,6 +1126,7 @@ static void tsdbStartStream(STsdbRepo *pRepo) {
}
}
}
}
static
void
tsdbStopStream
(
STsdbRepo
*
pRepo
)
{
static
void
tsdbStopStream
(
STsdbRepo
*
pRepo
)
{
STsdbMeta
*
pMeta
=
pRepo
->
tsdbMeta
;
STsdbMeta
*
pMeta
=
pRepo
->
tsdbMeta
;
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
1e21eaff
...
@@ -107,7 +107,7 @@ typedef struct STsdbQueryHandle {
...
@@ -107,7 +107,7 @@ typedef struct STsdbQueryHandle {
bool
locateStart
;
bool
locateStart
;
int32_t
outputCapacity
;
int32_t
outputCapacity
;
int32_t
realNumOfRows
;
int32_t
realNumOfRows
;
SArray
*
pTableCheckInfo
;
//SArray<STableCheckInfo>
SArray
*
pTableCheckInfo
;
//
SArray<STableCheckInfo>
int32_t
activeIndex
;
int32_t
activeIndex
;
bool
checkFiles
;
// check file stage
bool
checkFiles
;
// check file stage
void
*
qinfo
;
// query info handle, for debug purpose
void
*
qinfo
;
// query info handle, for debug purpose
...
@@ -191,6 +191,7 @@ TsdbQueryHandleT* tsdbQueryTables(TSDB_REPO_T* tsdb, STsdbQueryCond* pCond, STab
...
@@ -191,6 +191,7 @@ TsdbQueryHandleT* tsdbQueryTables(TSDB_REPO_T* tsdb, STsdbQueryCond* pCond, STab
free
(
pQueryHandle
);
free
(
pQueryHandle
);
return
NULL
;
return
NULL
;
}
}
tsdbTakeMemSnapshot
(
pQueryHandle
->
pTsdb
,
&
pQueryHandle
->
mem
,
&
pQueryHandle
->
imem
);
tsdbTakeMemSnapshot
(
pQueryHandle
->
pTsdb
,
&
pQueryHandle
->
mem
,
&
pQueryHandle
->
imem
);
size_t
sizeOfGroup
=
taosArrayGetSize
(
groupList
->
pGroupList
);
size_t
sizeOfGroup
=
taosArrayGetSize
(
groupList
->
pGroupList
);
...
@@ -348,6 +349,11 @@ static bool initTableMemIterator(STsdbQueryHandle* pHandle, STableCheckInfo* pCh
...
@@ -348,6 +349,11 @@ static bool initTableMemIterator(STsdbQueryHandle* pHandle, STableCheckInfo* pCh
return
true
;
return
true
;
}
}
static
void
destroyTableMemIterator
(
STableCheckInfo
*
pCheckInfo
)
{
tSkipListDestroyIter
(
pCheckInfo
->
iter
);
tSkipListDestroyIter
(
pCheckInfo
->
iiter
);
}
SDataRow
getSDataRowInTableMem
(
STableCheckInfo
*
pCheckInfo
)
{
SDataRow
getSDataRowInTableMem
(
STableCheckInfo
*
pCheckInfo
)
{
SDataRow
rmem
=
NULL
,
rimem
=
NULL
;
SDataRow
rmem
=
NULL
,
rimem
=
NULL
;
if
(
pCheckInfo
->
iter
)
{
if
(
pCheckInfo
->
iter
)
{
...
@@ -1525,7 +1531,7 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
...
@@ -1525,7 +1531,7 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
pQueryHandle
->
cur
.
win
=
(
STimeWindow
){
pQueryHandle
->
window
.
skey
,
pQueryHandle
->
window
.
skey
};
pQueryHandle
->
cur
.
win
=
(
STimeWindow
){
pQueryHandle
->
window
.
skey
,
pQueryHandle
->
window
.
skey
};
pQueryHandle
->
window
=
pQueryHandle
->
cur
.
win
;
pQueryHandle
->
window
=
pQueryHandle
->
cur
.
win
;
pQueryHandle
->
cur
.
rows
=
1
;
pQueryHandle
->
cur
.
rows
=
1
;
pQueryHandle
->
type
=
TSDB_QUERY_TYPE_
EXTERNA
L
;
pQueryHandle
->
type
=
TSDB_QUERY_TYPE_
AL
L
;
return
true
;
return
true
;
}
else
{
}
else
{
STsdbQueryHandle
*
pSecQueryHandle
=
calloc
(
1
,
sizeof
(
STsdbQueryHandle
));
STsdbQueryHandle
*
pSecQueryHandle
=
calloc
(
1
,
sizeof
(
STsdbQueryHandle
));
...
@@ -1543,6 +1549,7 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
...
@@ -1543,6 +1549,7 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
free
(
pSecQueryHandle
);
free
(
pSecQueryHandle
);
return
false
;
return
false
;
}
}
tsdbTakeMemSnapshot
(
pSecQueryHandle
->
pTsdb
,
&
pSecQueryHandle
->
mem
,
&
pSecQueryHandle
->
imem
);
tsdbTakeMemSnapshot
(
pSecQueryHandle
->
pTsdb
,
&
pSecQueryHandle
->
mem
,
&
pSecQueryHandle
->
imem
);
// allocate buffer in order to load data blocks from file
// allocate buffer in order to load data blocks from file
...
@@ -1567,7 +1574,6 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
...
@@ -1567,7 +1574,6 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
for
(
int32_t
j
=
0
;
j
<
si
;
++
j
)
{
for
(
int32_t
j
=
0
;
j
<
si
;
++
j
)
{
STableCheckInfo
*
pCheckInfo
=
(
STableCheckInfo
*
)
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
j
);
STableCheckInfo
*
pCheckInfo
=
(
STableCheckInfo
*
)
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
j
);
STableCheckInfo
info
=
{
STableCheckInfo
info
=
{
.
lastKey
=
pSecQueryHandle
->
window
.
skey
,
.
lastKey
=
pSecQueryHandle
->
window
.
skey
,
.
tableId
=
pCheckInfo
->
tableId
,
.
tableId
=
pCheckInfo
->
tableId
,
...
@@ -1584,8 +1590,8 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
...
@@ -1584,8 +1590,8 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
bool
ret
=
tsdbNextDataBlock
((
void
*
)
pSecQueryHandle
);
bool
ret
=
tsdbNextDataBlock
((
void
*
)
pSecQueryHandle
);
assert
(
ret
);
assert
(
ret
);
/*SDataBlockInfo* pBlockInfo =*/
tsdbRetrieveDataBlockInfo
((
void
*
)
pSecQueryHandle
,
&
blockInfo
);
tsdbRetrieveDataBlockInfo
((
void
*
)
pSecQueryHandle
,
&
blockInfo
);
/*SArray *pDataBlock = */
tsdbRetrieveDataBlock
((
void
*
)
pSecQueryHandle
,
pSecQueryHandle
->
defaultLoadColumn
);
tsdbRetrieveDataBlock
((
void
*
)
pSecQueryHandle
,
pSecQueryHandle
->
defaultLoadColumn
);
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
*
pCol
=
taosArrayGet
(
pQueryHandle
->
pColumns
,
i
);
SColumnInfoData
*
pCol
=
taosArrayGet
(
pQueryHandle
->
pColumns
,
i
);
...
@@ -1598,15 +1604,26 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
...
@@ -1598,15 +1604,26 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
}
}
SColumnInfoData
*
pTSCol
=
taosArrayGet
(
pQueryHandle
->
pColumns
,
0
);
SColumnInfoData
*
pTSCol
=
taosArrayGet
(
pQueryHandle
->
pColumns
,
0
);
// it is ascending order
pQueryHandle
->
cur
.
win
=
(
STimeWindow
){((
TSKEY
*
)
pTSCol
->
pData
)[
0
],
((
TSKEY
*
)
pTSCol
->
pData
)[
1
]};
pQueryHandle
->
cur
.
win
=
(
STimeWindow
){((
TSKEY
*
)
pTSCol
->
pData
)[
0
],
((
TSKEY
*
)
pTSCol
->
pData
)[
1
]};
pQueryHandle
->
window
=
pQueryHandle
->
cur
.
win
;
pQueryHandle
->
window
=
pQueryHandle
->
cur
.
win
;
pQueryHandle
->
cur
.
rows
=
2
;
pQueryHandle
->
cur
.
rows
=
2
;
pQueryHandle
->
cur
.
mixBlock
=
true
;
pQueryHandle
->
order
=
TSDB_ORDER_DESC
;
int32_t
step
=
-
1
;
// one step for ascending order traverse
for
(
int32_t
j
=
0
;
j
<
si
;
++
j
)
{
STableCheckInfo
*
pCheckInfo
=
(
STableCheckInfo
*
)
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
j
);
pCheckInfo
->
lastKey
=
pQueryHandle
->
cur
.
win
.
ekey
+
step
;
}
tsdbCleanupQueryHandle
(
pSecQueryHandle
);
tsdbCleanupQueryHandle
(
pSecQueryHandle
);
}
}
//disable it after retrieve data
pQueryHandle
->
type
=
TSDB_QUERY_TYPE_EXTERNAL
;
pQueryHandle
->
type
=
TSDB_QUERY_TYPE_EXTERNAL
;
pQueryHandle
->
checkFiles
=
false
;
return
true
;
return
true
;
}
}
...
@@ -2355,7 +2372,7 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle) {
...
@@ -2355,7 +2372,7 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle) {
size_t
size
=
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
);
size_t
size
=
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
STableCheckInfo
*
pTableCheckInfo
=
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
i
);
STableCheckInfo
*
pTableCheckInfo
=
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
i
);
tSkipListDestroyIter
(
pTableCheckInfo
->
iter
);
destroyTableMemIterator
(
pTableCheckInfo
);
if
(
pTableCheckInfo
->
pDataCols
!=
NULL
)
{
if
(
pTableCheckInfo
->
pDataCols
!=
NULL
)
{
tfree
(
pTableCheckInfo
->
pDataCols
->
buf
);
tfree
(
pTableCheckInfo
->
pDataCols
->
buf
);
...
@@ -2391,7 +2408,7 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle) {
...
@@ -2391,7 +2408,7 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle) {
tfree
(
pQueryHandle
);
tfree
(
pQueryHandle
);
}
}
void
tsdbDest
or
yTableGroup
(
STableGroupInfo
*
pGroupList
)
{
void
tsdbDest
ro
yTableGroup
(
STableGroupInfo
*
pGroupList
)
{
assert
(
pGroupList
!=
NULL
);
assert
(
pGroupList
!=
NULL
);
size_t
numOfGroup
=
taosArrayGetSize
(
pGroupList
->
pGroupList
);
size_t
numOfGroup
=
taosArrayGetSize
(
pGroupList
->
pGroupList
);
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
1e21eaff
...
@@ -340,6 +340,13 @@ void vnodeRelease(void *pVnodeRaw) {
...
@@ -340,6 +340,13 @@ void vnodeRelease(void *pVnodeRaw) {
tsdbCloseRepo
(
pVnode
->
tsdb
,
1
);
tsdbCloseRepo
(
pVnode
->
tsdb
,
1
);
pVnode
->
tsdb
=
NULL
;
pVnode
->
tsdb
=
NULL
;
// stop continuous query
if
(
pVnode
->
cq
)
{
void
*
cq
=
pVnode
->
cq
;
pVnode
->
cq
=
NULL
;
cqClose
(
cq
);
}
if
(
pVnode
->
wal
)
if
(
pVnode
->
wal
)
walClose
(
pVnode
->
wal
);
walClose
(
pVnode
->
wal
);
pVnode
->
wal
=
NULL
;
pVnode
->
wal
=
NULL
;
...
@@ -511,13 +518,6 @@ static void vnodeCleanUp(SVnodeObj *pVnode) {
...
@@ -511,13 +518,6 @@ static void vnodeCleanUp(SVnodeObj *pVnode) {
syncStop
(
sync
);
syncStop
(
sync
);
}
}
// stop continuous query
if
(
pVnode
->
cq
)
{
void
*
cq
=
pVnode
->
cq
;
pVnode
->
cq
=
NULL
;
cqClose
(
cq
);
}
vTrace
(
"vgId:%d, vnode will cleanup, refCount:%d"
,
pVnode
->
vgId
,
pVnode
->
refCount
);
vTrace
(
"vgId:%d, vnode will cleanup, refCount:%d"
,
pVnode
->
vgId
,
pVnode
->
refCount
);
// release local resources only after cutting off outside connections
// release local resources only after cutting off outside connections
...
...
tests/comparisonTest/tdengine/q5.txt
0 → 100644
浏览文件 @
1e21eaff
select * from db.devices;
tests/comparisonTest/tdengine/tdengineTest.c
浏览文件 @
1e21eaff
...
@@ -13,8 +13,9 @@ typedef struct {
...
@@ -13,8 +13,9 @@ typedef struct {
char
sql
[
256
];
char
sql
[
256
];
char
dataDir
[
256
];
char
dataDir
[
256
];
int
filesNum
;
int
filesNum
;
int
writeC
lients
;
int
c
lients
;
int
rowsPerRequest
;
int
rowsPerRequest
;
int
write
;
}
ProArgs
;
}
ProArgs
;
typedef
struct
{
typedef
struct
{
...
@@ -41,7 +42,7 @@ int main(int argc, char *argv[]) {
...
@@ -41,7 +42,7 @@ int main(int argc, char *argv[]) {
statis
.
totalRows
=
0
;
statis
.
totalRows
=
0
;
parseArg
(
argc
,
argv
);
parseArg
(
argc
,
argv
);
if
(
arguments
.
write
Clients
>
0
)
{
if
(
arguments
.
write
)
{
writeData
();
writeData
();
}
else
{
}
else
{
readData
();
readData
();
...
@@ -52,7 +53,7 @@ void parseArg(int argc, char *argv[]) {
...
@@ -52,7 +53,7 @@ void parseArg(int argc, char *argv[]) {
strcpy
(
arguments
.
sql
,
"./sqlCmd.txt"
);
strcpy
(
arguments
.
sql
,
"./sqlCmd.txt"
);
strcpy
(
arguments
.
dataDir
,
"./testdata"
);
strcpy
(
arguments
.
dataDir
,
"./testdata"
);
arguments
.
filesNum
=
2
;
arguments
.
filesNum
=
2
;
arguments
.
writeClients
=
0
;
arguments
.
clients
=
1
;
arguments
.
rowsPerRequest
=
100
;
arguments
.
rowsPerRequest
=
100
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
...
@@ -83,12 +84,12 @@ void parseArg(int argc, char *argv[]) {
...
@@ -83,12 +84,12 @@ void parseArg(int argc, char *argv[]) {
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
else
if
(
strcmp
(
argv
[
i
],
"-
writeC
lients"
)
==
0
)
{
else
if
(
strcmp
(
argv
[
i
],
"-
c
lients"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
if
(
i
<
argc
-
1
)
{
arguments
.
writeC
lients
=
atoi
(
argv
[
++
i
]);
arguments
.
c
lients
=
atoi
(
argv
[
++
i
]);
}
}
else
{
else
{
fprintf
(
stderr
,
"'-
writeClients' requires a parameter, default:%d
\n
"
,
arguments
.
writeC
lients
);
fprintf
(
stderr
,
"'-
clients' requires a parameter, default:%d
\n
"
,
arguments
.
c
lients
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
...
@@ -101,6 +102,9 @@ void parseArg(int argc, char *argv[]) {
...
@@ -101,6 +102,9 @@ void parseArg(int argc, char *argv[]) {
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
else
if
(
strcmp
(
argv
[
i
],
"-w"
)
==
0
)
{
arguments
.
write
=
1
;
}
}
}
}
}
...
@@ -215,7 +219,7 @@ void writeDataImp(void *param) {
...
@@ -215,7 +219,7 @@ void writeDataImp(void *param) {
void
writeData
()
{
void
writeData
()
{
printf
(
"write data
\n
"
);
printf
(
"write data
\n
"
);
printf
(
"----
writeClients: %d
\n
"
,
arguments
.
writeC
lients
);
printf
(
"----
clients: %d
\n
"
,
arguments
.
c
lients
);
printf
(
"---- dataDir: %s
\n
"
,
arguments
.
dataDir
);
printf
(
"---- dataDir: %s
\n
"
,
arguments
.
dataDir
);
printf
(
"---- numOfFiles: %d
\n
"
,
arguments
.
filesNum
);
printf
(
"---- numOfFiles: %d
\n
"
,
arguments
.
filesNum
);
printf
(
"---- rowsPerRequest: %d
\n
"
,
arguments
.
rowsPerRequest
);
printf
(
"---- rowsPerRequest: %d
\n
"
,
arguments
.
rowsPerRequest
);
...
@@ -243,12 +247,12 @@ void writeData() {
...
@@ -243,12 +247,12 @@ void writeData() {
int64_t
st
=
getTimeStampMs
();
int64_t
st
=
getTimeStampMs
();
int
a
=
arguments
.
filesNum
/
arguments
.
writeC
lients
;
int
a
=
arguments
.
filesNum
/
arguments
.
c
lients
;
int
b
=
arguments
.
filesNum
%
arguments
.
writeC
lients
;
int
b
=
arguments
.
filesNum
%
arguments
.
c
lients
;
int
last
=
0
;
int
last
=
0
;
ThreadObj
*
threads
=
calloc
((
size_t
)
arguments
.
writeC
lients
,
sizeof
(
ThreadObj
));
ThreadObj
*
threads
=
calloc
((
size_t
)
arguments
.
c
lients
,
sizeof
(
ThreadObj
));
for
(
int
i
=
0
;
i
<
arguments
.
writeC
lients
;
++
i
)
{
for
(
int
i
=
0
;
i
<
arguments
.
c
lients
;
++
i
)
{
ThreadObj
*
pthread
=
threads
+
i
;
ThreadObj
*
pthread
=
threads
+
i
;
pthread_attr_t
thattr
;
pthread_attr_t
thattr
;
pthread
->
threadId
=
i
+
1
;
pthread
->
threadId
=
i
+
1
;
...
@@ -264,7 +268,7 @@ void writeData() {
...
@@ -264,7 +268,7 @@ void writeData() {
pthread_create
(
&
pthread
->
pid
,
&
thattr
,
(
void
*
(
*
)(
void
*
))
writeDataImp
,
pthread
);
pthread_create
(
&
pthread
->
pid
,
&
thattr
,
(
void
*
(
*
)(
void
*
))
writeDataImp
,
pthread
);
}
}
for
(
int
i
=
0
;
i
<
arguments
.
writeC
lients
;
i
++
)
{
for
(
int
i
=
0
;
i
<
arguments
.
c
lients
;
i
++
)
{
pthread_join
(
threads
[
i
].
pid
,
NULL
);
pthread_join
(
threads
[
i
].
pid
,
NULL
);
}
}
...
@@ -272,17 +276,15 @@ void writeData() {
...
@@ -272,17 +276,15 @@ void writeData() {
float
seconds
=
(
float
)
elapsed
/
1000
;
float
seconds
=
(
float
)
elapsed
/
1000
;
float
rs
=
(
float
)
statis
.
totalRows
/
seconds
;
float
rs
=
(
float
)
statis
.
totalRows
/
seconds
;
free
(
threads
);
printf
(
"---- Spent %f seconds to insert %ld records, speed: %f Rows/Second
\n
"
,
seconds
,
statis
.
totalRows
,
rs
);
printf
(
"---- Spent %f seconds to insert %ld records, speed: %f Rows/Second
\n
"
,
seconds
,
statis
.
totalRows
,
rs
);
}
}
void
readData
()
{
void
readDataImp
(
void
*
param
)
printf
(
"read data
\n
"
);
{
printf
(
"---- sql: %s
\n
"
,
arguments
.
sql
);
ThreadObj
*
pThread
=
(
ThreadObj
*
)
param
;
printf
(
"Thread %d
\n
"
,
pThread
->
threadId
);
void
*
taos
=
taos_connect
(
"127.0.0.1"
,
"root"
,
"taosdata"
,
NULL
,
0
);
if
(
taos
==
NULL
)
taos_error
(
taos
);
FILE
*
fp
=
fopen
(
arguments
.
sql
,
"r"
);
FILE
*
fp
=
fopen
(
arguments
.
sql
,
"r"
);
if
(
fp
==
NULL
)
{
if
(
fp
==
NULL
)
{
printf
(
"failed to open file %s
\n
"
,
arguments
.
sql
);
printf
(
"failed to open file %s
\n
"
,
arguments
.
sql
);
...
@@ -290,6 +292,10 @@ void readData() {
...
@@ -290,6 +292,10 @@ void readData() {
}
}
printf
(
"open file %s success
\n
"
,
arguments
.
sql
);
printf
(
"open file %s success
\n
"
,
arguments
.
sql
);
void
*
taos
=
taos_connect
(
"127.0.0.1"
,
"root"
,
"taosdata"
,
NULL
,
0
);
if
(
taos
==
NULL
)
taos_error
(
taos
);
char
*
line
=
NULL
;
char
*
line
=
NULL
;
size_t
len
=
0
;
size_t
len
=
0
;
while
(
!
feof
(
fp
))
{
while
(
!
feof
(
fp
))
{
...
@@ -325,9 +331,36 @@ void readData() {
...
@@ -325,9 +331,36 @@ void readData() {
int64_t
elapsed
=
getTimeStampMs
()
-
st
;
int64_t
elapsed
=
getTimeStampMs
()
-
st
;
float
seconds
=
(
float
)
elapsed
/
1000
;
float
seconds
=
(
float
)
elapsed
/
1000
;
printf
(
"---- Spent %f seconds to
query: %s"
,
seconds
,
line
);
printf
(
"---- Spent %f seconds to
retrieve %d records, Thread:%d query: %s
\n
"
,
seconds
,
rows
,
pThread
->
threadId
,
line
);
}
}
fclose
(
fp
);
fclose
(
fp
);
}
}
void
readData
()
{
printf
(
"read data
\n
"
);
printf
(
"---- sql: %s
\n
"
,
arguments
.
sql
);
printf
(
"---- clients: %d
\n
"
,
arguments
.
clients
);
void
*
taos
=
taos_connect
(
"127.0.0.1"
,
"root"
,
"taosdata"
,
NULL
,
0
);
if
(
taos
==
NULL
)
taos_error
(
taos
);
ThreadObj
*
threads
=
calloc
((
size_t
)
arguments
.
clients
,
sizeof
(
ThreadObj
));
for
(
int
i
=
0
;
i
<
arguments
.
clients
;
++
i
)
{
ThreadObj
*
pthread
=
threads
+
i
;
pthread_attr_t
thattr
;
pthread
->
threadId
=
i
+
1
;
pthread_attr_init
(
&
thattr
);
pthread_attr_setdetachstate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
pthread_create
(
&
pthread
->
pid
,
&
thattr
,
(
void
*
(
*
)(
void
*
))
readDataImp
,
pthread
);
}
for
(
int
i
=
0
;
i
<
arguments
.
clients
;
i
++
)
{
pthread_join
(
threads
[
i
].
pid
,
NULL
);
}
free
(
threads
);
}
tests/perftest-scripts/tdengineTestQ1Loop.sh
0 → 100755
浏览文件 @
1e21eaff
#!/bin/bash
DATA_DIR
=
/mnt/root/testdata
NUM_LOOP
=
5
function
printTo
{
if
$verbose
;
then
echo
$1
fi
}
TDTESTQ1OUT
=
tdengineTestQ1.out
function
runTest
{
totalG0
=
0
totalG10
=
0
totalG20
=
0
totalG30
=
0
totalG40
=
0
totalG50
=
0
totalG60
=
0
totalG70
=
0
totalG80
=
0
totalG90
=
0
for
i
in
`
seq
1
$NUM_LOOP
`
;
do
printTo
"loop i:
$i
,
$TDTEST_DIR
/tdengineTest
\
-sql q1.txt"
restartTaosd
$TDTEST_DIR
/tdengineTest
\
-sql
$TDTEST_DIR
/q1.txt
>
$TDTESTQ1OUT
G0
=
`
grep
"devgroup=0"
$TDTESTQ1OUT
|
awk
'{print $3}'
`
totalG0
=
`
echo
"scale=4;
$totalG0
+
$G0
"
| bc
`
printTo
"i:
$i
, G0:
$G0
, totalG0:
$totalG0
"
G10
=
`
grep
"devgroup=10"
$TDTESTQ1OUT
|
awk
'{print $3}'
`
totalG10
=
`
echo
"scale=4;
$totalG10
+
$G10
"
| bc
`
printTo
"i:
$i
, G10:
$G10
, totalG10:
$totalG10
"
G20
=
`
grep
"devgroup=20"
$TDTESTQ1OUT
|
awk
'{print $3}'
`
totalG20
=
`
echo
"scale=4;
$totalG20
+
$G20
"
| bc
`
G30
=
`
grep
"devgroup=30"
$TDTESTQ1OUT
|
awk
'{print $3}'
`
totalG30
=
`
echo
"scale=4;
$totalG30
+
$G30
"
| bc
`
G40
=
`
grep
"devgroup=40"
$TDTESTQ1OUT
|
awk
'{print $3}'
`
totalG40
=
`
echo
"scale=4;
$totalG40
+
$G40
"
| bc
`
G50
=
`
grep
"devgroup=50"
$TDTESTQ1OUT
|
awk
'{print $3}'
`
totalG50
=
`
echo
"scale=4;
$totalG50
+
$G50
"
| bc
`
G60
=
`
grep
"devgroup=60"
$TDTESTQ1OUT
|
awk
'{print $3}'
`
totalG60
=
`
echo
"scale=4;
$totalG60
+
$G60
"
| bc
`
G70
=
`
grep
"devgroup=70"
$TDTESTQ1OUT
|
awk
'{print $3}'
`
totalG70
=
`
echo
"scale=4;
$totalG70
+
$G70
"
| bc
`
G80
=
`
grep
"devgroup=80"
$TDTESTQ1OUT
|
awk
'{print $3}'
`
totalG80
=
`
echo
"scale=4;
$totalG80
+
$G80
"
| bc
`
G90
=
`
grep
"devgroup=90"
$TDTESTQ1OUT
|
awk
'{print $3}'
`
totalG90
=
`
echo
"scale=4;
$totalG90
+
$G90
"
| bc
`
printTo
"i:
$i
, G90:
$G90
, totalG90:
$totalG90
"
done
avgG0
=
`
echo
"scale=4; x =
$totalG0
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG10
=
`
echo
"scale=4; x =
$totalG10
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG20
=
`
echo
"scale=4; x =
$totalG20
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG30
=
`
echo
"scale=4; x =
$totalG30
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG40
=
`
echo
"scale=4; x =
$totalG40
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG50
=
`
echo
"scale=4; x =
$totalG50
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG60
=
`
echo
"scale=4; x =
$totalG60
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG70
=
`
echo
"scale=4; x =
$totalG70
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG80
=
`
echo
"scale=4; x =
$totalG80
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG90
=
`
echo
"scale=4; x =
$totalG90
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
echo
"Latency, G-0, G-10, G-20, G-30, G-40, G-50, G-60, G-70, G-80, G-90"
echo
"TDengine,
$avgG0
,
$avgG10
,
$avgG20
,
$avgG30
,
$avgG40
,
$avgG50
,
$avgG60
,
$avgG70
,
$avgG80
,
$avgG90
"
}
function
restartTaosd
{
printTo
"Stop taosd"
systemctl stop taosd
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
while
[
-n
"
$PID
"
]
do
pkill
-TERM
-x
taosd
sleep
1
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
done
printTo
"Start taosd"
$TAOSD_DIR
/taosd
>
/dev/null 2>&1 &
sleep
10
}
################ Main ################
master
=
false
develop
=
true
verbose
=
false
for
arg
in
"
$@
"
do
case
$arg
in
-v
)
verbose
=
true
;;
master
)
master
=
true
develop
=
false
;;
develop
)
master
=
false
develop
=
true
;;
*
)
;;
esac
done
if
$master
;
then
echo
"Test master branch.."
cp
/mnt/root/cfg/master/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine.master
else
echo
"Test develop branch.."
cp
/mnt/root/cfg/10billion/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine
fi
TAOSD_DIR
=
$WORK_DIR
/debug/build/bin
TDTEST_DIR
=
$WORK_DIR
/tests/comparisonTest/tdengine
runTest
echo
"Test done!"
tests/perftest-scripts/tdengineTestQ2Loop.sh
0 → 100755
浏览文件 @
1e21eaff
#!/bin/bash
DATA_DIR
=
/mnt/root/testdata
NUM_LOOP
=
5
function
printTo
{
if
$verbose
;
then
echo
$1
fi
}
TDTESTQ2OUT
=
tdengineTestQ2.out
function
runTest
{
totalCount10
=
0
totalCount20
=
0
totalCount30
=
0
totalCount40
=
0
totalCount50
=
0
totalCount60
=
0
totalCount70
=
0
totalCount80
=
0
totalCount90
=
0
totalCount100
=
0
totalAvg10
=
0
totalAvg20
=
0
totalAvg30
=
0
totalAvg40
=
0
totalAvg50
=
0
totalAvg60
=
0
totalAvg70
=
0
totalAvg80
=
0
totalAvg90
=
0
totalAvg100
=
0
totalSum10
=
0
totalSum20
=
0
totalSum30
=
0
totalSum40
=
0
totalSum50
=
0
totalSum60
=
0
totalSum70
=
0
totalSum80
=
0
totalSum90
=
0
totalSum100
=
0
totalMax10
=
0
totalMax20
=
0
totalMax30
=
0
totalMax40
=
0
totalMax50
=
0
totalMax60
=
0
totalMax70
=
0
totalMax80
=
0
totalMax90
=
0
totalMax100
=
0
totalMin10
=
0
totalMin20
=
0
totalMin30
=
0
totalMin40
=
0
totalMin50
=
0
totalMin60
=
0
totalMin70
=
0
totalMin80
=
0
totalMin90
=
0
totalMin100
=
0
totalSpread10
=
0
totalSpread20
=
0
totalSpread30
=
0
totalSpread40
=
0
totalSpread50
=
0
totalSpread60
=
0
totalSpread70
=
0
totalSpread80
=
0
totalSpread90
=
0
totalSpread100
=
0
for
i
in
`
seq
1
$NUM_LOOP
`
;
do
printTo
"loop i:
$i
,
$TDTEST_DIR
/tdengineTest
\
-sql q2.txt"
restartTaosd
$TDTEST_DIR
/tdengineTest
\
-sql
$TDTEST_DIR
/q2.txt
>
$TDTESTQ2OUT
Count10
=
`
cat
$TDTESTQ2OUT
|
grep
"count"
|
grep
"devgroup<10;"
|
awk
'{print $3}'
`
totalCount10
=
`
echo
"scale=4;
$totalCount10
+
$Count10
"
| bc
`
Count20
=
`
cat
$TDTESTQ2OUT
|
grep
"count"
|
grep
"devgroup<20;"
|
awk
'{print $3}'
`
totalCount20
=
`
echo
"scale=4;
$totalCount20
+
$Count20
"
| bc
`
Count30
=
`
cat
$TDTESTQ2OUT
|
grep
count |
grep
"devgroup<30;"
|
awk
'{print $3}'
`
totalCount30
=
`
echo
"scale=4;
$totalCount30
+
$Count30
"
| bc
`
Count40
=
`
cat
$TDTESTQ2OUT
|
grep
count |
grep
"devgroup<40;"
|
awk
'{print $3}'
`
totalCount40
=
`
echo
"scale=4;
$totalCount40
+
$Count40
"
| bc
`
Count50
=
`
cat
$TDTESTQ2OUT
|
grep
count |
grep
"devgroup<50;"
|
awk
'{print $3}'
`
totalCount50
=
`
echo
"scale=4;
$totalCount50
+
$Count50
"
| bc
`
Count60
=
`
cat
$TDTESTQ2OUT
|
grep
count |
grep
"devgroup<60;"
|
awk
'{print $3}'
`
totalCount60
=
`
echo
"scale=4;
$totalCount60
+
$Count60
"
| bc
`
Count70
=
`
cat
$TDTESTQ2OUT
|
grep
count |
grep
"devgroup<70;"
|
awk
'{print $3}'
`
totalCount70
=
`
echo
"scale=4;
$totalCount70
+
$Count70
"
| bc
`
Count80
=
`
cat
$TDTESTQ2OUT
|
grep
count |
grep
"devgroup<80;"
|
awk
'{print $3}'
`
totalCount80
=
`
echo
"scale=4;
$totalCount80
+
$Count80
"
| bc
`
Count90
=
`
cat
$TDTESTQ2OUT
|
grep
count |
grep
"devgroup<90;"
|
awk
'{print $3}'
`
totalCount90
=
`
echo
"scale=4;
$totalCount90
+
$Count90
"
| bc
`
Count100
=
`
cat
$TDTESTQ2OUT
|
grep
count |
grep
"db.devices;"
|
awk
'{print $3}'
`
totalCount100
=
`
echo
"scale=4;
$totalCount100
+
$Count100
"
| bc
`
Avg10
=
`
cat
$TDTESTQ2OUT
|
grep
"avg"
|
grep
"devgroup<10;"
|
awk
'{print $3}'
`
totalAvg10
=
`
echo
"scale=4;
$totalAvg10
+
$Avg10
"
| bc
`
Avg20
=
`
cat
$TDTESTQ2OUT
|
grep
"avg"
|
grep
"devgroup<20;"
|
awk
'{print $3}'
`
totalAvg20
=
`
echo
"scale=4;
$totalAvg20
+
$Avg20
"
| bc
`
Avg30
=
`
cat
$TDTESTQ2OUT
|
grep
avg |
grep
"devgroup<30;"
|
awk
'{print $3}'
`
totalAvg30
=
`
echo
"scale=4;
$totalAvg30
+
$Avg30
"
| bc
`
Avg40
=
`
cat
$TDTESTQ2OUT
|
grep
avg |
grep
"devgroup<40;"
|
awk
'{print $3}'
`
totalAvg40
=
`
echo
"scale=4;
$totalAvg40
+
$Avg40
"
| bc
`
Avg50
=
`
cat
$TDTESTQ2OUT
|
grep
avg |
grep
"devgroup<50;"
|
awk
'{print $3}'
`
totalAvg50
=
`
echo
"scale=4;
$totalAvg50
+
$Avg50
"
| bc
`
Avg60
=
`
cat
$TDTESTQ2OUT
|
grep
avg |
grep
"devgroup<60;"
|
awk
'{print $3}'
`
totalAvg60
=
`
echo
"scale=4;
$totalAvg60
+
$Avg60
"
| bc
`
Avg70
=
`
cat
$TDTESTQ2OUT
|
grep
avg |
grep
"devgroup<70;"
|
awk
'{print $3}'
`
totalAvg70
=
`
echo
"scale=4;
$totalAvg70
+
$Avg70
"
| bc
`
Avg80
=
`
cat
$TDTESTQ2OUT
|
grep
avg |
grep
"devgroup<80;"
|
awk
'{print $3}'
`
totalAvg80
=
`
echo
"scale=4;
$totalAvg80
+
$Avg80
"
| bc
`
Avg90
=
`
cat
$TDTESTQ2OUT
|
grep
avg |
grep
"devgroup<90;"
|
awk
'{print $3}'
`
totalAvg90
=
`
echo
"scale=4;
$totalAvg90
+
$Avg90
"
| bc
`
Avg100
=
`
cat
$TDTESTQ2OUT
|
grep
avg |
grep
"db.devices;"
|
awk
'{print $3}'
`
totalAvg100
=
`
echo
"scale=4;
$totalAvg100
+
$Avg100
"
| bc
`
Sum10
=
`
cat
$TDTESTQ2OUT
|
grep
"sum"
|
grep
"devgroup<10;"
|
awk
'{print $3}'
`
totalSum10
=
`
echo
"scale=4;
$totalSum10
+
$Sum10
"
| bc
`
Sum20
=
`
cat
$TDTESTQ2OUT
|
grep
"sum"
|
grep
"devgroup<20;"
|
awk
'{print $3}'
`
totalSum20
=
`
echo
"scale=4;
$totalSum20
+
$Sum20
"
| bc
`
Sum30
=
`
cat
$TDTESTQ2OUT
|
grep sum
|
grep
"devgroup<30;"
|
awk
'{print $3}'
`
totalSum30
=
`
echo
"scale=4;
$totalSum30
+
$Sum30
"
| bc
`
Sum40
=
`
cat
$TDTESTQ2OUT
|
grep sum
|
grep
"devgroup<40;"
|
awk
'{print $3}'
`
totalSum40
=
`
echo
"scale=4;
$totalSum40
+
$Sum40
"
| bc
`
Sum50
=
`
cat
$TDTESTQ2OUT
|
grep sum
|
grep
"devgroup<50;"
|
awk
'{print $3}'
`
totalSum50
=
`
echo
"scale=4;
$totalSum50
+
$Sum50
"
| bc
`
Sum60
=
`
cat
$TDTESTQ2OUT
|
grep sum
|
grep
"devgroup<60;"
|
awk
'{print $3}'
`
totalSum60
=
`
echo
"scale=4;
$totalSum60
+
$Sum60
"
| bc
`
Sum70
=
`
cat
$TDTESTQ2OUT
|
grep sum
|
grep
"devgroup<70;"
|
awk
'{print $3}'
`
totalSum70
=
`
echo
"scale=4;
$totalSum70
+
$Sum70
"
| bc
`
Sum80
=
`
cat
$TDTESTQ2OUT
|
grep sum
|
grep
"devgroup<80;"
|
awk
'{print $3}'
`
totalSum80
=
`
echo
"scale=4;
$totalSum80
+
$Sum80
"
| bc
`
Sum90
=
`
cat
$TDTESTQ2OUT
|
grep sum
|
grep
"devgroup<90;"
|
awk
'{print $3}'
`
totalSum90
=
`
echo
"scale=4;
$totalSum90
+
$Sum90
"
| bc
`
Sum100
=
`
cat
$TDTESTQ2OUT
|
grep sum
|
grep
"db.devices;"
|
awk
'{print $3}'
`
totalSum100
=
`
echo
"scale=4;
$totalSum100
+
$Sum100
"
| bc
`
Max10
=
`
cat
$TDTESTQ2OUT
|
grep
"max"
|
grep
"devgroup<10;"
|
awk
'{print $3}'
`
totalMax10
=
`
echo
"scale=4;
$totalMax10
+
$Max10
"
| bc
`
Max20
=
`
cat
$TDTESTQ2OUT
|
grep
"max"
|
grep
"devgroup<20;"
|
awk
'{print $3}'
`
totalMax20
=
`
echo
"scale=4;
$totalMax20
+
$Max20
"
| bc
`
Max30
=
`
cat
$TDTESTQ2OUT
|
grep
max |
grep
"devgroup<30;"
|
awk
'{print $3}'
`
totalMax30
=
`
echo
"scale=4;
$totalMax30
+
$Max30
"
| bc
`
Max40
=
`
cat
$TDTESTQ2OUT
|
grep
max |
grep
"devgroup<40;"
|
awk
'{print $3}'
`
totalMax40
=
`
echo
"scale=4;
$totalMax40
+
$Max40
"
| bc
`
Max50
=
`
cat
$TDTESTQ2OUT
|
grep
max |
grep
"devgroup<50;"
|
awk
'{print $3}'
`
totalMax50
=
`
echo
"scale=4;
$totalMax50
+
$Max50
"
| bc
`
Max60
=
`
cat
$TDTESTQ2OUT
|
grep
max |
grep
"devgroup<60;"
|
awk
'{print $3}'
`
totalMax60
=
`
echo
"scale=4;
$totalMax60
+
$Max60
"
| bc
`
Max70
=
`
cat
$TDTESTQ2OUT
|
grep
max |
grep
"devgroup<70;"
|
awk
'{print $3}'
`
totalMax70
=
`
echo
"scale=4;
$totalMax70
+
$Max70
"
| bc
`
Max80
=
`
cat
$TDTESTQ2OUT
|
grep
max |
grep
"devgroup<80;"
|
awk
'{print $3}'
`
totalMax80
=
`
echo
"scale=4;
$totalMax80
+
$Max80
"
| bc
`
Max90
=
`
cat
$TDTESTQ2OUT
|
grep
max |
grep
"devgroup<90;"
|
awk
'{print $3}'
`
totalMax90
=
`
echo
"scale=4;
$totalMax90
+
$Max90
"
| bc
`
Max100
=
`
cat
$TDTESTQ2OUT
|
grep
max |
grep
"db.devices;"
|
awk
'{print $3}'
`
totalMax100
=
`
echo
"scale=4;
$totalMax100
+
$Max100
"
| bc
`
Min10
=
`
cat
$TDTESTQ2OUT
|
grep
"min"
|
grep
"devgroup<10;"
|
awk
'{print $3}'
`
totalMin10
=
`
echo
"scale=4;
$totalMin10
+
$Min10
"
| bc
`
Min20
=
`
cat
$TDTESTQ2OUT
|
grep
"min"
|
grep
"devgroup<20;"
|
awk
'{print $3}'
`
totalMin20
=
`
echo
"scale=4;
$totalMin20
+
$Min20
"
| bc
`
Min30
=
`
cat
$TDTESTQ2OUT
|
grep
min |
grep
"devgroup<30;"
|
awk
'{print $3}'
`
totalMin30
=
`
echo
"scale=4;
$totalMin30
+
$Min30
"
| bc
`
Min40
=
`
cat
$TDTESTQ2OUT
|
grep
min |
grep
"devgroup<40;"
|
awk
'{print $3}'
`
totalMin40
=
`
echo
"scale=4;
$totalMin40
+
$Min40
"
| bc
`
Min50
=
`
cat
$TDTESTQ2OUT
|
grep
min |
grep
"devgroup<50;"
|
awk
'{print $3}'
`
totalMin50
=
`
echo
"scale=4;
$totalMin50
+
$Min50
"
| bc
`
Min60
=
`
cat
$TDTESTQ2OUT
|
grep
min |
grep
"devgroup<60;"
|
awk
'{print $3}'
`
totalMin60
=
`
echo
"scale=4;
$totalMin60
+
$Min60
"
| bc
`
Min70
=
`
cat
$TDTESTQ2OUT
|
grep
min |
grep
"devgroup<70;"
|
awk
'{print $3}'
`
totalMin70
=
`
echo
"scale=4;
$totalMin70
+
$Min70
"
| bc
`
Min80
=
`
cat
$TDTESTQ2OUT
|
grep
min |
grep
"devgroup<80;"
|
awk
'{print $3}'
`
totalMin80
=
`
echo
"scale=4;
$totalMin80
+
$Min80
"
| bc
`
Min90
=
`
cat
$TDTESTQ2OUT
|
grep
min |
grep
"devgroup<90;"
|
awk
'{print $3}'
`
totalMin90
=
`
echo
"scale=4;
$totalMin90
+
$Min90
"
| bc
`
Min100
=
`
cat
$TDTESTQ2OUT
|
grep
min |
grep
"db.devices;"
|
awk
'{print $3}'
`
totalMin100
=
`
echo
"scale=4;
$totalMin100
+
$Min100
"
| bc
`
Spread10
=
`
cat
$TDTESTQ2OUT
|
grep
"spread"
|
grep
"devgroup<10;"
|
awk
'{print $3}'
`
totalSpread10
=
`
echo
"scale=4;
$totalSpread10
+
$Spread10
"
| bc
`
Spread20
=
`
cat
$TDTESTQ2OUT
|
grep
"spread"
|
grep
"devgroup<20;"
|
awk
'{print $3}'
`
totalSpread20
=
`
echo
"scale=4;
$totalSpread20
+
$Spread20
"
| bc
`
Spread30
=
`
cat
$TDTESTQ2OUT
|
grep
spread |
grep
"devgroup<30;"
|
awk
'{print $3}'
`
totalSpread30
=
`
echo
"scale=4;
$totalSpread30
+
$Spread30
"
| bc
`
Spread40
=
`
cat
$TDTESTQ2OUT
|
grep
spread |
grep
"devgroup<40;"
|
awk
'{print $3}'
`
totalSpread40
=
`
echo
"scale=4;
$totalSpread40
+
$Spread40
"
| bc
`
Spread50
=
`
cat
$TDTESTQ2OUT
|
grep
spread |
grep
"devgroup<50;"
|
awk
'{print $3}'
`
totalSpread50
=
`
echo
"scale=4;
$totalSpread50
+
$Spread50
"
| bc
`
Spread60
=
`
cat
$TDTESTQ2OUT
|
grep
spread |
grep
"devgroup<60;"
|
awk
'{print $3}'
`
totalSpread60
=
`
echo
"scale=4;
$totalSpread60
+
$Spread60
"
| bc
`
Spread70
=
`
cat
$TDTESTQ2OUT
|
grep
spread |
grep
"devgroup<70;"
|
awk
'{print $3}'
`
totalSpread70
=
`
echo
"scale=4;
$totalSpread70
+
$Spread70
"
| bc
`
Spread80
=
`
cat
$TDTESTQ2OUT
|
grep
spread |
grep
"devgroup<80;"
|
awk
'{print $3}'
`
totalSpread80
=
`
echo
"scale=4;
$totalSpread80
+
$Spread80
"
| bc
`
Spread90
=
`
cat
$TDTESTQ2OUT
|
grep
spread |
grep
"devgroup<90;"
|
awk
'{print $3}'
`
totalSpread90
=
`
echo
"scale=4;
$totalSpread90
+
$Spread90
"
| bc
`
Spread100
=
`
cat
$TDTESTQ2OUT
|
grep
spread |
grep
"db.devices;"
|
awk
'{print $3}'
`
totalSpread100
=
`
echo
"scale=4;
$totalSpread100
+
$Spread100
"
| bc
`
done
avgCount10
=
`
echo
"scale=4; x =
$totalCount10
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgCount20
=
`
echo
"scale=4; x =
$totalCount20
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgCount30
=
`
echo
"scale=4; x =
$totalCount30
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgCount40
=
`
echo
"scale=4; x =
$totalCount40
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgCount50
=
`
echo
"scale=4; x =
$totalCount50
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgCount60
=
`
echo
"scale=4; x =
$totalCount60
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgCount70
=
`
echo
"scale=4; x =
$totalCount70
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgCount80
=
`
echo
"scale=4; x =
$totalCount80
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgCount90
=
`
echo
"scale=4; x =
$totalCount90
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgCount100
=
`
echo
"scale=4; x =
$totalCount100
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgAvg10
=
`
echo
"scale=4; x =
$totalAvg10
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgAvg20
=
`
echo
"scale=4; x =
$totalAvg20
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgAvg30
=
`
echo
"scale=4; x =
$totalAvg30
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgAvg40
=
`
echo
"scale=4; x =
$totalAvg40
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgAvg50
=
`
echo
"scale=4; x =
$totalAvg50
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgAvg60
=
`
echo
"scale=4; x =
$totalAvg60
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgAvg70
=
`
echo
"scale=4; x =
$totalAvg70
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgAvg80
=
`
echo
"scale=4; x =
$totalAvg80
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgAvg90
=
`
echo
"scale=4; x =
$totalAvg90
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgAvg100
=
`
echo
"scale=4; x =
$totalAvg100
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSum10
=
`
echo
"scale=4; x =
$totalSum10
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSum20
=
`
echo
"scale=4; x =
$totalSum20
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSum30
=
`
echo
"scale=4; x =
$totalSum30
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSum40
=
`
echo
"scale=4; x =
$totalSum40
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSum50
=
`
echo
"scale=4; x =
$totalSum50
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSum60
=
`
echo
"scale=4; x =
$totalSum60
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSum70
=
`
echo
"scale=4; x =
$totalSum70
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSum80
=
`
echo
"scale=4; x =
$totalSum80
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSum90
=
`
echo
"scale=4; x =
$totalSum90
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSum100
=
`
echo
"scale=4; x =
$totalSum100
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMax10
=
`
echo
"scale=4; x =
$totalMax10
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMax20
=
`
echo
"scale=4; x =
$totalMax20
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMax30
=
`
echo
"scale=4; x =
$totalMax30
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMax40
=
`
echo
"scale=4; x =
$totalMax40
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMax50
=
`
echo
"scale=4; x =
$totalMax50
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMax60
=
`
echo
"scale=4; x =
$totalMax60
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMax70
=
`
echo
"scale=4; x =
$totalMax70
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMax80
=
`
echo
"scale=4; x =
$totalMax80
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMax90
=
`
echo
"scale=4; x =
$totalMax90
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMax100
=
`
echo
"scale=4; x =
$totalMax100
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMin10
=
`
echo
"scale=4; x =
$totalMin10
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMin20
=
`
echo
"scale=4; x =
$totalMin20
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMin30
=
`
echo
"scale=4; x =
$totalMin30
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMin40
=
`
echo
"scale=4; x =
$totalMin40
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMin50
=
`
echo
"scale=4; x =
$totalMin50
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMin60
=
`
echo
"scale=4; x =
$totalMin60
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMin70
=
`
echo
"scale=4; x =
$totalMin70
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMin80
=
`
echo
"scale=4; x =
$totalMin80
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMin90
=
`
echo
"scale=4; x =
$totalMin90
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgMin100
=
`
echo
"scale=4; x =
$totalMin100
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSpread10
=
`
echo
"scale=4; x =
$totalSpread10
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSpread20
=
`
echo
"scale=4; x =
$totalSpread20
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSpread30
=
`
echo
"scale=4; x =
$totalSpread30
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSpread40
=
`
echo
"scale=4; x =
$totalSpread40
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSpread50
=
`
echo
"scale=4; x =
$totalSpread50
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSpread60
=
`
echo
"scale=4; x =
$totalSpread60
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSpread70
=
`
echo
"scale=4; x =
$totalSpread70
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSpread80
=
`
echo
"scale=4; x =
$totalSpread80
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSpread90
=
`
echo
"scale=4; x =
$totalSpread90
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgSpread100
=
`
echo
"scale=4; x =
$totalSpread100
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
echo
"Latency, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%"
echo
"Count,
$avgCount10
,
$avgCount20
,
$avgCount30
,
$avgCount40
,
$avgCount50
,
$avgCount60
,
$avgCount70
,
$avgCount80
,
$avgCount90
,
$avgCount100
"
echo
"Avg,
$avgAvg10
,
$avgAvg20
,
$avgAvg30
,
$avgAvg40
,
$avgAvg50
,
$avgAvg60
,
$avgAvg70
,
$avgAvg80
,
$avgAvg90
,
$avgAvg100
"
echo
"Sum,
$avgSum10
,
$avgSum20
,
$avgSum30
,
$avgSum40
,
$avgSum50
,
$avgSum60
,
$avgSum70
,
$avgSum80
,
$avgSum90
,
$avgSum100
"
echo
"Max,
$avgMax10
,
$avgMax20
,
$avgMax30
,
$avgMax40
,
$avgMax50
,
$avgMax60
,
$avgMax70
,
$avgMax80
,
$avgMax90
,
$avgMax100
"
echo
"Min,
$avgMin10
,
$avgMin20
,
$avgMin30
,
$avgMin40
,
$avgMin50
,
$avgMin60
,
$avgMin70
,
$avgMin80
,
$avgMin90
,
$avgMin100
"
echo
"Spread,
$avgSpread10
,
$avgSpread20
,
$avgSpread30
,
$avgSpread40
,
$avgSpread50
,
$avgSpread60
,
$avgSpread70
,
$avgSpread80
,
$avgSpread90
,
$avgSpread100
"
}
function
restartTaosd
{
printTo
"Stop taosd"
systemctl stop taosd
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
while
[
-n
"
$PID
"
]
do
pkill
-TERM
-x
taosd
sleep
1
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
done
printTo
"Start taosd"
$TAOSD_DIR
/taosd
>
/dev/null 2>&1 &
sleep
10
}
################ Main ################
master
=
false
develop
=
true
verbose
=
false
for
arg
in
"
$@
"
do
case
$arg
in
-v
)
verbose
=
true
;;
master
)
master
=
true
develop
=
false
;;
develop
)
master
=
false
develop
=
true
;;
*
)
;;
esac
done
if
$master
;
then
echo
"Test master branch.."
cp
/mnt/root/cfg/master/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine.master
else
echo
"Test develop branch.."
cp
/mnt/root/cfg/10billion/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine
fi
TAOSD_DIR
=
$WORK_DIR
/debug/build/bin
TDTEST_DIR
=
$WORK_DIR
/tests/comparisonTest/tdengine
runTest
echo
"Test done!"
tests/perftest-scripts/tdengineTestQ3Loop.sh
0 → 100755
浏览文件 @
1e21eaff
#!/bin/bash
DATA_DIR
=
/mnt/root/testdata
NUM_LOOP
=
5
function
printTo
{
if
$verbose
;
then
echo
$1
fi
}
TDTESTQ3OUT
=
tdengineTestQ3.out
function
runTest
{
totalG10
=
0
totalG20
=
0
totalG30
=
0
totalG40
=
0
totalG50
=
0
totalG60
=
0
totalG70
=
0
totalG80
=
0
totalG90
=
0
totalG100
=
0
for
i
in
`
seq
1
$NUM_LOOP
`
;
do
printTo
"loop i:
$i
,
$TDTEST_DIR
/tdengineTest
\
-sql q3.txt"
restartTaosd
$TDTEST_DIR
/tdengineTest
\
-sql
$TDTEST_DIR
/q3.txt
>
$TDTESTQ3OUT
G10
=
`
grep
"devgroup<10"
$TDTESTQ3OUT
|
awk
'{print $3}'
`
totalG10
=
`
echo
"scale=4;
$totalG10
+
$G10
"
| bc
`
G20
=
`
grep
"devgroup<20"
$TDTESTQ3OUT
|
awk
'{print $3}'
`
totalG20
=
`
echo
"scale=4;
$totalG20
+
$G20
"
| bc
`
G30
=
`
grep
"devgroup<30"
$TDTESTQ3OUT
|
awk
'{print $3}'
`
totalG30
=
`
echo
"scale=4;
$totalG30
+
$G30
"
| bc
`
G40
=
`
grep
"devgroup<40"
$TDTESTQ3OUT
|
awk
'{print $3}'
`
totalG40
=
`
echo
"scale=4;
$totalG40
+
$G40
"
| bc
`
G50
=
`
grep
"devgroup<50"
$TDTESTQ3OUT
|
awk
'{print $3}'
`
totalG50
=
`
echo
"scale=4;
$totalG50
+
$G50
"
| bc
`
G60
=
`
grep
"devgroup<60"
$TDTESTQ3OUT
|
awk
'{print $3}'
`
totalG60
=
`
echo
"scale=4;
$totalG60
+
$G60
"
| bc
`
G70
=
`
grep
"devgroup<70"
$TDTESTQ3OUT
|
awk
'{print $3}'
`
totalG70
=
`
echo
"scale=4;
$totalG70
+
$G70
"
| bc
`
G80
=
`
grep
"devgroup<80"
$TDTESTQ3OUT
|
awk
'{print $3}'
`
totalG80
=
`
echo
"scale=4;
$totalG80
+
$G80
"
| bc
`
G90
=
`
grep
"devgroup<90"
$TDTESTQ3OUT
|
awk
'{print $3}'
`
totalG90
=
`
echo
"scale=4;
$totalG90
+
$G90
"
| bc
`
G100
=
`
grep
"db.devices group by devgroup;"
$TDTESTQ3OUT
|
awk
'{print $3}'
`
totalG100
=
`
echo
"scale=4;
$totalG100
+
$G100
"
| bc
`
done
avgG10
=
`
echo
"scale=4; x =
$totalG10
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG20
=
`
echo
"scale=4; x =
$totalG20
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG30
=
`
echo
"scale=4; x =
$totalG30
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG40
=
`
echo
"scale=4; x =
$totalG40
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG50
=
`
echo
"scale=4; x =
$totalG50
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG60
=
`
echo
"scale=4; x =
$totalG60
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG70
=
`
echo
"scale=4; x =
$totalG70
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG80
=
`
echo
"scale=4; x =
$totalG80
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG90
=
`
echo
"scale=4; x =
$totalG90
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG100
=
`
echo
"scale=4; x =
$totalG100
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
echo
"Latency, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%"
echo
"TDengine,
$avgG10
,
$avgG20
,
$avgG30
,
$avgG40
,
$avgG50
,
$avgG60
,
$avgG70
,
$avgG80
,
$avgG90
,
$avgG100
"
}
function
restartTaosd
{
printTo
"Stop taosd"
systemctl stop taosd
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
while
[
-n
"
$PID
"
]
do
pkill
-TERM
-x
taosd
sleep
1
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
done
printTo
"Start taosd"
$TAOSD_DIR
/taosd
>
/dev/null 2>&1 &
sleep
10
}
################ Main ################
master
=
false
develop
=
true
verbose
=
false
for
arg
in
"
$@
"
do
case
$arg
in
-v
)
verbose
=
true
;;
master
)
master
=
true
develop
=
false
;;
develop
)
master
=
false
develop
=
true
;;
*
)
;;
esac
done
if
$master
;
then
echo
"Test master branch.."
cp
/mnt/root/cfg/master/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine.master
else
echo
"Test develop branch.."
cp
/mnt/root/cfg/10billion/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine
fi
TAOSD_DIR
=
$WORK_DIR
/debug/build/bin
TDTEST_DIR
=
$WORK_DIR
/tests/comparisonTest/tdengine
runTest
echo
"Test done!"
tests/perftest-scripts/tdengineTestQ4Loop.sh
0 → 100755
浏览文件 @
1e21eaff
#!/bin/bash
DATA_DIR
=
/mnt/root/testdata
NUM_LOOP
=
5
function
printTo
{
if
$verbose
;
then
echo
$1
fi
}
TDTESTQ4OUT
=
tdengineTestQ4.out
function
runTest
{
totalG10
=
0
totalG20
=
0
totalG30
=
0
totalG40
=
0
totalG50
=
0
totalG60
=
0
totalG70
=
0
totalG80
=
0
totalG90
=
0
totalG100
=
0
for
i
in
`
seq
1
$NUM_LOOP
`
;
do
printTo
"loop i:
$i
,
$TDTEST_DIR
/tdengineTest
\
-sql q4.txt"
restartTaosd
$TDTEST_DIR
/tdengineTest
\
-sql
$TDTEST_DIR
/q4.txt
>
$TDTESTQ4OUT
G10
=
`
grep
"devgroup<10"
$TDTESTQ4OUT
|
awk
'{print $3}'
`
totalG10
=
`
echo
"scale=4;
$totalG10
+
$G10
"
| bc
`
G20
=
`
grep
"devgroup<20"
$TDTESTQ4OUT
|
awk
'{print $3}'
`
totalG20
=
`
echo
"scale=4;
$totalG20
+
$G20
"
| bc
`
G30
=
`
grep
"devgroup<30"
$TDTESTQ4OUT
|
awk
'{print $3}'
`
totalG30
=
`
echo
"scale=4;
$totalG30
+
$G30
"
| bc
`
G40
=
`
grep
"devgroup<40"
$TDTESTQ4OUT
|
awk
'{print $3}'
`
totalG40
=
`
echo
"scale=4;
$totalG40
+
$G40
"
| bc
`
G50
=
`
grep
"devgroup<50"
$TDTESTQ4OUT
|
awk
'{print $3}'
`
totalG50
=
`
echo
"scale=4;
$totalG50
+
$G50
"
| bc
`
G60
=
`
grep
"devgroup<60"
$TDTESTQ4OUT
|
awk
'{print $3}'
`
totalG60
=
`
echo
"scale=4;
$totalG60
+
$G60
"
| bc
`
G70
=
`
grep
"devgroup<70"
$TDTESTQ4OUT
|
awk
'{print $3}'
`
totalG70
=
`
echo
"scale=4;
$totalG70
+
$G70
"
| bc
`
G80
=
`
grep
"devgroup<80"
$TDTESTQ4OUT
|
awk
'{print $3}'
`
totalG80
=
`
echo
"scale=4;
$totalG80
+
$G80
"
| bc
`
G90
=
`
grep
"devgroup<90"
$TDTESTQ4OUT
|
awk
'{print $3}'
`
totalG90
=
`
echo
"scale=4;
$totalG90
+
$G90
"
| bc
`
G100
=
`
grep
"db.devices interval"
$TDTESTQ4OUT
|
awk
'{print $3}'
`
totalG100
=
`
echo
"scale=4;
$totalG100
+
$G100
"
| bc
`
done
avgG10
=
`
echo
"scale=4; x =
$totalG10
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG20
=
`
echo
"scale=4; x =
$totalG20
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG30
=
`
echo
"scale=4; x =
$totalG30
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG40
=
`
echo
"scale=4; x =
$totalG40
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG50
=
`
echo
"scale=4; x =
$totalG50
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG60
=
`
echo
"scale=4; x =
$totalG60
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG70
=
`
echo
"scale=4; x =
$totalG70
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG80
=
`
echo
"scale=4; x =
$totalG80
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG90
=
`
echo
"scale=4; x =
$totalG90
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
avgG100
=
`
echo
"scale=4; x =
$totalG100
/
$NUM_LOOP
; if(x<1) print 0; x"
| bc
`
echo
"Latency, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%"
echo
"TDengine,
$avgG10
,
$avgG20
,
$avgG30
,
$avgG40
,
$avgG50
,
$avgG60
,
$avgG70
,
$avgG80
,
$avgG90
,
$avgG100
"
}
function
restartTaosd
{
printTo
"Stop taosd"
systemctl stop taosd
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
while
[
-n
"
$PID
"
]
do
pkill
-TERM
-x
taosd
sleep
1
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
done
printTo
"Start taosd"
$TAOSD_DIR
/taosd
>
/dev/null 2>&1 &
sleep
10
}
################ Main ################
master
=
false
develop
=
true
verbose
=
false
for
arg
in
"
$@
"
do
case
$arg
in
-v
)
verbose
=
true
;;
master
)
master
=
true
develop
=
false
;;
develop
)
master
=
false
develop
=
true
;;
*
)
;;
esac
done
if
$master
;
then
echo
"Test master branch.."
cp
/mnt/root/cfg/master/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine.master
else
echo
"Test develop branch.."
cp
/mnt/root/cfg/10billion/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine
fi
TAOSD_DIR
=
$WORK_DIR
/debug/build/bin
TDTEST_DIR
=
$WORK_DIR
/tests/comparisonTest/tdengine
runTest
echo
"Test done!"
tests/perftest-scripts/tdengineTestQ5Loop.sh
0 → 100755
浏览文件 @
1e21eaff
#!/bin/bash
DATA_DIR
=
/mnt/root/testdata
NUM_LOOP
=
5
function
printTo
{
if
$verbose
;
then
echo
$1
fi
}
TDTESTQ5OUT
=
tdengineTestQ5.out
function
runTest
{
totalThroughput
=
0
for
i
in
`
seq
1
$NUM_LOOP
`
;
do
for
c
in
`
seq
1
$clients
`
;
do
records[
$c
]=
0
spentTime[
$c
]=
0
throughput[
$c
]=
0
done
printTo
"loop i:
$i
,
$TDTEST_DIR
/tdengineTest
\
-clients
$clients
-sql q5.txt"
restartTaosd
beginMS
=
`
date
+%s%3N
`
$TDTEST_DIR
/tdengineTest
\
-clients
$clients
-sql
$TDTEST_DIR
/q5.txt
>
$TDTESTQ5OUT
endMS
=
`
date
+%s%3N
`
totalRecords
=
0
for
c
in
`
seq
1
$clients
`
;
do
records[
$c
]=
`
grep
Thread:
$c
$TDTESTQ5OUT
|
awk
'{print $7}'
`
totalRecords
=
`
echo
"
$totalRecords
+
${
records
[
$c
]
}
"
|bc
`
done
spending
=
`
echo
"scale=4; x = (
$endMS
-
$beginMS
)/1000; if (x<1) print 0; x"
|bc
`
throughput
=
`
echo
"scale=4; x=
$totalRecords
/
$spending
; if (x<1) print 0; x"
| bc
`
printTo
"spending:
$spending
sec, throughput:
$throughput
"
totalThroughput
=
`
echo
"scale=4; x =
$totalThroughput
+
$throughput
; if(x<1) print 0; x"
|bc
`
done
avgThrougput
=
`
echo
"scale=4; x =
$totalThroughput
/
$NUM_LOOP
; if (x<1) print 0; x"
|bc
`
echo
"avg Throughput:
$avgThrougput
"
}
function
restartTaosd
{
printTo
"Stop taosd"
systemctl stop taosd
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
while
[
-n
"
$PID
"
]
do
pkill
-TERM
-x
taosd
sleep
1
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
done
printTo
"Start taosd"
$TAOSD_DIR
/taosd
>
/dev/null 2>&1 &
sleep
10
}
################ Main ################
master
=
false
develop
=
true
verbose
=
false
clients
=
1
while
:
;
do
case
$1
in
-v
)
verbose
=
true
shift
;;
master
)
master
=
true
develop
=
false
shift
;;
develop
)
master
=
false
develop
=
true
shift
;;
-c
)
clients
=
$2
shift
2
;;
*
)
break
;;
esac
done
if
$master
;
then
printTo
"Test master branch.."
cp
/mnt/root/cfg/master/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine.master
else
printTo
"Test develop branch.."
cp
/mnt/root/cfg/10billion/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine
fi
TAOSD_DIR
=
$WORK_DIR
/debug/build/bin
TDTEST_DIR
=
$WORK_DIR
/tests/comparisonTest/tdengine
runTest
printTo
"Test done!"
tests/perftest-scripts/tdengineTestWriteLoop.sh
0 → 100755
浏览文件 @
1e21eaff
#!/bin/bash
DATA_DIR
=
/mnt/root/testdata
NUM_LOOP
=
5
NUM_OF_FILES
=
100
rowsPerRequest
=(
1 100 500 1000 2000
)
function
printTo
{
if
$verbose
;
then
echo
$1
fi
}
function
runTest
{
printf
"R/R, "
for
c
in
`
seq
1
$clients
`
;
do
if
[
"
$c
"
==
"1"
]
;
then
printf
"
$c
client, "
else
printf
"
$c
clients, "
fi
done
printf
"
\n
"
for
r
in
${
rowsPerRequest
[@]
}
;
do
printf
"
$r
, "
for
c
in
`
seq
1
$clients
`
;
do
totalRPR
=
0
for
i
in
`
seq
1
$NUM_LOOP
`
;
do
restartTaosd
$TAOSD_DIR
/taos
-s
"drop database db"
>
/dev/null 2>&1
printTo
"loop i:
$i
,
$TDTEST_DIR
/tdengineTest
\
-dataDir
$DATA_DIR
\
-numOfFiles
$NUM_OF_FILES
\
-w -clients
$c
\
-rowsPerRequest
$r
"
RPR
=
`
$TDTEST_DIR
/tdengineTest
\
-dataDir
$DATA_DIR
\
-numOfFiles
1
\
-w
-clients
$c
\
-rowsPerRequest
$r
\
|
grep
speed |
awk
'{print $(NF-1)}'
`
totalRPR
=
`
echo
"scale=4;
$totalRPR
+
$RPR
"
| bc
`
printTo
"rows:
$r
, clients:
$c
, i:
$i
RPR:
$RPR
"
done
avgRPR
=
`
echo
"scale=4;
$totalRPR
/
$NUM_LOOP
"
| bc
`
printf
"
$avgRPR
, "
done
printf
"
\n
"
done
}
function
restartTaosd
{
printTo
"Stop taosd"
systemctl stop taosd
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
while
[
-n
"
$PID
"
]
do
pkill
-TERM
-x
taosd
sleep
1
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
done
printTo
"Start taosd"
$TAOSD_DIR
/taosd
>
/dev/null 2>&1 &
sleep
10
}
################ Main ################
master
=
false
develop
=
true
verbose
=
false
clients
=
1
while
:
;
do
case
$1
in
-v
)
verbose
=
true
shift
;;
master
)
master
=
true
develop
=
false
shift
;;
develop
)
master
=
false
develop
=
true
shift
;;
-c
)
clients
=
$2
shift
2
;;
*
)
break
;;
esac
done
if
$master
;
then
echo
"Test master branch.."
cp
/mnt/root/cfg/master/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine.master
else
echo
"Test develop branch.."
cp
/mnt/root/cfg/10billion/taos.cfg /etc/taos/taos.cfg
WORK_DIR
=
/mnt/root/TDengine
fi
TAOSD_DIR
=
$WORK_DIR
/debug/build/bin
TDTEST_DIR
=
$WORK_DIR
/tests/comparisonTest/tdengine
runTest
echo
"Test done!"
tests/pytest/util/dnodes-no-random-fail.py
浏览文件 @
1e21eaff
...
@@ -178,7 +178,6 @@ class TDDnode:
...
@@ -178,7 +178,6 @@ class TDDnode:
self
.
cfg
(
"walLevel"
,
"2"
)
self
.
cfg
(
"walLevel"
,
"2"
)
self
.
cfg
(
"fsync"
,
"1000"
)
self
.
cfg
(
"fsync"
,
"1000"
)
self
.
cfg
(
"statusInterval"
,
"1"
)
self
.
cfg
(
"statusInterval"
,
"1"
)
self
.
cfg
(
"numOfTotalVnodes"
,
"64"
)
self
.
cfg
(
"numOfMnodes"
,
"3"
)
self
.
cfg
(
"numOfMnodes"
,
"3"
)
self
.
cfg
(
"numOfThreadsPerCore"
,
"2.0"
)
self
.
cfg
(
"numOfThreadsPerCore"
,
"2.0"
)
self
.
cfg
(
"monitor"
,
"0"
)
self
.
cfg
(
"monitor"
,
"0"
)
...
...
tests/pytest/util/dnodes-random-fail.py
浏览文件 @
1e21eaff
...
@@ -178,7 +178,6 @@ class TDDnode:
...
@@ -178,7 +178,6 @@ class TDDnode:
self
.
cfg
(
"walLevel"
,
"2"
)
self
.
cfg
(
"walLevel"
,
"2"
)
self
.
cfg
(
"fsync"
,
"1000"
)
self
.
cfg
(
"fsync"
,
"1000"
)
self
.
cfg
(
"statusInterval"
,
"1"
)
self
.
cfg
(
"statusInterval"
,
"1"
)
self
.
cfg
(
"numOfTotalVnodes"
,
"64"
)
self
.
cfg
(
"numOfMnodes"
,
"3"
)
self
.
cfg
(
"numOfMnodes"
,
"3"
)
self
.
cfg
(
"numOfThreadsPerCore"
,
"2.0"
)
self
.
cfg
(
"numOfThreadsPerCore"
,
"2.0"
)
self
.
cfg
(
"monitor"
,
"0"
)
self
.
cfg
(
"monitor"
,
"0"
)
...
...
tests/pytest/util/dnodes.py
浏览文件 @
1e21eaff
...
@@ -180,7 +180,6 @@ class TDDnode:
...
@@ -180,7 +180,6 @@ class TDDnode:
self
.
cfg
(
"walLevel"
,
"2"
)
self
.
cfg
(
"walLevel"
,
"2"
)
self
.
cfg
(
"fsync"
,
"1000"
)
self
.
cfg
(
"fsync"
,
"1000"
)
self
.
cfg
(
"statusInterval"
,
"1"
)
self
.
cfg
(
"statusInterval"
,
"1"
)
self
.
cfg
(
"numOfTotalVnodes"
,
"64"
)
self
.
cfg
(
"numOfMnodes"
,
"3"
)
self
.
cfg
(
"numOfMnodes"
,
"3"
)
self
.
cfg
(
"numOfThreadsPerCore"
,
"2.0"
)
self
.
cfg
(
"numOfThreadsPerCore"
,
"2.0"
)
self
.
cfg
(
"monitor"
,
"0"
)
self
.
cfg
(
"monitor"
,
"0"
)
...
...
tests/script/general/db/alter_option.sim
浏览文件 @
1e21eaff
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/db/basic.sim
浏览文件 @
1e21eaff
...
@@ -99,9 +99,7 @@ $db = $dbPrefix . $i
...
@@ -99,9 +99,7 @@ $db = $dbPrefix . $i
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql create database $db
sql use $db
sql use $db
sql create table $tb (ts timestamp, speed int) -x step6
sql create table $tb (ts timestamp, speed int)
return -1
step6:
print =============== step7
print =============== step7
$i = 0
$i = 0
...
...
tests/script/general/db/delete.sim
浏览文件 @
1e21eaff
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 10
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 10
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000
...
...
tests/script/general/db/delete_reuse1.sim
浏览文件 @
1e21eaff
...
@@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
@@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
...
...
tests/script/general/db/delete_reuse2.sim
浏览文件 @
1e21eaff
...
@@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
@@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes
print ========= start dnodes
sleep 2000
sleep 2000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/db/delete_reusevnode.sim
浏览文件 @
1e21eaff
...
@@ -2,10 +2,6 @@ system sh/stop_dnodes.sh
...
@@ -2,10 +2,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
print ========= start dnodes
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
...
@@ -44,9 +40,6 @@ system sh/stop_dnodes.sh
...
@@ -44,9 +40,6 @@ system sh/stop_dnodes.sh
sleep 3000
sleep 3000
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
print ========= start dnodes
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
...
...
tests/script/general/db/delete_reusevnode2.sim
浏览文件 @
1e21eaff
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
print ========= start dnodes
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/db/delete_writing1.sim
浏览文件 @
1e21eaff
...
@@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
@@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
...
...
tests/script/general/db/delete_writing2.sim
浏览文件 @
1e21eaff
...
@@ -2,7 +2,6 @@ system sh/stop_dnodes.sh
...
@@ -2,7 +2,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
print ========= start dnodes
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/db/len.sim
浏览文件 @
1e21eaff
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/db/repeat.sim
浏览文件 @
1e21eaff
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/db/vnodes.sim
浏览文件 @
1e21eaff
...
@@ -8,7 +8,6 @@ system sh/deploy.sh -n dnode1 -i 1
...
@@ -8,7 +8,6 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v $maxTables
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v $maxTables
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v $totalVnodes
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v $totalVnodes
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v $totalVnodes
system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 100000
system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 100000
system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 100000
system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 100000
system sh/cfg.sh -n dnode1 -c maxShellConns -v 100000
system sh/cfg.sh -n dnode1 -c maxShellConns -v 100000
...
...
tests/script/general/parser/bug.sim
浏览文件 @
1e21eaff
...
@@ -20,7 +20,6 @@ system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 30000
...
@@ -20,7 +20,6 @@ system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxMgmtConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxMgmtConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxShellConns -v 30000
system sh/cfg.sh -n dnode1 -c maxShellConns -v 30000
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 60
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
...
...
tests/script/general/parser/first_last_query.sim
浏览文件 @
1e21eaff
...
@@ -126,3 +126,14 @@ endi
...
@@ -126,3 +126,14 @@ endi
if $data01 != 0 then
if $data01 != 0 then
return -1
return -1
endi
endi
#add check for out of range first/last query
sql select first(ts),last(ts) from first_tb4 where ts>'2018-9-18 1:40:01';
if $row != 0 then
return -1
endi
sql select first(ts),last(ts) from first_tb4 where ts<'2018-9-17 8:50:0';
if $row != 0 then
return -1
endi
\ No newline at end of file
tests/script/general/parser/null_char.sim
浏览文件 @
1e21eaff
...
@@ -105,6 +105,21 @@ if $data03 != 1 then
...
@@ -105,6 +105,21 @@ if $data03 != 1 then
return -1
return -1
endi
endi
sql select tag1 from st2 limit 20 offset 1
if $rows != 0 then
return -1
endi
sql select tag1 from st2 limit 10 offset 2
if $rows != 0 then
return -1
endi
sql select tag1 from st2 limit 0 offset 0
if $rows != 0 then
return -1
endi
sql create table st3 using mt2 tags (NULL, 'ABC', 103, 'FALSE')
sql create table st3 using mt2 tags (NULL, 'ABC', 103, 'FALSE')
sql select tag1, tag2, tag3, tag5 from st3
sql select tag1, tag2, tag3, tag5 from st3
if $rows != 1 then
if $rows != 1 then
...
...
tests/script/general/parser/select_across_vnodes.sim
浏览文件 @
1e21eaff
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
sql connect
sql connect
...
...
tests/script/general/parser/select_from_cache_disk.sim
浏览文件 @
1e21eaff
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
sql connect
sql connect
...
...
tests/script/general/parser/slimit.sim
浏览文件 @
1e21eaff
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
sql connect
sql connect
...
...
tests/script/general/parser/slimit1.sim
浏览文件 @
1e21eaff
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
sql connect
sql connect
...
...
tests/script/general/parser/slimit_alter_tags.sim
浏览文件 @
1e21eaff
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
sql connect
sql connect
...
...
tests/script/general/parser/timestamp.sim
浏览文件 @
1e21eaff
...
@@ -2,7 +2,6 @@ system sh/stop_dnodes.sh
...
@@ -2,7 +2,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
sql connect
sql connect
...
...
tests/script/general/stable/disk.sim
浏览文件 @
1e21eaff
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/stable/dnode3.sim
浏览文件 @
1e21eaff
...
@@ -8,10 +8,6 @@ system sh/cfg.sh -n dnode1 -c walLevel -v 0
...
@@ -8,10 +8,6 @@ system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
...
...
tests/script/general/stable/metrics.sim
浏览文件 @
1e21eaff
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/stable/refcount.sim
浏览文件 @
1e21eaff
...
@@ -2,7 +2,6 @@ system sh/stop_dnodes.sh
...
@@ -2,7 +2,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/stable/show.sim
浏览文件 @
1e21eaff
...
@@ -2,7 +2,6 @@ system sh/stop_dnodes.sh
...
@@ -2,7 +2,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
...
...
tests/script/general/stable/values.sim
浏览文件 @
1e21eaff
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/stable/vnode3.sim
浏览文件 @
1e21eaff
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/stream/metrics_replica1_vnoden.sim
浏览文件 @
1e21eaff
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 3
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 3
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/stream/table_replica1_vnoden.sim
浏览文件 @
1e21eaff
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
...
@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 3
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 3
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/table/delete_reuse1.sim
浏览文件 @
1e21eaff
...
@@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
@@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/table/delete_reuse2.sim
浏览文件 @
1e21eaff
...
@@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
@@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/table/delete_writing.sim
浏览文件 @
1e21eaff
...
@@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
@@ -19,11 +19,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/table/limit.sim
浏览文件 @
1e21eaff
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 129
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 129
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 8
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 8
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/table/vgroup.sim
浏览文件 @
1e21eaff
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c
numOfTotalVnodes
-v 4
system sh/cfg.sh -n dnode1 -c
maxVgroupsPerDb
-v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
...
@@ -78,10 +78,6 @@ if $rows != 0 then
...
@@ -78,10 +78,6 @@ if $rows != 0 then
return -1
return -1
endi
endi
sql create table table1 (ts timestamp, speed int) -x error2
return -1
error2:
$i = 0
$i = 0
$db = $dbPrefix . $i
$db = $dbPrefix . $i
sql drop database $db
sql drop database $db
...
@@ -134,9 +130,6 @@ $i = 4
...
@@ -134,9 +130,6 @@ $i = 4
$db = $dbPrefix . $i
$db = $dbPrefix . $i
sql create database $db
sql create database $db
sql use $db
sql use $db
sql create table table5 (ts timestamp, speed int) -x error3
return -1
error3:
sql show databases
sql show databases
if $rows != 5 then
if $rows != 5 then
...
...
tests/script/sh/clear.sh
浏览文件 @
1e21eaff
...
@@ -122,7 +122,6 @@ echo "numOfLogLines 100000000" >> $TAOS_CFG
...
@@ -122,7 +122,6 @@ echo "numOfLogLines 100000000" >> $TAOS_CFG
echo
"mnodeEqualVnodeNum 0"
>>
$TAOS_CFG
echo
"mnodeEqualVnodeNum 0"
>>
$TAOS_CFG
echo
"clog 0"
>>
$TAOS_CFG
echo
"clog 0"
>>
$TAOS_CFG
echo
"statusInterval 1"
>>
$TAOS_CFG
echo
"statusInterval 1"
>>
$TAOS_CFG
echo
"numOfTotalVnodes 4"
>>
$TAOS_CFG
echo
"asyncLog 0"
>>
$TAOS_CFG
echo
"asyncLog 0"
>>
$TAOS_CFG
echo
"numOfMnodes 1"
>>
$TAOS_CFG
echo
"numOfMnodes 1"
>>
$TAOS_CFG
echo
"locale en_US.UTF-8"
>>
$TAOS_CFG
echo
"locale en_US.UTF-8"
>>
$TAOS_CFG
...
...
tests/script/sh/deploy.sh
浏览文件 @
1e21eaff
...
@@ -139,7 +139,6 @@ echo "clog 2" >> $TAOS_CFG
...
@@ -139,7 +139,6 @@ echo "clog 2" >> $TAOS_CFG
#echo "cache 1" >> $TAOS_CFG
#echo "cache 1" >> $TAOS_CFG
#echo "block 2" >> $TAOS_CFG
#echo "block 2" >> $TAOS_CFG
echo
"statusInterval 1"
>>
$TAOS_CFG
echo
"statusInterval 1"
>>
$TAOS_CFG
echo
"numOfTotalVnodes 4"
>>
$TAOS_CFG
echo
"maxVgroupsPerDb 4"
>>
$TAOS_CFG
echo
"maxVgroupsPerDb 4"
>>
$TAOS_CFG
echo
"minTablesPerVnode 4"
>>
$TAOS_CFG
echo
"minTablesPerVnode 4"
>>
$TAOS_CFG
echo
"maxTablesPerVnode 1000"
>>
$TAOS_CFG
echo
"maxTablesPerVnode 1000"
>>
$TAOS_CFG
...
...
tests/script/tmp/http.sim
浏览文件 @
1e21eaff
...
@@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
@@ -20,11 +20,6 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode2 -c http -v 1
system sh/cfg.sh -n dnode2 -c http -v 1
system sh/cfg.sh -n dnode3 -c http -v 1
system sh/cfg.sh -n dnode3 -c http -v 1
...
...
tests/script/tmp/mnodes.sim
浏览文件 @
1e21eaff
...
@@ -16,10 +16,6 @@ system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
...
@@ -16,10 +16,6 @@ system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 20
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 20
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 20
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode2 -c http -v 1
system sh/cfg.sh -n dnode2 -c http -v 1
system sh/cfg.sh -n dnode3 -c http -v 1
system sh/cfg.sh -n dnode3 -c http -v 1
...
...
tests/script/unique/account/authority.sim
浏览文件 @
1e21eaff
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sleep 3000
...
...
tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/dn3_mn2_killDnode.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/insert_duplicationTs.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/offline_replica2_createTable_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/offline_replica3_alterTag_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/offline_replica3_createTable_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/replica_changeWithArbitrator.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/sync_replica2_dropDb.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/sync_replica2_dropTable.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/sync_replica3_createTable.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/sync_replica3_dropDb.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/arbitrator/sync_replica3_dropTable.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/big/balance.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/big/maxvnodes.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/big/restartSpeed.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/cluster/balance1.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/cluster/balance2.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/cluster/balance3.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/cluster/client1_0.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/cluster/cluster_main.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/cluster/cluster_main0.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/cluster/cluster_main1.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/cluster/cluster_main2.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/cluster/main1_client1_0.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/cluster/main2_client1_0.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/db/delete.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/db/delete_part.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/db/replica_add12.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/db/replica_add13.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/db/replica_add23.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/db/replica_part.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/db/replica_reduce21.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/db/replica_reduce31.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/db/replica_reduce32.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/dnode/alternativeRole.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stable/balance_replica1.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stable/dnode2.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stable/dnode2_stop.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stable/dnode3.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stable/replica2_dnode4.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stable/replica2_vnode3.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stable/replica3_dnode6.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stable/replica3_vnode3.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stream/metrics_balance.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stream/metrics_replica1_dnode2.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stream/metrics_replica2_dnode2_vnoden.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stream/metrics_replica2_dnode3.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stream/metrics_replica3_dnode4.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stream/table_balance.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stream/table_move.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stream/table_replica1_dnode2.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stream/table_replica2_dnode2_vnoden.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stream/table_replica2_dnode3.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/stream/table_replica3_dnode4.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/vnode/many.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/script/unique/vnode/replica2_basic2.sim
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
tests/tsim/src/simExe.c
浏览文件 @
1e21eaff
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录