Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
04f78531
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看板
提交
04f78531
编写于
12月 07, 2022
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into feature/TD-19148-D
上级
237c3fe4
71b1269d
变更
19
显示空白变更内容
内联
并排
Showing
19 changed file
with
72 addition
and
30 deletion
+72
-30
README-CN.md
README-CN.md
+3
-3
README.md
README.md
+3
-3
cmake/taostools_CMakeLists.txt.in
cmake/taostools_CMakeLists.txt.in
+1
-1
include/common/tmsg.h
include/common/tmsg.h
+5
-0
include/libs/nodes/nodes.h
include/libs/nodes/nodes.h
+2
-2
source/client/src/clientMain.c
source/client/src/clientMain.c
+2
-1
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+1
-0
source/dnode/mnode/impl/src/mndSync.c
source/dnode/mnode/impl/src/mndSync.c
+7
-1
source/dnode/vnode/src/meta/metaCache.c
source/dnode/vnode/src/meta/metaCache.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+6
-1
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+4
-0
source/libs/catalog/inc/catalogInt.h
source/libs/catalog/inc/catalogInt.h
+8
-0
source/libs/catalog/src/ctgAsync.c
source/libs/catalog/src/ctgAsync.c
+12
-8
source/libs/executor/src/timesliceoperator.c
source/libs/executor/src/timesliceoperator.c
+2
-0
source/libs/parser/src/parInsertSql.c
source/libs/parser/src/parInsertSql.c
+12
-0
source/libs/sync/inc/syncUtil.h
source/libs/sync/inc/syncUtil.h
+0
-1
source/libs/sync/src/syncPipeline.c
source/libs/sync/src/syncPipeline.c
+1
-6
source/libs/sync/src/syncUtil.c
source/libs/sync/src/syncUtil.c
+0
-2
source/libs/transport/src/transSvr.c
source/libs/transport/src/transSvr.c
+2
-0
未找到文件。
README-CN.md
浏览文件 @
04f78531
...
...
@@ -60,7 +60,7 @@ sudo apt-get install -y gcc cmake build-essential git libssl-dev
为了在 Ubuntu/Debian 系统上编译
[
taos-tools
](
https://github.com/taosdata/taos-tools
)
需要安装如下软件:
```
bash
sudo
apt
install
build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev pkg-config
sudo
apt
install
build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev
zlib1g
pkg-config
```
### CentOS 7.9
...
...
@@ -85,7 +85,7 @@ sudo dnf install -y gcc gcc-c++ make cmake epel-release git openssl-devel
```
sudo yum install -y zlib-devel
xz-devel snappy-devel jansson jansson-devel pkgconfig libatom
ic libstdc++-static openssl-devel
sudo yum install -y zlib-devel
zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-stat
ic libstdc++-static openssl-devel
```
#### CentOS 8/Rocky Linux
...
...
@@ -94,7 +94,7 @@ sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgco
sudo yum install -y epel-release
sudo yum install -y dnf-plugins-core
sudo yum config-manager --set-enabled powertools
sudo yum install -y zlib-devel
xz-devel snappy-devel jansson jansson-devel pkgconfig libatom
ic libstdc++-static openssl-devel
sudo yum install -y zlib-devel
zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-stat
ic libstdc++-static openssl-devel
```
注意:由于 snappy 缺乏 pkg-config 支持(参考
[
链接
](
https://github.com/google/snappy/pull/86
)
),会导致 cmake 提示无法发现 libsnappy,实际上工作正常。
...
...
README.md
浏览文件 @
04f78531
...
...
@@ -62,7 +62,7 @@ sudo apt-get install -y gcc cmake build-essential git libssl-dev
To build the
[
taosTools
](
https://github.com/taosdata/taos-tools
)
on Ubuntu/Debian, the following packages need to be installed.
```
bash
sudo
apt
install
build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev pkg-config
sudo
apt
install
build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev
zlib1g
pkg-config
```
### CentOS 7.9
...
...
@@ -85,7 +85,7 @@ sudo dnf install -y gcc gcc-c++ make cmake epel-release git openssl-devel
#### CentOS 7.9
```
sudo yum install -y zlib-devel
xz-devel snappy-devel jansson jansson-devel pkgconfig libatom
ic libstdc++-static openssl-devel
sudo yum install -y zlib-devel
zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-stat
ic libstdc++-static openssl-devel
```
#### CentOS 8/Rocky Linux
...
...
@@ -94,7 +94,7 @@ sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgco
sudo yum install -y epel-release
sudo yum install -y dnf-plugins-core
sudo yum config-manager --set-enabled powertools
sudo yum install -y zlib-devel
xz-devel snappy-devel jansson jansson-devel pkgconfig libatom
ic libstdc++-static openssl-devel
sudo yum install -y zlib-devel
zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-stat
ic libstdc++-static openssl-devel
```
Note: Since snappy lacks pkg-config support (refer to
[
link
](
https://github.com/google/snappy/pull/86
)
), it leads a cmake prompt libsnappy not found. But snappy still works well.
...
...
cmake/taostools_CMakeLists.txt.in
浏览文件 @
04f78531
...
...
@@ -2,7 +2,7 @@
# taos-tools
ExternalProject_Add(taos-tools
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
GIT_TAG
e62c5ea
GIT_TAG
ac69142
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
...
...
include/common/tmsg.h
浏览文件 @
04f78531
...
...
@@ -70,6 +70,11 @@ static inline bool vnodeIsMsgBlock(tmsg_t type) {
return
(
type
==
TDMT_VND_CREATE_TABLE
)
||
(
type
==
TDMT_VND_ALTER_TABLE
)
||
(
type
==
TDMT_VND_DROP_TABLE
)
||
(
type
==
TDMT_VND_UPDATE_TAG_VAL
);
}
static
inline
bool
syncUtilUserCommit
(
tmsg_t
msgType
)
{
return
msgType
!=
TDMT_SYNC_NOOP
&&
msgType
!=
TDMT_SYNC_LEADER_TRANSFER
;
}
/* ------------------------ OTHER DEFINITIONS ------------------------ */
// IE type
#define TSDB_IE_TYPE_SEC 1
...
...
include/libs/nodes/nodes.h
浏览文件 @
04f78531
...
...
@@ -234,7 +234,6 @@ typedef enum ENodeType {
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN
,
QUERY_NODE_PHYSICAL_PLAN_PROJECT
,
QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN
,
QUERY_NODE_PHYSICAL_PLAN_HASH_AGG
,
...
...
@@ -265,7 +264,8 @@ typedef enum ENodeType {
QUERY_NODE_PHYSICAL_PLAN_QUERY_INSERT
,
QUERY_NODE_PHYSICAL_PLAN_DELETE
,
QUERY_NODE_PHYSICAL_SUBPLAN
,
QUERY_NODE_PHYSICAL_PLAN
QUERY_NODE_PHYSICAL_PLAN
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN
}
ENodeType
;
/**
...
...
source/client/src/clientMain.c
浏览文件 @
04f78531
...
...
@@ -796,9 +796,10 @@ static void doAsyncQueryFromParse(SMetaData *pResultMeta, void *param, int32_t c
SQuery
*
pQuery
=
pRequest
->
pQuery
;
pRequest
->
metric
.
ctgEnd
=
taosGetTimestampUs
();
qDebug
(
"0x%"
PRIx64
" start to continue parse, reqId:0x%"
PRIx64
,
pRequest
->
self
,
pRequest
->
requestId
);
qDebug
(
"0x%"
PRIx64
" start to continue parse, reqId:0x%"
PRIx64
", code:%s"
,
pRequest
->
self
,
pRequest
->
requestId
,
tstrerror
(
code
)
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
pWrapper
->
pCatalogReq
->
forceUpdate
=
false
;
code
=
qContinueParseSql
(
pWrapper
->
pParseCtx
,
pWrapper
->
pCatalogReq
,
pResultMeta
,
pQuery
);
}
...
...
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
04f78531
...
...
@@ -301,6 +301,7 @@ int32_t dmInitServer(SDnode *pDnode) {
rpcInit
.
connType
=
TAOS_CONN_SERVER
;
rpcInit
.
idleTime
=
tsShellActivityTimer
*
1000
;
rpcInit
.
parent
=
pDnode
;
rpcInit
.
compressSize
=
tsCompressMsgSize
;
pTrans
->
serverRpc
=
rpcOpen
(
&
rpcInit
);
if
(
pTrans
->
serverRpc
==
NULL
)
{
...
...
source/dnode/mnode/impl/src/mndSync.c
浏览文件 @
04f78531
...
...
@@ -119,7 +119,13 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta
}
int32_t
mndSyncCommitMsg
(
const
SSyncFSM
*
pFsm
,
SRpcMsg
*
pMsg
,
const
SFsmCbMeta
*
pMeta
)
{
int32_t
code
=
mndProcessWriteMsg
(
pFsm
,
pMsg
,
pMeta
);
int32_t
code
=
0
;
if
(
!
syncUtilUserCommit
(
pMsg
->
msgType
))
{
goto
_out
;
}
code
=
mndProcessWriteMsg
(
pFsm
,
pMsg
,
pMeta
);
_out:
rpcFreeCont
(
pMsg
->
pCont
);
pMsg
->
pCont
=
NULL
;
return
code
;
...
...
source/dnode/vnode/src/meta/metaCache.c
浏览文件 @
04f78531
...
...
@@ -454,7 +454,7 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK
SListNode
*
pNode
=
NULL
;
while
((
pNode
=
tdListNext
(
&
iter
))
!=
NULL
)
{
memcpy
(
pBuf
+
sizeof
(
suid
)
,
pNode
->
data
,
keyLen
);
memcpy
(
&
pBuf
[
1
]
,
pNode
->
data
,
keyLen
);
// check whether it is existed in LRU cache, and remove it from linked list if not.
LRUHandle
*
pRes
=
taosLRUCacheLookup
(
pCache
,
pBuf
,
len
);
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
04f78531
...
...
@@ -53,6 +53,7 @@ typedef struct {
// --------------
TSKEY
nextKey
;
// reset by each table commit
int32_t
commitFid
;
int32_t
expLevel
;
TSKEY
minKey
;
TSKEY
maxKey
;
// commit file data
...
...
@@ -503,6 +504,7 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) {
// memory
pCommitter
->
commitFid
=
tsdbKeyFid
(
pCommitter
->
nextKey
,
pCommitter
->
minutes
,
pCommitter
->
precision
);
pCommitter
->
expLevel
=
tsdbFidLevel
(
pCommitter
->
commitFid
,
&
pCommitter
->
pTsdb
->
keepCfg
,
taosGetTimestampSec
());
tsdbFidKeyRange
(
pCommitter
->
commitFid
,
pCommitter
->
minutes
,
pCommitter
->
precision
,
&
pCommitter
->
minKey
,
&
pCommitter
->
maxKey
);
#if 0
...
...
@@ -556,7 +558,10 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) {
}
}
else
{
SDiskID
did
=
{
0
};
tfsAllocDisk
(
pTsdb
->
pVnode
->
pTfs
,
0
,
&
did
);
if
(
tfsAllocDisk
(
pTsdb
->
pVnode
->
pTfs
,
pCommitter
->
expLevel
,
&
did
)
<
0
)
{
code
=
terrno
;
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
tfsMkdirRecurAt
(
pTsdb
->
pVnode
->
pTfs
,
pTsdb
->
path
,
did
);
wSet
.
diskId
=
did
;
wSet
.
nSttF
=
1
;
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
04f78531
...
...
@@ -190,9 +190,13 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp
version
);
ASSERT
(
pVnode
->
state
.
applyTerm
<=
pMsg
->
info
.
conn
.
applyTerm
);
ASSERT
(
pVnode
->
state
.
applied
+
1
==
version
);
pVnode
->
state
.
applied
=
version
;
pVnode
->
state
.
applyTerm
=
pMsg
->
info
.
conn
.
applyTerm
;
if
(
!
syncUtilUserCommit
(
pMsg
->
msgType
))
goto
_exit
;
// skip header
pReq
=
POINTER_SHIFT
(
pMsg
->
pCont
,
sizeof
(
SMsgHead
));
len
=
pMsg
->
contLen
-
sizeof
(
SMsgHead
);
...
...
source/libs/catalog/inc/catalogInt.h
浏览文件 @
04f78531
...
...
@@ -547,6 +547,14 @@ typedef struct SCtgOperation {
#define ctgDebug(param, ...) qDebug("CTG:%p " param, pCtg, __VA_ARGS__)
#define ctgTrace(param, ...) qTrace("CTG:%p " param, pCtg, __VA_ARGS__)
#define ctgTaskFatal(param, ...) qFatal("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
#define ctgTaskError(param, ...) qError("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
#define ctgTaskWarn(param, ...) qWarn("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
#define ctgTaskInfo(param, ...) qInfo("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
#define ctgTaskDebug(param, ...) qDebug("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
#define ctgTaskTrace(param, ...) qTrace("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__)
#define CTG_LOCK_DEBUG(...) \
do { \
if (gCTGDebug.lockEnable) { \
...
...
source/libs/catalog/src/ctgAsync.c
浏览文件 @
04f78531
...
...
@@ -1094,6 +1094,9 @@ _return:
ctgReleaseVgInfoToCache
(
pCtg
,
dbCache
);
}
if
(
code
)
{
ctgTaskError
(
"Get table %d.%s.%s meta failed with error %s"
,
pName
->
acctId
,
pName
->
dbname
,
pName
->
tname
,
tstrerror
(
code
));
}
if
(
pTask
->
res
||
code
)
{
ctgHandleTaskEnd
(
pTask
,
code
);
}
...
...
@@ -1124,7 +1127,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
SVgroupInfo
vgInfo
=
{
0
};
CTG_ERR_JRET
(
ctgGetVgInfoFromHashValue
(
pCtg
,
pOut
->
dbVgroup
,
pName
,
&
vgInfo
));
ctgDebug
(
"will refresh tbmeta, not supposed to be stb, tbName:%s, flag:%d"
,
tNameGetTableName
(
pName
),
flag
);
ctg
Task
Debug
(
"will refresh tbmeta, not supposed to be stb, tbName:%s, flag:%d"
,
tNameGetTableName
(
pName
),
flag
);
*
vgId
=
vgInfo
.
vgId
;
CTG_ERR_JRET
(
ctgGetTbMetaFromVnode
(
pCtg
,
pConn
,
pName
,
&
vgInfo
,
NULL
,
tReq
));
...
...
@@ -1144,7 +1147,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
SVgroupInfo
vgInfo
=
{
0
};
CTG_ERR_JRET
(
ctgGetVgInfoFromHashValue
(
pCtg
,
dbCache
->
vgCache
.
vgInfo
,
pName
,
&
vgInfo
));
ctgDebug
(
"will refresh tbmeta, supposed to be stb, tbName:%s, flag:%d"
,
tNameGetTableName
(
pName
),
flag
);
ctg
Task
Debug
(
"will refresh tbmeta, supposed to be stb, tbName:%s, flag:%d"
,
tNameGetTableName
(
pName
),
flag
);
*
vgId
=
vgInfo
.
vgId
;
CTG_ERR_JRET
(
ctgGetTbMetaFromVnode
(
pCtg
,
pConn
,
pName
,
&
vgInfo
,
NULL
,
tReq
));
...
...
@@ -1162,7 +1165,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
return
TSDB_CODE_SUCCESS
;
}
ctgError
(
"no tbmeta got, tbName:%s"
,
tNameGetTableName
(
pName
));
ctg
Task
Error
(
"no tbmeta got, tbName:%s"
,
tNameGetTableName
(
pName
));
ctgRemoveTbMetaFromCache
(
pCtg
,
pName
,
false
);
CTG_ERR_JRET
(
CTG_ERR_CODE_TABLE_NOT_EXIST
);
...
...
@@ -1180,7 +1183,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
STableMetaOutput
*
pOut
=
(
STableMetaOutput
*
)
pMsgCtx
->
out
;
if
(
CTG_IS_META_NULL
(
pOut
->
metaType
))
{
ctgError
(
"no tbmeta got, tbNmae:%s"
,
tNameGetTableName
(
pName
));
ctg
Task
Error
(
"no tbmeta got, tbNmae:%s"
,
tNameGetTableName
(
pName
));
ctgRemoveTbMetaFromCache
(
pCtg
,
pName
,
false
);
CTG_ERR_JRET
(
CTG_ERR_CODE_TABLE_NOT_EXIST
);
}
...
...
@@ -1190,7 +1193,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
}
if
(
CTG_IS_META_TABLE
(
pOut
->
metaType
)
&&
TSDB_SUPER_TABLE
==
pOut
->
tbMeta
->
tableType
)
{
ctgDebug
(
"will continue to refresh tbmeta since got stb, tbName:%s"
,
tNameGetTableName
(
pName
));
ctg
Task
Debug
(
"will continue to refresh tbmeta since got stb, tbName:%s"
,
tNameGetTableName
(
pName
));
taosMemoryFreeClear
(
pOut
->
tbMeta
);
...
...
@@ -1207,11 +1210,11 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
STableMeta
*
stbMeta
=
NULL
;
(
void
)
ctgReadTbMetaFromCache
(
pCtg
,
&
stbCtx
,
&
stbMeta
);
if
(
stbMeta
&&
stbMeta
->
sversion
>=
pOut
->
tbMeta
->
sversion
)
{
ctgDebug
(
"use cached stb meta, tbName:%s"
,
tNameGetTableName
(
pName
));
ctg
Task
Debug
(
"use cached stb meta, tbName:%s"
,
tNameGetTableName
(
pName
));
exist
=
1
;
taosMemoryFreeClear
(
stbMeta
);
}
else
{
ctgDebug
(
"need to get/update stb meta, tbName:%s"
,
tNameGetTableName
(
pName
));
ctg
Task
Debug
(
"need to get/update stb meta, tbName:%s"
,
tNameGetTableName
(
pName
));
taosMemoryFreeClear
(
pOut
->
tbMeta
);
taosMemoryFreeClear
(
stbMeta
);
}
...
...
@@ -1225,7 +1228,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
break
;
}
default:
ctgError
(
"invalid reqType %d"
,
reqType
);
ctg
Task
Error
(
"invalid reqType %d"
,
reqType
);
CTG_ERR_JRET
(
TSDB_CODE_INVALID_MSG
);
}
...
...
@@ -1280,6 +1283,7 @@ _return:
TSWAP
(
pTask
->
res
,
ctx
->
pResList
);
taskDone
=
true
;
}
ctgTaskError
(
"Get table %d.%s.%s meta failed with error %s"
,
pName
->
acctId
,
pName
->
dbname
,
pName
->
tname
,
tstrerror
(
code
));
}
if
(
pTask
->
res
&&
taskDone
)
{
...
...
source/libs/executor/src/timesliceoperator.c
浏览文件 @
04f78531
...
...
@@ -95,6 +95,8 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo
// TODO: optimize to ignore null values for linear interpolation.
if
(
!
pLinearInfo
->
isStartSet
)
{
if
(
!
colDataIsNull_s
(
pColInfoData
,
rowIndex
))
{
ASSERT
(
IS_MATHABLE_TYPE
(
pColInfoData
->
info
.
type
));
pLinearInfo
->
start
.
key
=
*
(
int64_t
*
)
colDataGetData
(
pTsCol
,
rowIndex
);
memcpy
(
pLinearInfo
->
start
.
val
,
colDataGetData
(
pColInfoData
,
rowIndex
),
pLinearInfo
->
bytes
);
}
...
...
source/libs/parser/src/parInsertSql.c
浏览文件 @
04f78531
...
...
@@ -44,6 +44,7 @@ typedef struct SInsertParseContext {
SParsedDataColInfo
tags
;
// for stmt
bool
missCache
;
bool
usingDuplicateTable
;
bool
forceUpdate
;
}
SInsertParseContext
;
typedef
int32_t
(
*
_row_append_fn_t
)(
SMsgBuf
*
pMsgBuf
,
const
void
*
value
,
int32_t
len
,
void
*
param
);
...
...
@@ -829,6 +830,11 @@ static int32_t getTableVgroup(SParseContext* pCxt, SVnodeModifOpStmt* pStmt, boo
}
static
int32_t
getTargetTableSchema
(
SInsertParseContext
*
pCxt
,
SVnodeModifOpStmt
*
pStmt
)
{
if
(
pCxt
->
forceUpdate
)
{
pCxt
->
missCache
=
true
;
return
TSDB_CODE_SUCCESS
;
}
int32_t
code
=
checkAuth
(
pCxt
->
pComCxt
,
&
pStmt
->
targetTableName
,
&
pCxt
->
missCache
);
if
(
TSDB_CODE_SUCCESS
==
code
&&
!
pCxt
->
missCache
)
{
code
=
getTableMeta
(
pCxt
,
&
pStmt
->
targetTableName
,
false
,
&
pStmt
->
pTableMeta
,
&
pCxt
->
missCache
);
...
...
@@ -844,6 +850,11 @@ static int32_t preParseUsingTableName(SInsertParseContext* pCxt, SVnodeModifOpSt
}
static
int32_t
getUsingTableSchema
(
SInsertParseContext
*
pCxt
,
SVnodeModifOpStmt
*
pStmt
)
{
if
(
pCxt
->
forceUpdate
)
{
pCxt
->
missCache
=
true
;
return
TSDB_CODE_SUCCESS
;
}
int32_t
code
=
checkAuth
(
pCxt
->
pComCxt
,
&
pStmt
->
targetTableName
,
&
pCxt
->
missCache
);
if
(
TSDB_CODE_SUCCESS
==
code
&&
!
pCxt
->
missCache
)
{
code
=
getTableMeta
(
pCxt
,
&
pStmt
->
usingTableName
,
true
,
&
pStmt
->
pTableMeta
,
&
pCxt
->
missCache
);
...
...
@@ -1909,6 +1920,7 @@ int32_t parseInsertSql(SParseContext* pCxt, SQuery** pQuery, SCatalogReq* pCatal
.
msg
=
{.
buf
=
pCxt
->
pMsg
,
.
len
=
pCxt
->
msgLen
},
.
missCache
=
false
,
.
usingDuplicateTable
=
false
,
.
forceUpdate
=
(
NULL
!=
pCatalogReq
?
pCatalogReq
->
forceUpdate
:
false
)
};
int32_t
code
=
initInsertQuery
(
&
context
,
pCatalogReq
,
pMetaData
,
pQuery
);
...
...
source/libs/sync/inc/syncUtil.h
浏览文件 @
04f78531
...
...
@@ -79,7 +79,6 @@ char* syncUtilPrintBin2(char* ptr, uint32_t len);
void
syncUtilMsgHtoN
(
void
*
msg
);
void
syncUtilMsgNtoH
(
void
*
msg
);
bool
syncUtilUserPreCommit
(
tmsg_t
msgType
);
bool
syncUtilUserCommit
(
tmsg_t
msgType
);
bool
syncUtilUserRollback
(
tmsg_t
msgType
);
void
syncPrintNodeLog
(
const
char
*
flags
,
ELogLevel
level
,
int32_t
dflag
,
SSyncNode
*
pNode
,
const
char
*
format
,
...);
...
...
source/libs/sync/src/syncPipeline.c
浏览文件 @
04f78531
...
...
@@ -513,13 +513,8 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm
if
(
!
syncUtilUserCommit
(
pEntry
->
originalRpcType
))
{
sInfo
(
"vgId:%d, commit sync barrier. index: %"
PRId64
", term:%"
PRId64
", type: %s"
,
vgId
,
pEntry
->
index
,
pEntry
->
term
,
TMSG_INFO
(
pEntry
->
originalRpcType
));
pBuf
->
commitIndex
=
index
;
if
(
!
inBuf
)
{
syncEntryDestroy
(
pEntry
);
pEntry
=
NULL
;
}
continue
;
}
if
(
syncLogFsmExecute
(
pNode
,
pFsm
,
role
,
term
,
pEntry
)
!=
0
)
{
sError
(
"vgId:%d, failed to execute sync log entry. index:%"
PRId64
", term:%"
PRId64
", role: %d, current term: %"
PRId64
,
...
...
source/libs/sync/src/syncUtil.c
浏览文件 @
04f78531
...
...
@@ -160,8 +160,6 @@ void syncUtilMsgNtoH(void* msg) {
bool
syncUtilUserPreCommit
(
tmsg_t
msgType
)
{
return
msgType
!=
TDMT_SYNC_NOOP
&&
msgType
!=
TDMT_SYNC_LEADER_TRANSFER
;
}
bool
syncUtilUserCommit
(
tmsg_t
msgType
)
{
return
msgType
!=
TDMT_SYNC_NOOP
&&
msgType
!=
TDMT_SYNC_LEADER_TRANSFER
;
}
bool
syncUtilUserRollback
(
tmsg_t
msgType
)
{
return
msgType
!=
TDMT_SYNC_NOOP
&&
msgType
!=
TDMT_SYNC_LEADER_TRANSFER
;
}
void
syncCfg2SimpleStr
(
const
SSyncCfg
*
pCfg
,
char
*
buf
,
int32_t
bufLen
)
{
...
...
source/libs/transport/src/transSvr.c
浏览文件 @
04f78531
...
...
@@ -1195,6 +1195,8 @@ void transCloseServer(void* arg) {
sendQuitToWorkThrd
(
srv
->
pThreadObj
[
i
]);
destroyWorkThrd
(
srv
->
pThreadObj
[
i
]);
}
}
else
{
uv_loop_close
(
srv
->
loop
);
}
taosMemoryFree
(
srv
->
pThreadObj
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录