提交 b69ff547 编写于 作者: G Ganlin Zhao

Merge branch '3.0' into fix/TD-18040

...@@ -416,7 +416,7 @@ int32_t mndStart(SMnode *pMnode) { ...@@ -416,7 +416,7 @@ int32_t mndStart(SMnode *pMnode) {
} }
mndSetRestore(pMnode, true); mndSetRestore(pMnode, true);
} }
grantReset(pMnode, TSDB_GRANT_ALL, 0); grantReset(pMnode, TSDB_GRANT_ALL, 0);
return mndInitTimer(pMnode); return mndInitTimer(pMnode);
...@@ -446,20 +446,6 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { ...@@ -446,20 +446,6 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) {
return -1; return -1;
} }
do {
char *syncNodeStr = sync2SimpleStr(pMgmt->sync);
static int64_t mndTick = 0;
if (++mndTick % 10 == 1) {
mTrace("vgId:%d, sync trace msg:%s, %s", syncGetVgId(pMgmt->sync), TMSG_INFO(pMsg->msgType), syncNodeStr);
}
if (gRaftDetailLog) {
char logBuf[512] = {0};
snprintf(logBuf, sizeof(logBuf), "==mndProcessSyncMsg== msgType:%d, syncNode: %s", pMsg->msgType, syncNodeStr);
syncRpcMsgLog2(logBuf, pMsg);
}
taosMemoryFree(syncNodeStr);
} while (0);
// ToDo: ugly! use function pointer // ToDo: ugly! use function pointer
if (syncNodeStrategy(pSyncNode) == SYNC_STRATEGY_STANDARD_SNAPSHOT) { if (syncNodeStrategy(pSyncNode) == SYNC_STRATEGY_STANDARD_SNAPSHOT) {
if (pMsg->msgType == TDMT_SYNC_TIMEOUT) { if (pMsg->msgType == TDMT_SYNC_TIMEOUT) {
......
...@@ -335,10 +335,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries ...@@ -335,10 +335,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries
// nextIndex' = [nextIndex EXCEPT ![i][j] = m.mmatchIndex + 1] // nextIndex' = [nextIndex EXCEPT ![i][j] = m.mmatchIndex + 1]
syncIndexMgrSetIndex(ths->pNextIndex, &(pMsg->srcId), pMsg->matchIndex + 1); syncIndexMgrSetIndex(ths->pNextIndex, &(pMsg->srcId), pMsg->matchIndex + 1);
if (gRaftDetailLog) {
sTrace("update next match, index:%" PRId64 ", success:%d", pMsg->matchIndex + 1, pMsg->success);
}
// matchIndex' = [matchIndex EXCEPT ![i][j] = m.mmatchIndex] // matchIndex' = [matchIndex EXCEPT ![i][j] = m.mmatchIndex]
syncIndexMgrSetIndex(ths->pMatchIndex, &(pMsg->srcId), pMsg->matchIndex); syncIndexMgrSetIndex(ths->pMatchIndex, &(pMsg->srcId), pMsg->matchIndex);
...@@ -349,9 +345,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries ...@@ -349,9 +345,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries
} else { } else {
SyncIndex nextIndex = syncIndexMgrGetIndex(ths->pNextIndex, &(pMsg->srcId)); SyncIndex nextIndex = syncIndexMgrGetIndex(ths->pNextIndex, &(pMsg->srcId));
if (gRaftDetailLog) {
sTrace("update next index not match, begin, index:%" PRId64 ", success:%d", nextIndex, pMsg->success);
}
// notice! int64, uint64 // notice! int64, uint64
if (nextIndex > SYNC_INDEX_BEGIN) { if (nextIndex > SYNC_INDEX_BEGIN) {
...@@ -393,9 +386,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries ...@@ -393,9 +386,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries
} }
syncIndexMgrSetIndex(ths->pNextIndex, &(pMsg->srcId), nextIndex); syncIndexMgrSetIndex(ths->pNextIndex, &(pMsg->srcId), nextIndex);
if (gRaftDetailLog) {
sTrace("update next index not match, end, index:%" PRId64 ", success:%d", nextIndex, pMsg->success);
}
} }
SyncIndex afterNextIndex = syncIndexMgrGetIndex(ths->pNextIndex, &(pMsg->srcId)); SyncIndex afterNextIndex = syncIndexMgrGetIndex(ths->pNextIndex, &(pMsg->srcId));
......
...@@ -88,10 +88,6 @@ int64_t syncOpen(const SSyncInfo* pSyncInfo) { ...@@ -88,10 +88,6 @@ int64_t syncOpen(const SSyncInfo* pSyncInfo) {
SSyncNode* pSyncNode = syncNodeOpen(pSyncInfo); SSyncNode* pSyncNode = syncNodeOpen(pSyncInfo);
ASSERT(pSyncNode != NULL); ASSERT(pSyncNode != NULL);
if (gRaftDetailLog) {
syncNodeLog2("syncNodeOpen open success", pSyncNode);
}
pSyncNode->rid = taosAddRef(tsNodeRefId, pSyncNode); pSyncNode->rid = taosAddRef(tsNodeRefId, pSyncNode);
if (pSyncNode->rid < 0) { if (pSyncNode->rid < 0) {
syncFreeNode(pSyncNode); syncFreeNode(pSyncNode);
...@@ -245,11 +241,7 @@ int32_t syncReconfig(int64_t rid, const SSyncCfg* pNewCfg) { ...@@ -245,11 +241,7 @@ int32_t syncReconfig(int64_t rid, const SSyncCfg* pNewCfg) {
return -1; return -1;
} }
char* newconfig = syncCfg2Str((SSyncCfg*)pNewCfg); char* newconfig = syncCfg2Str((SSyncCfg*)pNewCfg);
if (gRaftDetailLog) {
sInfo("==syncReconfig== newconfig:%s", newconfig);
}
int32_t ret = 0; int32_t ret = 0;
SRpcMsg rpcMsg = {0}; SRpcMsg rpcMsg = {0};
...@@ -912,12 +904,6 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) { ...@@ -912,12 +904,6 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) {
ASSERT(pSyncNode->pRaftCfg != NULL); ASSERT(pSyncNode->pRaftCfg != NULL);
pSyncInfo->syncCfg = pSyncNode->pRaftCfg->cfg; pSyncInfo->syncCfg = pSyncNode->pRaftCfg->cfg;
if (gRaftDetailLog) {
char* seralized = raftCfg2Str(pSyncNode->pRaftCfg);
sInfo("syncNodeOpen update config :%s", seralized);
taosMemoryFree(seralized);
}
raftCfgClose(pSyncNode->pRaftCfg); raftCfgClose(pSyncNode->pRaftCfg);
} }
...@@ -1348,13 +1334,6 @@ int32_t syncNodeSendMsgById(const SRaftId* destRaftId, SSyncNode* pSyncNode, SRp ...@@ -1348,13 +1334,6 @@ int32_t syncNodeSendMsgById(const SRaftId* destRaftId, SSyncNode* pSyncNode, SRp
SEpSet epSet; SEpSet epSet;
syncUtilraftId2EpSet(destRaftId, &epSet); syncUtilraftId2EpSet(destRaftId, &epSet);
if (pSyncNode->FpSendMsg != NULL) { if (pSyncNode->FpSendMsg != NULL) {
if (gRaftDetailLog) {
char* JsonStr = syncRpcMsg2Str(pMsg);
syncUtilJson2Line(JsonStr);
sTrace("sync send msg, vgId:%d, type:%d, msg:%s", pSyncNode->vgId, pMsg->msgType, JsonStr);
taosMemoryFree(JsonStr);
}
// htonl // htonl
syncUtilMsgHtoN(pMsg->pCont); syncUtilMsgHtoN(pMsg->pCont);
......
#!/bin/bash #!/bin/bash
if [ $# != 6 ] ; then if [ $# != 7 ] ; then
echo "Uasge: $0 instances vgroups replica ctables rows weak" echo "Uasge: $0 instances vgroups replica ctables rows weak drop(yes/no)"
echo "" echo ""
exit 1 exit 1
fi fi
...@@ -12,11 +12,13 @@ replica=$3 ...@@ -12,11 +12,13 @@ replica=$3
ctables=$4 ctables=$4
rows=$5 rows=$5
weak=$6 weak=$6
drop=$7
echo "params: instances:${instances}, vgroups:${vgroups}, replica:${replica}, ctables:${ctables}, rows:${rows}"
echo "params: instances:${instances}, vgroups:${vgroups}, replica:${replica}, ctables:${ctables}, rows:${rows}, weak:${weak}, drop:${drop}"
dt=`date "+%Y-%m-%d-%H-%M-%S"` dt=`date "+%Y-%m-%d-%H-%M-%S"`
casedir=instances_${instances}_vgroups_${vgroups}_replica_${replica}_ctables_${ctables}_rows_${rows}_weak_${weak}_${dt} casedir=instances_${instances}_vgroups_${vgroups}_replica_${replica}_ctables_${ctables}_rows_${rows}_weak_${weak}_drop_${drop}_${dt}
mkdir ${casedir} mkdir ${casedir}
cp ./insert.tpl.json ${casedir} cp ./insert.tpl.json ${casedir}
cd ${casedir} cd ${casedir}
...@@ -26,6 +28,7 @@ for i in `seq 1 ${instances}`;do ...@@ -26,6 +28,7 @@ for i in `seq 1 ${instances}`;do
cfg_file=bench_${i}.json cfg_file=bench_${i}.json
cp ./insert.tpl.json ${cfg_file} cp ./insert.tpl.json ${cfg_file}
rstfile=result_${i} rstfile=result_${i}
sed -i 's/tpl_drop_tpl/'${drop}'/g' ${cfg_file}
sed -i 's/tpl_vgroups_tpl/'${vgroups}'/g' ${cfg_file} sed -i 's/tpl_vgroups_tpl/'${vgroups}'/g' ${cfg_file}
sed -i 's/tpl_replica_tpl/'${replica}'/g' ${cfg_file} sed -i 's/tpl_replica_tpl/'${replica}'/g' ${cfg_file}
sed -i 's/tpl_ctables_tpl/'${ctables}'/g' ${cfg_file} sed -i 's/tpl_ctables_tpl/'${ctables}'/g' ${cfg_file}
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
"databases": [ "databases": [
{ {
"dbinfo": { "dbinfo": {
"name": "db1", "name": "db_auto",
"drop": "no", "drop": "tpl_drop_tpl",
"wal_retention_period": -1, "wal_retention_period": -1,
"wal_retention_size": -1, "wal_retention_size": -1,
"drop": "no", "drop": "no",
......
...@@ -401,7 +401,7 @@ ...@@ -401,7 +401,7 @@
./test.sh -f tsim/field/tinyint.sim ./test.sh -f tsim/field/tinyint.sim
./test.sh -f tsim/field/unsigined_bigint.sim ./test.sh -f tsim/field/unsigined_bigint.sim
# ---- vector # ---- vector ----
./test.sh -f tsim/vector/metrics_field.sim ./test.sh -f tsim/vector/metrics_field.sim
./test.sh -f tsim/vector/metrics_mix.sim ./test.sh -f tsim/vector/metrics_mix.sim
./test.sh -f tsim/vector/metrics_query.sim ./test.sh -f tsim/vector/metrics_query.sim
...@@ -414,10 +414,10 @@ ...@@ -414,10 +414,10 @@
./test.sh -f tsim/vector/table_query.sim ./test.sh -f tsim/vector/table_query.sim
./test.sh -f tsim/vector/table_time.sim ./test.sh -f tsim/vector/table_time.sim
# ---- wal # ---- wal ----
./test.sh -f tsim/wal/kill.sim ./test.sh -f tsim/wal/kill.sim
# ---- tag # ---- tag ----
./test.sh -f tsim/tag/3.sim ./test.sh -f tsim/tag/3.sim
./test.sh -f tsim/tag/4.sim ./test.sh -f tsim/tag/4.sim
./test.sh -f tsim/tag/5.sim ./test.sh -f tsim/tag/5.sim
......
...@@ -831,16 +831,10 @@ sql alter table $mt add tag tgcol4 int ...@@ -831,16 +831,10 @@ sql alter table $mt add tag tgcol4 int
sql alter table $mt add tag tgcol5 bigint sql alter table $mt add tag tgcol5 bigint
sql alter table $mt add tag tgcol6 bigint sql alter table $mt add tag tgcol6 bigint
return sql reset query cache
sql alter table $mt add tag tgcol7 bigint -x step141
return -1
step141:
sql reset query cache
sql alter table $mt drop tag tgcol6 sql alter table $mt drop tag tgcol6
sql alter table $mt add tag tgcol7 bigint sql alter table $mt add tag tgcol7 bigint
sql alter table $mt add tag tgcol8 bigint -x step142 sql alter table $mt add tag tgcol8 bigint
return -1
step142:
print =============== clear print =============== clear
sql drop database $db sql drop database $db
......
...@@ -100,11 +100,13 @@ sql select * from db.stb ...@@ -100,11 +100,13 @@ sql select * from db.stb
sql select * from db.stb sql select * from db.stb
sql_error create table db.ctb2 using db.stb tags(101, "102") sql_error create table db.ctb2 using db.stb tags(101, "102")
sql create table db.ctb2 using db.stb tags(101, 102, "103", 104) sql create table db.ctb2 using db.stb tags(101, 102, "103", 104)
sql insert into db.ctb2 values(now, 1, 2, 3) sql insert into db.ctb2 values(now, 1, 2, 3)
print =============== step6: query data print =============== step6: query data
sql select * from db.stb where tbname = 'ctb2'; sql select * from db.stb where tbname = 'ctb2';
sql alter table ctb2 set tag t1=1;
sql alter table ctb2 set tag t3='3';
sql select * from db.stb where t1 = 1;
print =============== step7: normal table print =============== step7: normal table
sql create database d1 replica 1 duration 7 keep 50 sql create database d1 replica 1 duration 7 keep 50
......
...@@ -123,6 +123,12 @@ print =============== step6: in cast ...@@ -123,6 +123,12 @@ print =============== step6: in cast
sql select 1+1n; sql select 1+1n;
sql select cast(1 as timestamp)+1n; sql select cast(1 as timestamp)+1n;
sql select cast(1 as timestamp)+1y; sql select cast(1 as timestamp)+1y;
sql select * from tb1 where ts in ('2018-07-10 16:31:01', '2022-07-10 16:31:03', 1657441865000);
sql select * from tb1 where tbcol2 in (257);
sql select * from tb1 where tbcol3 in (2, 257);
sql select * from stb where ts in ('2018-07-10 16:31:01', '2022-07-10 16:31:03', 1657441865000);
sql select * from stb where tbcol2 in (257);
sql select * from stb where tbcol3 in (2, 257);
print =============== check print =============== check
$null= $null=
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册