Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
237c3fe4
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
237c3fe4
编写于
12月 07, 2022
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into feature/TD-19148-D
上级
6b304103
88c76fe0
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
187 addition
and
77 deletion
+187
-77
source/common/src/tglobal.c
source/common/src/tglobal.c
+1
-1
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+1
-1
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+2
-2
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+51
-24
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+4
-2
source/libs/scheduler/inc/schInt.h
source/libs/scheduler/inc/schInt.h
+1
-1
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+2
-0
source/libs/scheduler/src/schTask.c
source/libs/scheduler/src/schTask.c
+1
-6
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+5
-4
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+115
-33
tests/script/tsim/vnode/replica3_repeat.sim
tests/script/tsim/vnode/replica3_repeat.sim
+4
-3
未找到文件。
source/common/src/tglobal.c
浏览文件 @
237c3fe4
...
...
@@ -407,7 +407,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
tsNumOfQnodeQueryThreads
=
tsNumOfCores
*
2
;
tsNumOfQnodeQueryThreads
=
TMAX
(
tsNumOfQnodeQueryThreads
,
4
);
if
(
cfgAddInt32
(
pCfg
,
"numOfQnodeQueryThreads"
,
tsNumOfQnodeQueryThreads
,
1
,
1024
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"numOfQnodeQueryThreads"
,
tsNumOfQnodeQueryThreads
,
4
,
1024
,
0
)
!=
0
)
return
-
1
;
// tsNumOfQnodeFetchThreads = tsNumOfCores / 2;
// tsNumOfQnodeFetchThreads = TMAX(tsNumOfQnodeFetchThreads, 4);
...
...
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
237c3fe4
...
...
@@ -50,7 +50,7 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) {
static
bool
dmFailFastFp
(
tmsg_t
msgType
)
{
// add more msg type later
return
msgType
==
TDMT_SYNC_HEARTBEAT
;
return
msgType
==
TDMT_SYNC_HEARTBEAT
||
msgType
==
TDMT_SYNC_APPEND_ENTRIES
;
}
static
void
dmProcessRpcMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpc
,
SEpSet
*
pEpSet
)
{
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
237c3fe4
...
...
@@ -383,9 +383,9 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) {
pGid
->
syncCanRead
!=
pVload
->
syncCanRead
)
{
mInfo
(
"vgId:%d, state changed by status msg, old state:%s restored:%d canRead:%d new state:%s restored:%d "
"canRead:%d"
,
"canRead:%d
, dnode:%d
"
,
pVgroup
->
vgId
,
syncStr
(
pGid
->
syncState
),
pGid
->
syncRestore
,
pGid
->
syncCanRead
,
syncStr
(
pVload
->
syncState
),
pVload
->
syncRestore
,
pVload
->
syncCanRead
);
syncStr
(
pVload
->
syncState
),
pVload
->
syncRestore
,
pVload
->
syncCanRead
,
pDnode
->
id
);
pGid
->
syncState
=
pVload
->
syncState
;
pGid
->
syncRestore
=
pVload
->
syncRestore
;
pGid
->
syncCanRead
=
pVload
->
syncCanRead
;
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
237c3fe4
...
...
@@ -1126,7 +1126,8 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb,
}
if
(
!
force
)
{
mInfo
(
"vgId:%d, will add 1 vnode"
,
pVgroup
->
vgId
);
if
(
newVg
.
replica
==
1
)
{
mInfo
(
"vgId:%d, will add 1 vnode, replca:1"
,
pVgroup
->
vgId
);
if
(
mndAddVnodeToVgroup
(
pMnode
,
pTrans
,
&
newVg
,
pArray
)
!=
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
newVg
.
replica
-
1
;
++
i
)
{
if
(
mndAddAlterVnodeReplicaAction
(
pMnode
,
pTrans
,
pDb
,
&
newVg
,
newVg
.
vnodeGid
[
i
].
dnodeId
)
!=
0
)
return
-
1
;
...
...
@@ -1134,7 +1135,7 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb,
if
(
mndAddCreateVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVg
,
&
newVg
.
vnodeGid
[
newVg
.
replica
-
1
])
!=
0
)
return
-
1
;
if
(
mndAddAlterVnodeConfirmAction
(
pMnode
,
pTrans
,
pDb
,
&
newVg
)
!=
0
)
return
-
1
;
mInfo
(
"vgId:%d, will remove 1 vnode
"
,
pVgroup
->
vgId
);
mInfo
(
"vgId:%d, will remove 1 vnode, replca:2
"
,
pVgroup
->
vgId
);
newVg
.
replica
--
;
SVnodeGid
del
=
newVg
.
vnodeGid
[
vnIndex
];
newVg
.
vnodeGid
[
vnIndex
]
=
newVg
.
vnodeGid
[
newVg
.
replica
];
...
...
@@ -1154,6 +1155,32 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb,
if
(
mndAddAlterVnodeReplicaAction
(
pMnode
,
pTrans
,
pDb
,
&
newVg
,
newVg
.
vnodeGid
[
i
].
dnodeId
)
!=
0
)
return
-
1
;
}
if
(
mndAddAlterVnodeConfirmAction
(
pMnode
,
pTrans
,
pDb
,
&
newVg
)
!=
0
)
return
-
1
;
}
else
{
// new replica == 3
mInfo
(
"vgId:%d, will add 1 vnode, replca:3"
,
pVgroup
->
vgId
);
if
(
mndAddVnodeToVgroup
(
pMnode
,
pTrans
,
&
newVg
,
pArray
)
!=
0
)
return
-
1
;
mInfo
(
"vgId:%d, will remove 1 vnode, replca:4"
,
pVgroup
->
vgId
);
newVg
.
replica
--
;
SVnodeGid
del
=
newVg
.
vnodeGid
[
vnIndex
];
newVg
.
vnodeGid
[
vnIndex
]
=
newVg
.
vnodeGid
[
newVg
.
replica
];
memset
(
&
newVg
.
vnodeGid
[
newVg
.
replica
],
0
,
sizeof
(
SVnodeGid
));
{
SSdbRaw
*
pRaw
=
mndVgroupActionEncode
(
&
newVg
);
if
(
pRaw
==
NULL
)
return
-
1
;
if
(
mndTransAppendRedolog
(
pTrans
,
pRaw
)
!=
0
)
{
sdbFreeRaw
(
pRaw
);
return
-
1
;
}
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_READY
);
}
if
(
mndAddDropVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVg
,
&
del
,
true
)
!=
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
newVg
.
replica
;
++
i
)
{
if
(
i
==
vnIndex
)
continue
;
if
(
mndAddAlterVnodeReplicaAction
(
pMnode
,
pTrans
,
pDb
,
&
newVg
,
newVg
.
vnodeGid
[
i
].
dnodeId
)
!=
0
)
return
-
1
;
}
if
(
mndAddCreateVnodeAction
(
pMnode
,
pTrans
,
pDb
,
&
newVg
,
&
newVg
.
vnodeGid
[
vnIndex
])
!=
0
)
return
-
1
;
if
(
mndAddAlterVnodeConfirmAction
(
pMnode
,
pTrans
,
pDb
,
&
newVg
)
!=
0
)
return
-
1
;
}
}
else
{
mInfo
(
"vgId:%d, will add 1 vnode and force remove 1 vnode"
,
pVgroup
->
vgId
);
if
(
mndAddVnodeToVgroup
(
pMnode
,
pTrans
,
&
newVg
,
pArray
)
!=
0
)
return
-
1
;
...
...
source/libs/executor/src/executil.c
浏览文件 @
237c3fe4
...
...
@@ -439,7 +439,9 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray*
goto
end
;
}
}
if
(
suid
!=
0
)
{
removeInvalidTable
(
uidList
,
tags
);
}
int32_t
rows
=
taosArrayGetSize
(
uidList
);
if
(
rows
==
0
)
{
...
...
@@ -1604,7 +1606,7 @@ int32_t initQueryTableDataCond(SQueryTableDataCond* pCond, const STableScanPhysi
pCond
->
numOfCols
=
LIST_LENGTH
(
pTableScanNode
->
scan
.
pScanCols
);
pCond
->
colList
=
taosMemoryCalloc
(
pCond
->
numOfCols
,
sizeof
(
SColumnInfo
));
pCond
->
pSlotList
=
taosMemoryMalloc
(
sizeof
(
int32_t
)
*
pCond
->
numOfCols
);
pCond
->
pSlotList
=
taosMemoryMalloc
(
sizeof
(
int32_t
)
*
pCond
->
numOfCols
);
if
(
pCond
->
colList
==
NULL
||
pCond
->
pSlotList
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
taosMemoryFreeClear
(
pCond
->
colList
);
...
...
source/libs/scheduler/inc/schInt.h
浏览文件 @
237c3fe4
...
...
@@ -377,7 +377,7 @@ extern SSchedulerMgmt schMgmt;
#define SCH_IS_EXPLAIN_JOB(_job) (EXPLAIN_MODE_ANALYZE == (_job)->attr.explainMode)
#define SCH_NETWORK_ERR(_code) ((_code) == TSDB_CODE_RPC_BROKEN_LINK || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL)
#define SCH_MERGE_TASK_NETWORK_ERR(_task, _code, _len) \
(SCH_NETWORK_ERR(_code) && (((_len) > 0) || (!SCH_IS_DATA_BIND_TASK(_task))))
(SCH_NETWORK_ERR(_code) && (((_len) > 0) || (!SCH_IS_DATA_BIND_TASK(_task))
|| (_task)->redirectCtx.inRedirect
))
#define SCH_REDIRECT_MSGTYPE(_msgType) \
((_msgType) == TDMT_SCH_LINK_BROKEN || (_msgType) == TDMT_SCH_QUERY || (_msgType) == TDMT_SCH_MERGE_QUERY || \
(_msgType) == TDMT_SCH_FETCH || (_msgType) == TDMT_SCH_MERGE_FETCH)
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
237c3fe4
...
...
@@ -156,6 +156,8 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
SCH_RET
(
schHandleRedirect
(
pJob
,
pTask
,
(
SDataBuf
*
)
pMsg
,
rspCode
));
}
pTask
->
redirectCtx
.
inRedirect
=
false
;
switch
(
msgType
)
{
case
TDMT_VND_COMMIT_RSP
:
{
SCH_ERR_JRET
(
rspCode
);
...
...
source/libs/scheduler/src/schTask.c
浏览文件 @
237c3fe4
...
...
@@ -362,17 +362,12 @@ int32_t schChkUpdateRedirectCtx(SSchJob *pJob, SSchTask *pTask, SEpSet *pEpSet,
}
pCtx
->
totalTimes
++
;
pCtx
->
roundTimes
++
;
if
(
SCH_IS_DATA_BIND_TASK
(
pTask
)
&&
pEpSet
)
{
pCtx
->
roundTotal
=
pEpSet
->
numOfEps
;
pCtx
->
roundTimes
=
0
;
pTask
->
delayExecMs
=
0
;
goto
_return
;
}
pCtx
->
roundTimes
++
;
if
(
pCtx
->
roundTimes
>=
pCtx
->
roundTotal
)
{
int64_t
nowTs
=
taosGetTimestampMs
();
...
...
source/libs/transport/src/transCli.c
浏览文件 @
237c3fe4
...
...
@@ -883,10 +883,11 @@ void cliConnCb(uv_connect_t* req, int status) {
}
if
(
status
!=
0
)
{
tError
(
"%s conn %p failed to connect to %s:%d, reason:%s"
,
CONN_GET_INST_LABEL
(
pConn
),
pConn
,
pConn
->
ip
,
pConn
->
port
,
uv_strerror
(
status
));
SCliMsg
*
pMsg
=
transQueueGet
(
&
pConn
->
cliMsgs
,
0
);
STrans
*
pTransInst
=
pThrd
->
pTransInst
;
tError
(
"%s msg %s failed to send, conn %p failed to connect to %s:%d, reason: %s"
,
CONN_GET_INST_LABEL
(
pConn
),
pMsg
?
TMSG_INFO
(
pMsg
->
msg
.
msgType
)
:
0
,
pConn
,
pConn
->
ip
,
pConn
->
port
,
uv_strerror
(
status
));
if
(
pMsg
!=
NULL
&&
REQUEST_NO_RESP
(
&
pMsg
->
msg
)
&&
(
pTransInst
->
failFastFp
!=
NULL
&&
pTransInst
->
failFastFp
(
pMsg
->
msg
.
msgType
)))
{
char
*
ip
=
pConn
->
ip
;
...
...
@@ -1071,8 +1072,8 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
int32_t
elapse
=
(
int32_t
)(
taosGetTimestampMs
()
-
item
->
timestamp
);
if
(
item
->
count
>=
pTransInst
->
failFastThreshold
&&
(
elapse
>=
0
&&
elapse
<=
pTransInst
->
failFastInterval
))
{
STraceId
*
trace
=
&
(
pMsg
->
msg
.
info
.
traceId
);
tGTrace
(
"%s, msg %
p cancel to send, reason: failed to connect %s:%d: count: %d, at %d"
,
pTransInst
->
label
,
pMsg
,
ip
,
port
,
item
->
count
,
elapse
);
tGTrace
(
"%s, msg %
s cancel to send, reason: failed to connect %s:%d: count: %d, at %d"
,
pTransInst
->
label
,
TMSG_INFO
(
pMsg
->
msg
.
msgType
),
ip
,
port
,
item
->
count
,
elapse
);
destroyCmsg
(
pMsg
);
return
;
}
...
...
tests/script/api/batchprepare.c
浏览文件 @
237c3fe4
...
...
@@ -79,6 +79,9 @@ int64_t bpTs;
#define IS_NUMERIC_TYPE(_t) ((IS_SIGNED_NUMERIC_TYPE(_t)) || (IS_UNSIGNED_NUMERIC_TYPE(_t)) || (IS_FLOAT_TYPE(_t)))
typedef
struct
{
bool
singleTbInsert
;
int32_t
singleTbIdx
;
int64_t
*
tsData
;
bool
*
boolData
;
int8_t
*
tinyData
;
...
...
@@ -116,6 +119,7 @@ int insertMBMETest4(TAOS_STMT *stmt, TAOS *taos);
int
insertMPMETest1
(
TAOS_STMT
*
stmt
,
TAOS
*
taos
);
int
insertAUTOTest1
(
TAOS_STMT
*
stmt
,
TAOS
*
taos
);
int
insertAUTOTest2
(
TAOS_STMT
*
stmt
,
TAOS
*
taos
);
int
insertAUTOTest3
(
TAOS_STMT
*
stmt
,
TAOS
*
taos
);
int
queryColumnTest
(
TAOS_STMT
*
stmt
,
TAOS
*
taos
);
int
queryMiscTest
(
TAOS_STMT
*
stmt
,
TAOS
*
taos
);
...
...
@@ -130,6 +134,7 @@ typedef struct {
int32_t
*
colList
;
// full table column list
int32_t
testType
;
int32_t
autoCreateTbl
;
bool
duplicateValue
;
bool
fullCol
;
int32_t
(
*
runFn
)(
TAOS_STMT
*
,
TAOS
*
);
int32_t
tblNum
;
...
...
@@ -143,46 +148,47 @@ typedef struct {
}
CaseCfg
;
CaseCfg
gCase
[]
=
{
{
"insert:MBSE0-FULL"
,
tListLen
(
shortColList
),
shortColList
,
TTYPE_INSERT
,
0
,
true
,
insertMBSETest1
,
1
,
10
,
10
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE0-FULL"
,
tListLen
(
shortColList
),
shortColList
,
TTYPE_INSERT
,
0
,
true
,
insertMBSETest1
,
10
,
100
,
10
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE0-FULL"
,
tListLen
(
shortColList
),
shortColList
,
TTYPE_INSERT
,
0
,
false
,
true
,
insertMBSETest1
,
1
,
10
,
10
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE0-FULL"
,
tListLen
(
shortColList
),
shortColList
,
TTYPE_INSERT
,
0
,
false
,
true
,
insertMBSETest1
,
10
,
100
,
10
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE1-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
true
,
insertMBSETest1
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE1-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBSETest1
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE1-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBSETest1
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE1-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
true
,
insertMBSETest1
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE1-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBSETest1
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE1-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBSETest1
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE2-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
true
,
insertMBSETest2
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE2-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBSETest2
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE2-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBSETest2
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE2-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
true
,
insertMBSETest2
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE2-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBSETest2
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBSE2-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBSETest2
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME1-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
true
,
insertMBMETest1
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME1-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBMETest1
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME1-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBMETest1
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME1-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
true
,
insertMBMETest1
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME1-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBMETest1
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME1-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBMETest1
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
// 11
{
"insert:MBME2-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
true
,
insertMBMETest2
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME2-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBMETest2
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME2-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBMETest2
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME2-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
true
,
insertMBMETest2
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME2-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBMETest2
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME2-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBMETest2
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME3-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
true
,
insertMBMETest3
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME3-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBMETest3
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME3-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBMETest3
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME3-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
true
,
insertMBMETest3
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME3-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBMETest3
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME3-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBMETest3
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME4-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
true
,
insertMBMETest4
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME4-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBMETest4
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME4-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMBMETest4
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME4-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
true
,
insertMBMETest4
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME4-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBMETest4
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MBME4-C002"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMBMETest4
,
10
,
10
,
2
,
2
,
0
,
0
,
1
,
-
1
},
{
"insert:MPME1-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
true
,
insertMPMETest1
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MPME1-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
insertMPMETest1
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
{
"insert:MPME1-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
true
,
insertMPMETest1
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:MPME1-C012"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
0
,
false
,
false
,
insertMPMETest1
,
10
,
10
,
2
,
12
,
0
,
0
,
1
,
-
1
},
// 22
{
"insert:AUTO1-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
1
,
true
,
insertAUTOTest1
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:AUTO1-TBEXISTS"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
3
,
true
,
insertAUTOTest2
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:AUTO1-FULL"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
1
,
false
,
true
,
insertAUTOTest1
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
{
"insert:AUTO2-TBEXISTS"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_INSERT
,
3
,
false
,
true
,
insertAUTOTest2
,
10
,
10
,
2
,
0
,
0
,
0
,
1
,
-
1
},
// {"insert:AUTO3-NTB", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, true, insertAUTOTest3, 10, 10, 2, 0, 0, 0, 1, -1},
{
"query:SUBT-COLUMN"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_QUERY
,
0
,
false
,
queryColumnTest
,
10
,
10
,
1
,
3
,
0
,
0
,
1
,
2
},
{
"query:SUBT-MISC"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_QUERY
,
0
,
false
,
queryMiscTest
,
10
,
10
,
1
,
3
,
0
,
0
,
1
,
2
},
{
"query:SUBT-COLUMN"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_QUERY
,
0
,
false
,
false
,
queryColumnTest
,
10
,
10
,
1
,
3
,
0
,
0
,
1
,
2
},
{
"query:SUBT-MISC"
,
tListLen
(
fullColList
),
fullColList
,
TTYPE_QUERY
,
0
,
false
,
false
,
queryMiscTest
,
10
,
10
,
1
,
3
,
0
,
0
,
1
,
2
},
// {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryColumnTest, 1, 10, 1, 1, 0, 0, 1, 2},
// {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryMiscTest, 2, 10, 1, 1, 0, 0, 1, 2},
// {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false,
false,
queryColumnTest, 1, 10, 1, 1, 0, 0, 1, 2},
// {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false,
false,
queryMiscTest, 2, 10, 1, 1, 0, 0, 1, 2},
};
...
...
@@ -232,7 +238,7 @@ CaseCtrl gCaseCtrl = {
.numericParam = false,
.rowNum = 0,
.bindColNum = 0,
.bindTagNum =
14
,
.bindTagNum =
0
,
.bindRowNum = 0,
.bindColTypeNum = 0,
.bindColTypeList = NULL,
...
...
@@ -244,7 +250,7 @@ CaseCtrl gCaseCtrl = {
.funcIdxList = NULL,
.checkParamNum = false,
.runTimes = 0,
.caseIdx = 2
3
,
.caseIdx = 2
4
,
.caseNum = 1,
.caseRunIdx = -1,
.caseRunNum = -1,
...
...
@@ -382,7 +388,11 @@ bool colExists(TAOS_MULTI_BIND* pBind, int32_t dataType) {
void
generateInsertSQL
(
BindData
*
data
)
{
int32_t
len
=
0
;
if
(
gCurCase
->
tblNum
>
1
)
{
if
(
data
->
singleTbInsert
)
{
len
=
sprintf
(
data
->
sql
,
"insert into %s%d "
,
bpTbPrefix
,
data
->
singleTbIdx
);
}
else
{
len
=
sprintf
(
data
->
sql
,
"insert into ? "
);
}
}
else
{
len
=
sprintf
(
data
->
sql
,
"insert into %s0 "
,
bpTbPrefix
);
}
...
...
@@ -938,7 +948,14 @@ int32_t prepareInsertData(BindData *data) {
}
for
(
int32_t
i
=
0
;
i
<
allRowNum
;
++
i
)
{
if
(
gCurCase
->
duplicateValue
)
{
data
->
tsData
[
i
]
=
bpTs
;
if
(
i
%
2
==
1
)
{
bpTs
++
;
}
}
else
{
data
->
tsData
[
i
]
=
bpTs
++
;
}
data
->
boolData
[
i
]
=
(
bool
)(
i
%
2
);
data
->
tinyData
[
i
]
=
(
int8_t
)
i
;
data
->
utinyData
[
i
]
=
(
uint8_t
)(
i
+
1
);
...
...
@@ -1251,6 +1268,9 @@ void bpCheckParamNum(TAOS_STMT *stmt) {
void
bpCheckAffectedRows
(
TAOS_STMT
*
stmt
,
int32_t
times
)
{
int32_t
rows
=
taos_stmt_affected_rows
(
stmt
);
int32_t
insertNum
=
gCurCase
->
rowNum
*
gCurCase
->
tblNum
*
times
;
if
(
gCurCase
->
duplicateValue
)
{
insertNum
/=
2
;
}
if
(
insertNum
!=
rows
)
{
printf
(
"!!!affected rows %d mis-match with insert num %d
\n
"
,
rows
,
insertNum
);
exit
(
1
);
...
...
@@ -2014,6 +2034,65 @@ int insertAUTOTest2(TAOS_STMT *stmt, TAOS *taos) {
return
0
;
}
/* normal table [prepare [bind add exec]] */
int
insertAUTOTest3
(
TAOS_STMT
*
stmt
,
TAOS
*
taos
)
{
int32_t
loop
=
0
;
while
(
gCurCase
->
bindColNum
>
0
)
{
BindData
data
=
{
0
};
data
.
singleTbInsert
=
true
;
prepareInsertData
(
&
data
);
int32_t
bindTimes
=
gCurCase
->
rowNum
/
gCurCase
->
bindRowNum
;
for
(
int32_t
t
=
0
;
t
<
gCurCase
->
tblNum
;
++
t
)
{
data
.
singleTbIdx
=
t
;
generateInsertSQL
(
&
data
);
int
code
=
taos_stmt_prepare
(
stmt
,
data
.
sql
,
0
);
if
(
code
!=
0
){
printf
(
"!!!failed to execute taos_stmt_prepare. error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
exit
(
1
);
}
for
(
int32_t
b
=
0
;
b
<
bindTimes
;
++
b
)
{
bpCheckIsInsert
(
stmt
,
1
);
if
(
gCaseCtrl
.
checkParamNum
)
{
bpCheckParamNum
(
stmt
);
}
if
(
bpBindParam
(
stmt
,
data
.
pBind
+
t
*
bindTimes
*
gCurCase
->
bindColNum
+
b
*
gCurCase
->
bindColNum
))
{
exit
(
1
);
}
if
(
taos_stmt_add_batch
(
stmt
))
{
printf
(
"!!!taos_stmt_add_batch error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
exit
(
1
);
}
if
(
taos_stmt_execute
(
stmt
)
!=
0
)
{
printf
(
"!!!taos_stmt_execute error:%s
\n
"
,
taos_stmt_errstr
(
stmt
));
exit
(
1
);
}
}
}
bpCheckIsInsert
(
stmt
,
1
);
destroyData
(
&
data
);
gCurCase
->
bindColNum
-=
2
;
gCurCase
->
fullCol
=
false
;
loop
++
;
}
bpCheckAffectedRows
(
stmt
,
loop
);
gExecLoopTimes
=
loop
;
return
0
;
}
/* select * from table */
int
queryColumnTest
(
TAOS_STMT
*
stmt
,
TAOS
*
taos
)
{
...
...
@@ -2160,7 +2239,7 @@ void prepareCheckResult(TAOS *taos, bool silent) {
sprintf
(
buf
,
"%s%d"
,
bpTbPrefix
,
0
);
}
prepareCheckResultImpl
(
taos
,
buf
,
gCaseCtrl
.
printRes
,
gCurCase
->
rowNum
*
gExecLoopTimes
,
silent
);
prepareCheckResultImpl
(
taos
,
buf
,
gCaseCtrl
.
printRes
,
gCurCase
->
duplicateValue
?
(
gCurCase
->
rowNum
*
gExecLoopTimes
/
2
)
:
(
gCurCase
->
rowNum
*
gExecLoopTimes
)
,
silent
);
}
gExecLoopTimes
=
1
;
...
...
@@ -2749,6 +2828,7 @@ void runAll(TAOS *taos) {
printf
(
"%s Begin
\n
"
,
gCaseCtrl
.
caseCatalog
);
runCaseList
(
taos
);
#if 0
strcpy(gCaseCtrl.caseCatalog, "Micro DB precision Test");
printf("%s Begin\n", gCaseCtrl.caseCatalog);
gCaseCtrl.precision = TIME_PRECISION_MICRO;
...
...
@@ -2805,6 +2885,8 @@ void runAll(TAOS *taos) {
runCaseList(taos);
gCaseCtrl.bindColNum = 0;
#endif
/*
strcpy(gCaseCtrl.caseCatalog, "Bind Col Type Test");
printf("%s Begin\n", gCaseCtrl.caseCatalog);
...
...
tests/script/tsim/vnode/replica3_repeat.sim
浏览文件 @
237c3fe4
...
...
@@ -85,6 +85,7 @@ print ======== step3
system sh/exec.sh -n dnode2 -s stop
sleep 3000
$t = 0
$x = 0
loop:
...
...
@@ -126,8 +127,8 @@ print ======== step8
$lastRows = $data00
print ======== loop Times $x
if $
x
< 2 then
$
x = $x
+ 1
if $
t
< 2 then
$
t = $t
+ 1
goto loop
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录