Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f6e6554b
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f6e6554b
编写于
5月 27, 2022
作者:
D
dapan1121
提交者:
GitHub
5月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13041 from taosdata/feature/schema.version
feat: add tag version
上级
bcb6f4d1
823bfcb3
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
30 addition
and
18 deletion
+30
-18
include/libs/catalog/catalog.h
include/libs/catalog/catalog.h
+1
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+7
-7
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+2
-1
source/dnode/mnode/impl/test/stb/stb.cpp
source/dnode/mnode/impl/test/stb/stb.cpp
+1
-1
source/libs/catalog/inc/catalogInt.h
source/libs/catalog/inc/catalogInt.h
+1
-1
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+3
-2
source/libs/catalog/src/ctgCache.c
source/libs/catalog/src/ctgCache.c
+6
-3
source/libs/qworker/inc/qworkerInt.h
source/libs/qworker/inc/qworkerInt.h
+1
-0
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+1
-1
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+7
-2
未找到文件。
include/libs/catalog/catalog.h
浏览文件 @
f6e6554b
...
@@ -101,6 +101,7 @@ typedef struct SDbVgVersion {
...
@@ -101,6 +101,7 @@ typedef struct SDbVgVersion {
typedef
struct
STbSVersion
{
typedef
struct
STbSVersion
{
char
*
tbFName
;
char
*
tbFName
;
int32_t
sver
;
int32_t
sver
;
int32_t
tver
;
}
STbSVersion
;
}
STbSVersion
;
typedef
struct
SUserAuthVersion
{
typedef
struct
SUserAuthVersion
{
...
...
source/client/src/clientImpl.c
浏览文件 @
f6e6554b
...
@@ -413,7 +413,7 @@ int32_t validateSversion(SRequestObj* pRequest, void* res) {
...
@@ -413,7 +413,7 @@ int32_t validateSversion(SRequestObj* pRequest, void* res) {
for
(
int32_t
i
=
0
;
i
<
tbNum
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
tbNum
;
++
i
)
{
STbVerInfo
*
tbInfo
=
taosArrayGet
(
pTbArray
,
i
);
STbVerInfo
*
tbInfo
=
taosArrayGet
(
pTbArray
,
i
);
STbSVersion
tbSver
=
{.
tbFName
=
tbInfo
->
tbFName
,
.
sver
=
tbInfo
->
sversion
};
STbSVersion
tbSver
=
{.
tbFName
=
tbInfo
->
tbFName
,
.
sver
=
tbInfo
->
sversion
,
.
tver
=
tbInfo
->
tversion
};
taosArrayPush
(
pArray
,
&
tbSver
);
taosArrayPush
(
pArray
,
&
tbSver
);
}
}
}
}
...
@@ -745,12 +745,12 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
...
@@ -745,12 +745,12 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
pRequest
->
metric
.
rsp
=
taosGetTimestampUs
();
pRequest
->
metric
.
rsp
=
taosGetTimestampUs
();
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
//
STscObj* pTscObj = pRequest->pTscObj;
if
(
pEpSet
)
{
//
if (pEpSet) {
if
(
!
isEpsetEqual
(
&
pTscObj
->
pAppInfo
->
mgmtEp
.
epSet
,
pEpSet
))
{
//
if (!isEpsetEqual(&pTscObj->pAppInfo->mgmtEp.epSet, pEpSet)) {
updateEpSet_s
(
&
pTscObj
->
pAppInfo
->
mgmtEp
,
pEpSet
);
//
updateEpSet_s(&pTscObj->pAppInfo->mgmtEp, pEpSet);
}
//
}
}
//
}
/*
/*
* There is not response callback function for submit response.
* There is not response callback function for submit response.
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
f6e6554b
...
@@ -1503,6 +1503,7 @@ static int32_t mndBuildStbSchemaImp(SDbObj *pDb, SStbObj *pStb, const char *tbNa
...
@@ -1503,6 +1503,7 @@ static int32_t mndBuildStbSchemaImp(SDbObj *pDb, SStbObj *pStb, const char *tbNa
pRsp
->
precision
=
pDb
->
cfg
.
precision
;
pRsp
->
precision
=
pDb
->
cfg
.
precision
;
pRsp
->
tableType
=
TSDB_SUPER_TABLE
;
pRsp
->
tableType
=
TSDB_SUPER_TABLE
;
pRsp
->
sversion
=
pStb
->
colVer
;
pRsp
->
sversion
=
pStb
->
colVer
;
pRsp
->
tversion
=
pStb
->
tagVer
;
pRsp
->
suid
=
pStb
->
uid
;
pRsp
->
suid
=
pStb
->
uid
;
pRsp
->
tuid
=
pStb
->
uid
;
pRsp
->
tuid
=
pStb
->
uid
;
...
@@ -1629,7 +1630,7 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *pStbVersions, int
...
@@ -1629,7 +1630,7 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *pStbVersions, int
metaRsp
.
suid
=
pStbVersion
->
suid
;
metaRsp
.
suid
=
pStbVersion
->
suid
;
}
}
if
(
pStbVersion
->
sversion
!=
metaRsp
.
sversion
)
{
if
(
pStbVersion
->
sversion
!=
metaRsp
.
sversion
||
pStbVersion
->
tversion
!=
metaRsp
.
tversion
)
{
taosArrayPush
(
batchMetaRsp
.
pArray
,
&
metaRsp
);
taosArrayPush
(
batchMetaRsp
.
pArray
,
&
metaRsp
);
}
else
{
}
else
{
tFreeSTableMetaRsp
(
&
metaRsp
);
tFreeSTableMetaRsp
(
&
metaRsp
);
...
...
source/dnode/mnode/impl/test/stb/stb.cpp
浏览文件 @
f6e6554b
...
@@ -344,7 +344,7 @@ TEST_F(MndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
...
@@ -344,7 +344,7 @@ TEST_F(MndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
EXPECT_EQ
(
metaRsp
.
precision
,
TSDB_TIME_PRECISION_MILLI
);
EXPECT_EQ
(
metaRsp
.
precision
,
TSDB_TIME_PRECISION_MILLI
);
EXPECT_EQ
(
metaRsp
.
tableType
,
TSDB_SUPER_TABLE
);
EXPECT_EQ
(
metaRsp
.
tableType
,
TSDB_SUPER_TABLE
);
EXPECT_EQ
(
metaRsp
.
sversion
,
1
);
EXPECT_EQ
(
metaRsp
.
sversion
,
1
);
EXPECT_EQ
(
metaRsp
.
tversion
,
0
);
EXPECT_EQ
(
metaRsp
.
tversion
,
1
);
EXPECT_GT
(
metaRsp
.
suid
,
0
);
EXPECT_GT
(
metaRsp
.
suid
,
0
);
EXPECT_GT
(
metaRsp
.
tuid
,
0
);
EXPECT_GT
(
metaRsp
.
tuid
,
0
);
EXPECT_EQ
(
metaRsp
.
vgId
,
0
);
EXPECT_EQ
(
metaRsp
.
vgId
,
0
);
...
...
source/libs/catalog/inc/catalogInt.h
浏览文件 @
f6e6554b
...
@@ -447,7 +447,7 @@ void ctgReleaseVgInfo(SCtgDBCache *dbCache);
...
@@ -447,7 +447,7 @@ void ctgReleaseVgInfo(SCtgDBCache *dbCache);
int32_t
ctgAcquireVgInfoFromCache
(
SCatalog
*
pCtg
,
const
char
*
dbFName
,
SCtgDBCache
**
pCache
);
int32_t
ctgAcquireVgInfoFromCache
(
SCatalog
*
pCtg
,
const
char
*
dbFName
,
SCtgDBCache
**
pCache
);
int32_t
ctgTbMetaExistInCache
(
SCatalog
*
pCtg
,
char
*
dbFName
,
char
*
tbName
,
int32_t
*
exist
);
int32_t
ctgTbMetaExistInCache
(
SCatalog
*
pCtg
,
char
*
dbFName
,
char
*
tbName
,
int32_t
*
exist
);
int32_t
ctgReadTbMetaFromCache
(
SCatalog
*
pCtg
,
SCtgTbMetaCtx
*
ctx
,
STableMeta
**
pTableMeta
);
int32_t
ctgReadTbMetaFromCache
(
SCatalog
*
pCtg
,
SCtgTbMetaCtx
*
ctx
,
STableMeta
**
pTableMeta
);
int32_t
ctgReadTb
SverFromCache
(
SCatalog
*
pCtg
,
const
SName
*
pTableName
,
int32_t
*
s
ver
,
int32_t
*
tbType
,
uint64_t
*
suid
,
char
*
stbName
);
int32_t
ctgReadTb
VerFromCache
(
SCatalog
*
pCtg
,
const
SName
*
pTableName
,
int32_t
*
sver
,
int32_t
*
t
ver
,
int32_t
*
tbType
,
uint64_t
*
suid
,
char
*
stbName
);
int32_t
ctgChkAuthFromCache
(
SCatalog
*
pCtg
,
const
char
*
user
,
const
char
*
dbFName
,
AUTH_TYPE
type
,
bool
*
inCache
,
bool
*
pass
);
int32_t
ctgChkAuthFromCache
(
SCatalog
*
pCtg
,
const
char
*
user
,
const
char
*
dbFName
,
AUTH_TYPE
type
,
bool
*
inCache
,
bool
*
pass
);
int32_t
ctgPutRmDBToQueue
(
SCatalog
*
pCtg
,
const
char
*
dbFName
,
int64_t
dbId
);
int32_t
ctgPutRmDBToQueue
(
SCatalog
*
pCtg
,
const
char
*
dbFName
,
int64_t
dbId
);
int32_t
ctgPutRmStbToQueue
(
SCatalog
*
pCtg
,
const
char
*
dbFName
,
int64_t
dbId
,
const
char
*
stbName
,
uint64_t
suid
,
bool
syncReq
);
int32_t
ctgPutRmStbToQueue
(
SCatalog
*
pCtg
,
const
char
*
dbFName
,
int64_t
dbId
,
const
char
*
stbName
,
uint64_t
suid
,
bool
syncReq
);
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
f6e6554b
...
@@ -812,6 +812,7 @@ int32_t catalogChkTbMetaVersion(SCatalog* pCtg, void *pTrans, const SEpSet* pMgm
...
@@ -812,6 +812,7 @@ int32_t catalogChkTbMetaVersion(SCatalog* pCtg, void *pTrans, const SEpSet* pMgm
SName
name
;
SName
name
;
int32_t
sver
=
0
;
int32_t
sver
=
0
;
int32_t
tver
=
0
;
int32_t
tbNum
=
taosArrayGetSize
(
pTables
);
int32_t
tbNum
=
taosArrayGetSize
(
pTables
);
for
(
int32_t
i
=
0
;
i
<
tbNum
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
tbNum
;
++
i
)
{
STbSVersion
*
pTb
=
(
STbSVersion
*
)
taosArrayGet
(
pTables
,
i
);
STbSVersion
*
pTb
=
(
STbSVersion
*
)
taosArrayGet
(
pTables
,
i
);
...
@@ -828,8 +829,8 @@ int32_t catalogChkTbMetaVersion(SCatalog* pCtg, void *pTrans, const SEpSet* pMgm
...
@@ -828,8 +829,8 @@ int32_t catalogChkTbMetaVersion(SCatalog* pCtg, void *pTrans, const SEpSet* pMgm
int32_t
tbType
=
0
;
int32_t
tbType
=
0
;
uint64_t
suid
=
0
;
uint64_t
suid
=
0
;
char
stbName
[
TSDB_TABLE_FNAME_LEN
];
char
stbName
[
TSDB_TABLE_FNAME_LEN
];
ctgReadTb
SverFromCache
(
pCtg
,
&
name
,
&
s
ver
,
&
tbType
,
&
suid
,
stbName
);
ctgReadTb
VerFromCache
(
pCtg
,
&
name
,
&
sver
,
&
t
ver
,
&
tbType
,
&
suid
,
stbName
);
if
(
sver
>=
0
&&
sver
<
pTb
->
sver
)
{
if
(
(
sver
>=
0
&&
sver
<
pTb
->
sver
)
||
(
tver
>=
0
&&
tver
<
pTb
->
tver
)
)
{
switch
(
tbType
)
{
switch
(
tbType
)
{
case
TSDB_CHILD_TABLE
:
{
case
TSDB_CHILD_TABLE
:
{
SName
stb
=
name
;
SName
stb
=
name
;
...
...
source/libs/catalog/src/ctgCache.c
浏览文件 @
f6e6554b
...
@@ -322,9 +322,10 @@ _return:
...
@@ -322,9 +322,10 @@ _return:
CTG_RET
(
code
);
CTG_RET
(
code
);
}
}
int32_t
ctgReadTb
SverFromCache
(
SCatalog
*
pCtg
,
const
SName
*
pTableName
,
int32_t
*
s
ver
,
int32_t
*
tbType
,
uint64_t
*
suid
,
int32_t
ctgReadTb
VerFromCache
(
SCatalog
*
pCtg
,
const
SName
*
pTableName
,
int32_t
*
sver
,
int32_t
*
t
ver
,
int32_t
*
tbType
,
uint64_t
*
suid
,
char
*
stbName
)
{
char
*
stbName
)
{
*
sver
=
-
1
;
*
sver
=
-
1
;
*
tver
=
-
1
;
if
(
NULL
==
pCtg
->
dbCache
)
{
if
(
NULL
==
pCtg
->
dbCache
)
{
ctgDebug
(
"empty tbmeta cache, tbName:%s"
,
pTableName
->
tname
);
ctgDebug
(
"empty tbmeta cache, tbName:%s"
,
pTableName
->
tname
);
...
@@ -348,6 +349,7 @@ int32_t ctgReadTbSverFromCache(SCatalog *pCtg, const SName *pTableName, int32_t
...
@@ -348,6 +349,7 @@ int32_t ctgReadTbSverFromCache(SCatalog *pCtg, const SName *pTableName, int32_t
*
suid
=
tbMeta
->
suid
;
*
suid
=
tbMeta
->
suid
;
if
(
*
tbType
!=
TSDB_CHILD_TABLE
)
{
if
(
*
tbType
!=
TSDB_CHILD_TABLE
)
{
*
sver
=
tbMeta
->
sversion
;
*
sver
=
tbMeta
->
sversion
;
*
tver
=
tbMeta
->
tversion
;
}
}
}
}
CTG_UNLOCK
(
CTG_READ
,
&
dbCache
->
tbCache
.
metaLock
);
CTG_UNLOCK
(
CTG_READ
,
&
dbCache
->
tbCache
.
metaLock
);
...
@@ -359,7 +361,7 @@ int32_t ctgReadTbSverFromCache(SCatalog *pCtg, const SName *pTableName, int32_t
...
@@ -359,7 +361,7 @@ int32_t ctgReadTbSverFromCache(SCatalog *pCtg, const SName *pTableName, int32_t
if
(
*
tbType
!=
TSDB_CHILD_TABLE
)
{
if
(
*
tbType
!=
TSDB_CHILD_TABLE
)
{
ctgReleaseDBCache
(
pCtg
,
dbCache
);
ctgReleaseDBCache
(
pCtg
,
dbCache
);
ctgDebug
(
"Got sver %d
from cache, type:%d, dbFName:%s, tbName:%s"
,
*
s
ver
,
*
tbType
,
dbFName
,
pTableName
->
tname
);
ctgDebug
(
"Got sver %d
tver %d from cache, type:%d, dbFName:%s, tbName:%s"
,
*
sver
,
*
t
ver
,
*
tbType
,
dbFName
,
pTableName
->
tname
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -391,12 +393,13 @@ int32_t ctgReadTbSverFromCache(SCatalog *pCtg, const SName *pTableName, int32_t
...
@@ -391,12 +393,13 @@ int32_t ctgReadTbSverFromCache(SCatalog *pCtg, const SName *pTableName, int32_t
stbName
[
nameLen
]
=
0
;
stbName
[
nameLen
]
=
0
;
*
sver
=
(
*
stbMeta
)
->
sversion
;
*
sver
=
(
*
stbMeta
)
->
sversion
;
*
tver
=
(
*
stbMeta
)
->
tversion
;
CTG_UNLOCK
(
CTG_READ
,
&
dbCache
->
tbCache
.
stbLock
);
CTG_UNLOCK
(
CTG_READ
,
&
dbCache
->
tbCache
.
stbLock
);
ctgReleaseDBCache
(
pCtg
,
dbCache
);
ctgReleaseDBCache
(
pCtg
,
dbCache
);
ctgDebug
(
"Got sver %d
from cache, type:%d, dbFName:%s, tbName:%s"
,
*
s
ver
,
*
tbType
,
dbFName
,
pTableName
->
tname
);
ctgDebug
(
"Got sver %d
tver %d from cache, type:%d, dbFName:%s, tbName:%s"
,
*
sver
,
*
t
ver
,
*
tbType
,
dbFName
,
pTableName
->
tname
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
source/libs/qworker/inc/qworkerInt.h
浏览文件 @
f6e6554b
...
@@ -227,6 +227,7 @@ typedef struct SQWorkerMgmt {
...
@@ -227,6 +227,7 @@ typedef struct SQWorkerMgmt {
#define QW_ELOG(_param, ...) qError("QW:%p " _param, mgmt, __VA_ARGS__)
#define QW_ELOG(_param, ...) qError("QW:%p " _param, mgmt, __VA_ARGS__)
#define QW_DLOG(_param, ...) qDebug("QW:%p " _param, mgmt, __VA_ARGS__)
#define QW_DLOG(_param, ...) qDebug("QW:%p " _param, mgmt, __VA_ARGS__)
#define QW_TLOG(_param, ...) qTrace("QW:%p " _param, mgmt, __VA_ARGS__)
#define QW_DUMP(_param, ...) \
#define QW_DUMP(_param, ...) \
do { \
do { \
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
f6e6554b
...
@@ -1409,7 +1409,7 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) {
...
@@ -1409,7 +1409,7 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) {
SQWSchStatus
*
sch
=
(
SQWSchStatus
*
)
pIter
;
SQWSchStatus
*
sch
=
(
SQWSchStatus
*
)
pIter
;
if
(
NULL
==
sch
->
hbConnInfo
.
handle
)
{
if
(
NULL
==
sch
->
hbConnInfo
.
handle
)
{
uint64_t
*
sId
=
taosHashGetKey
(
pIter
,
NULL
);
uint64_t
*
sId
=
taosHashGetKey
(
pIter
,
NULL
);
QW_
D
LOG
(
"cancel send hb to sch %"
PRIx64
" cause of no connection handle"
,
*
sId
);
QW_
T
LOG
(
"cancel send hb to sch %"
PRIx64
" cause of no connection handle"
,
*
sId
);
pIter
=
taosHashIterate
(
mgmt
->
schHash
,
pIter
);
pIter
=
taosHashIterate
(
mgmt
->
schHash
,
pIter
);
continue
;
continue
;
}
}
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
f6e6554b
...
@@ -557,7 +557,9 @@ int32_t schMakeHbCallbackParam(SSchJob *pJob, SSchTask *pTask, void **pParam) {
...
@@ -557,7 +557,9 @@ int32_t schMakeHbCallbackParam(SSchJob *pJob, SSchTask *pTask, void **pParam) {
SQueryNodeAddr
*
addr
=
taosArrayGet
(
pTask
->
candidateAddrs
,
pTask
->
candidateIdx
);
SQueryNodeAddr
*
addr
=
taosArrayGet
(
pTask
->
candidateAddrs
,
pTask
->
candidateIdx
);
param
->
nodeEpId
.
nodeId
=
addr
->
nodeId
;
param
->
nodeEpId
.
nodeId
=
addr
->
nodeId
;
memcpy
(
&
param
->
nodeEpId
.
ep
,
SCH_GET_CUR_EP
(
addr
),
sizeof
(
SEp
));
SEp
*
pEp
=
SCH_GET_CUR_EP
(
addr
);
strcpy
(
param
->
nodeEpId
.
ep
.
fqdn
,
pEp
->
fqdn
);
param
->
nodeEpId
.
ep
.
port
=
pEp
->
port
;
param
->
pTrans
=
pJob
->
pTrans
;
param
->
pTrans
=
pJob
->
pTrans
;
*
pParam
=
param
;
*
pParam
=
param
;
...
@@ -788,7 +790,10 @@ int32_t schEnsureHbConnection(SSchJob *pJob, SSchTask *pTask) {
...
@@ -788,7 +790,10 @@ int32_t schEnsureHbConnection(SSchJob *pJob, SSchTask *pTask) {
SQueryNodeEpId
epId
=
{
0
};
SQueryNodeEpId
epId
=
{
0
};
epId
.
nodeId
=
addr
->
nodeId
;
epId
.
nodeId
=
addr
->
nodeId
;
memcpy
(
&
epId
.
ep
,
SCH_GET_CUR_EP
(
addr
),
sizeof
(
SEp
));
SEp
*
pEp
=
SCH_GET_CUR_EP
(
addr
);
strcpy
(
epId
.
ep
.
fqdn
,
pEp
->
fqdn
);
epId
.
ep
.
port
=
pEp
->
port
;
SSchHbTrans
*
hb
=
taosHashGet
(
schMgmt
.
hbConnections
,
&
epId
,
sizeof
(
SQueryNodeEpId
));
SSchHbTrans
*
hb
=
taosHashGet
(
schMgmt
.
hbConnections
,
&
epId
,
sizeof
(
SQueryNodeEpId
));
if
(
NULL
==
hb
)
{
if
(
NULL
==
hb
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录