Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e55a76e2
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
e55a76e2
编写于
1月 18, 2023
作者:
B
Benguang Zhao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch main into FIX/TD-21218-main
上级
d6117935
78d674e9
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
156 addition
and
98 deletion
+156
-98
Jenkinsfile2
Jenkinsfile2
+1
-1
include/libs/sync/sync.h
include/libs/sync/sync.h
+1
-1
packaging/release.sh
packaging/release.sh
+1
-1
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+22
-48
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+15
-8
source/client/src/clientMain.c
source/client/src/clientMain.c
+1
-2
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+1
-5
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+8
-4
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+2
-2
source/libs/catalog/inc/catalogInt.h
source/libs/catalog/inc/catalogInt.h
+1
-0
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+7
-1
source/libs/catalog/src/ctgAsync.c
source/libs/catalog/src/ctgAsync.c
+2
-0
source/libs/catalog/src/ctgCache.c
source/libs/catalog/src/ctgCache.c
+1
-1
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+1
-1
source/libs/parser/src/parInsertStmt.c
source/libs/parser/src/parInsertStmt.c
+22
-1
source/libs/qworker/inc/qwInt.h
source/libs/qworker/inc/qwInt.h
+6
-1
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+4
-2
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+1
-1
source/libs/sync/src/syncPipeline.c
source/libs/sync/src/syncPipeline.c
+8
-3
source/libs/sync/src/syncRaftLog.c
source/libs/sync/src/syncRaftLog.c
+2
-5
source/os/src/osSysinfo.c
source/os/src/osSysinfo.c
+5
-1
source/util/src/tlog.c
source/util/src/tlog.c
+1
-0
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+1
-0
tests/parallel_test/container_build.sh
tests/parallel_test/container_build.sh
+5
-5
tests/parallel_test/run.sh
tests/parallel_test/run.sh
+4
-0
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+1
-1
tools/shell/inc/shellInt.h
tools/shell/inc/shellInt.h
+1
-0
tools/shell/src/shellEngine.c
tools/shell/src/shellEngine.c
+1
-3
tools/shell/src/shellMain.c
tools/shell/src/shellMain.c
+30
-0
未找到文件。
Jenkinsfile2
浏览文件 @
e55a76e2
...
...
@@ -430,7 +430,7 @@ pipeline {
date
rm -rf ${WKC}/debug
cd ${WKC}/tests/parallel_test
time ./container_build.sh -w ${WKDIR} -
t 10 -
e
time ./container_build.sh -w ${WKDIR} -e
'''
def extra_param = ""
def log_server_file = "/home/log_server.json"
...
...
include/libs/sync/sync.h
浏览文件 @
e55a76e2
...
...
@@ -193,7 +193,7 @@ typedef struct SSyncLogStore {
SyncIndex
(
*
syncLogLastIndex
)(
struct
SSyncLogStore
*
pLogStore
);
SyncTerm
(
*
syncLogLastTerm
)(
struct
SSyncLogStore
*
pLogStore
);
int32_t
(
*
syncLogAppendEntry
)(
struct
SSyncLogStore
*
pLogStore
,
SSyncRaftEntry
*
pEntry
);
int32_t
(
*
syncLogAppendEntry
)(
struct
SSyncLogStore
*
pLogStore
,
SSyncRaftEntry
*
pEntry
,
bool
forcSync
);
int32_t
(
*
syncLogGetEntry
)(
struct
SSyncLogStore
*
pLogStore
,
SyncIndex
index
,
SSyncRaftEntry
**
ppEntry
);
int32_t
(
*
syncLogTruncate
)(
struct
SSyncLogStore
*
pLogStore
,
SyncIndex
fromIndex
);
...
...
packaging/release.sh
浏览文件 @
e55a76e2
...
...
@@ -2,7 +2,7 @@
#
# Generate the deb package for ubuntu, or rpm package for centos, or tar.gz package for other linux os
set
-e
#
set -e
# set -x
# release.sh -v [cluster | edge]
...
...
source/client/src/clientEnv.c
浏览文件 @
e55a76e2
...
...
@@ -357,6 +357,7 @@ void doDestroyRequest(void *p) {
taosMemoryFreeClear
(
pRequest
->
pDb
);
doFreeReqResultInfo
(
&
pRequest
->
body
.
resInfo
);
tsem_destroy
(
&
pRequest
->
body
.
rspSem
);
taosArrayDestroy
(
pRequest
->
tableList
);
taosArrayDestroy
(
pRequest
->
dbList
);
...
...
@@ -371,6 +372,9 @@ void doDestroyRequest(void *p) {
}
if
(
pRequest
->
syncQuery
)
{
if
(
pRequest
->
body
.
param
){
tsem_destroy
(
&
((
SSyncQueryParam
*
)
pRequest
->
body
.
param
)
->
sem
);
}
taosMemoryFree
(
pRequest
->
body
.
param
);
}
...
...
@@ -388,45 +392,6 @@ void destroyRequest(SRequestObj *pRequest) {
removeRequest
(
pRequest
->
self
);
}
void
taosClientCrash
(
int
signum
,
void
*
sigInfo
,
void
*
context
)
{
taosIgnSignal
(
SIGTERM
);
taosIgnSignal
(
SIGHUP
);
taosIgnSignal
(
SIGINT
);
taosIgnSignal
(
SIGBREAK
);
#if !defined(WINDOWS)
taosIgnSignal
(
SIGBUS
);
#endif
taosIgnSignal
(
SIGABRT
);
taosIgnSignal
(
SIGFPE
);
taosIgnSignal
(
SIGSEGV
);
char
*
pMsg
=
NULL
;
const
char
*
flags
=
"UTL FATAL "
;
ELogLevel
level
=
DEBUG_FATAL
;
int32_t
dflag
=
255
;
int64_t
msgLen
=
-
1
;
if
(
tsEnableCrashReport
)
{
if
(
taosGenCrashJsonMsg
(
signum
,
&
pMsg
,
lastClusterId
,
appInfo
.
startTime
))
{
taosPrintLog
(
flags
,
level
,
dflag
,
"failed to generate crash json msg"
);
goto
_return
;
}
else
{
msgLen
=
strlen
(
pMsg
);
}
}
_return:
taosLogCrashInfo
(
"taos"
,
pMsg
,
msgLen
,
signum
,
sigInfo
);
#ifdef _TD_DARWIN_64
exit
(
signum
);
#elif defined(WINDOWS)
exit
(
signum
);
#endif
}
void
crashReportThreadFuncUnexpectedStopped
(
void
)
{
atomic_store_32
(
&
clientStop
,
-
1
);
}
static
void
*
tscCrashReportThreadFp
(
void
*
param
)
{
...
...
@@ -523,15 +488,26 @@ void tscStopCrashReport() {
}
}
static
void
tscSetSignalHandle
()
{
#if !defined(WINDOWS)
taosSetSignal
(
SIGBUS
,
taosClientCrash
);
#endif
taosSetSignal
(
SIGABRT
,
taosClientCrash
);
taosSetSignal
(
SIGFPE
,
taosClientCrash
);
taosSetSignal
(
SIGSEGV
,
taosClientCrash
);
void
tscWriteCrashInfo
(
int
signum
,
void
*
sigInfo
,
void
*
context
)
{
char
*
pMsg
=
NULL
;
const
char
*
flags
=
"UTL FATAL "
;
ELogLevel
level
=
DEBUG_FATAL
;
int32_t
dflag
=
255
;
int64_t
msgLen
=
-
1
;
if
(
tsEnableCrashReport
)
{
if
(
taosGenCrashJsonMsg
(
signum
,
&
pMsg
,
lastClusterId
,
appInfo
.
startTime
))
{
taosPrintLog
(
flags
,
level
,
dflag
,
"failed to generate crash json msg"
);
}
else
{
msgLen
=
strlen
(
pMsg
);
}
}
taosLogCrashInfo
(
"taos"
,
pMsg
,
msgLen
,
signum
,
sigInfo
);
}
void
taos_init_imp
(
void
)
{
// In the APIs of other program language, taos_cleanup is not available yet.
// So, to make sure taos_cleanup will be invoked to clean up the allocated resource to suppress the valgrind warning.
...
...
@@ -555,8 +531,6 @@ void taos_init_imp(void) {
return
;
}
tscSetSignalHandle
();
initQueryModuleMsgHandle
();
if
(
taosConvInit
()
!=
0
)
{
...
...
source/client/src/clientImpl.c
浏览文件 @
e55a76e2
...
...
@@ -159,6 +159,12 @@ STscObj* taos_connect_internal(const char* ip, const char* user, const char* pas
return
taosConnectImpl
(
user
,
&
secretEncrypt
[
0
],
localDb
,
NULL
,
NULL
,
*
pInst
,
connType
);
}
void
freeQueryParam
(
SSyncQueryParam
*
param
)
{
if
(
param
==
NULL
)
return
;
tsem_destroy
(
&
param
->
sem
);
taosMemoryFree
(
param
);
}
int32_t
buildRequest
(
uint64_t
connId
,
const
char
*
sql
,
int
sqlLen
,
void
*
param
,
bool
validateSql
,
SRequestObj
**
pRequest
,
int64_t
reqid
)
{
*
pRequest
=
createRequest
(
connId
,
TSDB_SQL_SELECT
,
reqid
);
...
...
@@ -180,17 +186,18 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param,
(
*
pRequest
)
->
sqlLen
=
sqlLen
;
(
*
pRequest
)
->
validateOnly
=
validateSql
;
SSyncQueryParam
*
newpParam
;
if
(
param
==
NULL
)
{
SSyncQueryParam
*
pParam
=
taosMemoryCalloc
(
1
,
sizeof
(
SSyncQueryParam
));
if
(
pParam
==
NULL
)
{
new
pParam
=
taosMemoryCalloc
(
1
,
sizeof
(
SSyncQueryParam
));
if
(
new
pParam
==
NULL
)
{
destroyRequest
(
*
pRequest
);
*
pRequest
=
NULL
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
tsem_init
(
&
pParam
->
sem
,
0
,
0
);
pParam
->
pRequest
=
(
*
pRequest
);
param
=
pParam
;
tsem_init
(
&
new
pParam
->
sem
,
0
,
0
);
new
pParam
->
pRequest
=
(
*
pRequest
);
param
=
new
pParam
;
}
(
*
pRequest
)
->
body
.
param
=
param
;
...
...
@@ -201,8 +208,7 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param,
if
(
err
)
{
tscError
(
"%"
PRId64
" failed to add to request container, reqId:0x%"
PRIx64
", conn:%"
PRId64
", %s"
,
(
*
pRequest
)
->
self
,
(
*
pRequest
)
->
requestId
,
pTscObj
->
id
,
sql
);
taosMemoryFree
(
param
);
freeQueryParam
(
newpParam
);
destroyRequest
(
*
pRequest
);
*
pRequest
=
NULL
;
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -214,6 +220,7 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param,
nodesCreateAllocator
((
*
pRequest
)
->
requestId
,
tsQueryNodeChunkSize
,
&
((
*
pRequest
)
->
allocatorRefId
)))
{
tscError
(
"%"
PRId64
" failed to create node allocator, reqId:0x%"
PRIx64
", conn:%"
PRId64
", %s"
,
(
*
pRequest
)
->
self
,
(
*
pRequest
)
->
requestId
,
pTscObj
->
id
,
sql
);
freeQueryParam
(
newpParam
);
destroyRequest
(
*
pRequest
);
*
pRequest
=
NULL
;
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
@@ -1253,7 +1260,7 @@ STscObj* taosConnectImpl(const char* user, const char* auth, const char* db, __t
int64_t
transporterId
=
0
;
asyncSendMsgToServer
(
pTscObj
->
pAppInfo
->
pTransporter
,
&
pTscObj
->
pAppInfo
->
mgmtEp
.
epSet
,
&
transporterId
,
body
);
tsem_wait
(
&
pRequest
->
body
.
rspSem
);
if
(
pRequest
->
code
!=
TSDB_CODE_SUCCESS
)
{
const
char
*
errorMsg
=
...
...
source/client/src/clientMain.c
浏览文件 @
e55a76e2
...
...
@@ -509,9 +509,8 @@ void taos_stop_query(TAOS_RES *res) {
SRequestObj
*
pRequest
=
(
SRequestObj
*
)
res
;
pRequest
->
killed
=
true
;
int32_t
numOfFields
=
taos_num_fields
(
pRequest
);
// It is not a query, no need to stop.
if
(
numOfFields
==
0
)
{
if
(
NULL
==
pRequest
->
pQuery
||
QUERY_EXEC_MODE_SCHEDULE
!=
pRequest
->
pQuery
->
execMode
)
{
tscDebug
(
"request 0x%"
PRIx64
" no need to be killed since not query"
,
pRequest
->
requestId
);
return
;
}
...
...
source/client/src/clientStmt.c
浏览文件 @
e55a76e2
...
...
@@ -300,11 +300,7 @@ int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool deepClean) {
continue
;
}
if
(
STMT_TYPE_MULTI_INSERT
==
pStmt
->
sql
.
type
)
{
qFreeStmtDataBlock
(
pBlocks
);
}
else
{
qDestroyStmtDataBlock
(
pBlocks
);
}
qDestroyStmtDataBlock
(
pBlocks
);
taosHashRemove
(
pStmt
->
exec
.
pBlockHash
,
key
,
keyLen
);
pIter
=
taosHashIterate
(
pStmt
->
exec
.
pBlockHash
,
pIter
);
...
...
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
浏览文件 @
e55a76e2
...
...
@@ -164,7 +164,7 @@ void* tsdbCacherowsReaderClose(void* pReader) {
destroyLastBlockLoadInfo
(
p
->
pLoadInfo
);
taosMemoryFree
((
void
*
)
p
->
idstr
);
taosMemoryFree
((
void
*
)
p
->
idstr
);
taosMemoryFree
(
pReader
);
return
NULL
;
}
...
...
@@ -241,7 +241,11 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
taosArrayPush
(
pLastCols
,
&
p
);
}
tsdbTakeReadSnap
(
pr
->
pVnode
->
pTsdb
,
&
pr
->
pReadSnap
,
"cache-l"
);
code
=
tsdbTakeReadSnap
(
pr
->
pVnode
->
pTsdb
,
&
pr
->
pReadSnap
,
"cache-l"
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_end
;
}
pr
->
pDataFReader
=
NULL
;
pr
->
pDataFReaderLast
=
NULL
;
...
...
@@ -252,7 +256,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
code
=
doExtractCacheRow
(
pr
,
lruCache
,
pKeyInfo
->
uid
,
&
pRow
,
&
h
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
goto
_end
;
}
if
(
h
==
NULL
)
{
...
...
@@ -321,7 +325,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
STableKeyInfo
*
pKeyInfo
=
&
pr
->
pTableList
[
i
];
code
=
doExtractCacheRow
(
pr
,
lruCache
,
pKeyInfo
->
uid
,
&
pRow
,
&
h
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
goto
_end
;
}
if
(
h
==
NULL
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
e55a76e2
...
...
@@ -3884,7 +3884,7 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL
if
(
pReader
->
type
==
TIMEWINDOW_RANGE_CONTAINED
)
{
code
=
doOpenReaderImpl
(
pReader
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
goto
_err
;
}
}
else
{
STsdbReader
*
pPrevReader
=
pReader
->
innerReader
[
0
];
...
...
@@ -3905,7 +3905,7 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL
code
=
doOpenReaderImpl
(
pPrevReader
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
goto
_err
;
}
}
}
...
...
source/libs/catalog/inc/catalogInt.h
浏览文件 @
e55a76e2
...
...
@@ -805,6 +805,7 @@ int32_t ctgMakeVgArray(SDBVgInfo* dbInfo);
int32_t
ctgAcquireVgMetaFromCache
(
SCatalog
*
pCtg
,
const
char
*
dbFName
,
const
char
*
tbName
,
SCtgDBCache
**
pDb
,
SCtgTbCache
**
pTb
);
int32_t
ctgCopyTbMeta
(
SCatalog
*
pCtg
,
SCtgTbMetaCtx
*
ctx
,
SCtgDBCache
**
pDb
,
SCtgTbCache
**
pTb
,
STableMeta
**
pTableMeta
,
char
*
dbFName
);
void
ctgReleaseVgMetaToCache
(
SCatalog
*
pCtg
,
SCtgDBCache
*
dbCache
,
SCtgTbCache
*
pCache
);
void
ctgReleaseTbMetaToCache
(
SCatalog
*
pCtg
,
SCtgDBCache
*
dbCache
,
SCtgTbCache
*
pCache
);
extern
SCatalogMgmt
gCtgMgmt
;
extern
SCtgDebug
gCTGDebug
;
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
e55a76e2
...
...
@@ -598,10 +598,16 @@ int32_t ctgGetCachedTbVgMeta(SCatalog* pCtg, const SName* pTableName, SVgroupInf
CTG_ERR_JRET
(
ctgGetVgInfoFromHashValue
(
pCtg
,
dbCache
->
vgCache
.
vgInfo
,
pTableName
,
pVgroup
));
ctgRUnlockVgInfo
(
dbCache
);
SCtgTbMetaCtx
ctx
=
{
0
};
ctx
.
pName
=
(
SName
*
)
pTableName
;
ctx
.
flag
=
CTG_FLAG_UNKNOWN_STB
;
CTG_ERR_JRET
(
ctgCopyTbMeta
(
pCtg
,
&
ctx
,
&
dbCache
,
&
tbCache
,
pTableMeta
,
db
));
code
=
ctgCopyTbMeta
(
pCtg
,
&
ctx
,
&
dbCache
,
&
tbCache
,
pTableMeta
,
db
);
ctgReleaseTbMetaToCache
(
pCtg
,
dbCache
,
tbCache
);
CTG_RET
(
code
);
_return:
...
...
source/libs/catalog/src/ctgAsync.c
浏览文件 @
e55a76e2
...
...
@@ -999,6 +999,7 @@ int32_t ctgHandleGetTbMetaRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBuf
CTG_ERR_JRET
(
ctgGetTbMetaFromVnode
(
pCtg
,
pConn
,
pName
,
&
vgInfo
,
NULL
,
tReq
));
ctgReleaseVgInfoToCache
(
pCtg
,
dbCache
);
dbCache
=
NULL
;
}
else
{
SBuildUseDBInput
input
=
{
0
};
...
...
@@ -1168,6 +1169,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
CTG_ERR_JRET
(
ctgGetTbMetaFromVnode
(
pCtg
,
pConn
,
pName
,
&
vgInfo
,
NULL
,
tReq
));
ctgReleaseVgInfoToCache
(
pCtg
,
dbCache
);
dbCache
=
NULL
;
}
else
{
SBuildUseDBInput
input
=
{
0
};
...
...
source/libs/catalog/src/ctgCache.c
浏览文件 @
e55a76e2
...
...
@@ -2118,7 +2118,7 @@ int32_t ctgOpUpdateEpset(SCtgCacheOperation *operation) {
_return:
if
(
dbCache
)
{
if
(
code
==
TSDB_CODE_SUCCESS
&&
dbCache
)
{
ctgWUnlockVgInfo
(
dbCache
);
}
...
...
source/libs/executor/src/executil.c
浏览文件 @
e55a76e2
...
...
@@ -954,7 +954,7 @@ static int32_t optimizeTbnameInCondImpl(void* metaHandle, int64_t suid, SArray*
return
-
1
;
}
}
else
{
qWarn
(
"failed to get tableIds from by table name: %s, reason: %s"
,
name
,
tstrerror
(
terrno
));
//
qWarn("failed to get tableIds from by table name: %s, reason: %s", name, tstrerror(terrno));
terrno
=
0
;
}
}
...
...
source/libs/parser/src/parInsertStmt.c
浏览文件 @
e55a76e2
...
...
@@ -425,6 +425,27 @@ int32_t qCloneStmtDataBlock(void** pDst, void* pSrc) {
pBlock
->
pTableMeta
=
pNewMeta
;
}
if
(
pBlock
->
boundColumnInfo
.
boundColumns
)
{
int32_t
size
=
pBlock
->
boundColumnInfo
.
numOfCols
*
sizeof
(
col_id_t
);
void
*
tmp
=
taosMemoryMalloc
(
size
);
memcpy
(
tmp
,
pBlock
->
boundColumnInfo
.
boundColumns
,
size
);
pBlock
->
boundColumnInfo
.
boundColumns
=
tmp
;
}
if
(
pBlock
->
boundColumnInfo
.
cols
)
{
int32_t
size
=
pBlock
->
boundColumnInfo
.
numOfCols
*
sizeof
(
SBoundColumn
);
void
*
tmp
=
taosMemoryMalloc
(
size
);
memcpy
(
tmp
,
pBlock
->
boundColumnInfo
.
cols
,
size
);
pBlock
->
boundColumnInfo
.
cols
=
tmp
;
}
if
(
pBlock
->
boundColumnInfo
.
colIdxInfo
)
{
int32_t
size
=
pBlock
->
boundColumnInfo
.
numOfBound
*
sizeof
(
SBoundIdxInfo
);
void
*
tmp
=
taosMemoryMalloc
(
size
);
memcpy
(
tmp
,
pBlock
->
boundColumnInfo
.
colIdxInfo
,
size
);
pBlock
->
boundColumnInfo
.
colIdxInfo
=
tmp
;
}
return
qResetStmtDataBlock
(
*
pDst
,
false
);
}
...
...
@@ -437,7 +458,7 @@ int32_t qRebuildStmtDataBlock(void** pDst, void* pSrc, uint64_t uid, int32_t vgI
STableDataBlocks
*
pBlock
=
(
STableDataBlocks
*
)
*
pDst
;
pBlock
->
pData
=
taosMemoryMalloc
(
pBlock
->
nAllocSize
);
if
(
NULL
==
pBlock
->
pData
)
{
q
Free
StmtDataBlock
(
pBlock
);
q
Destroy
StmtDataBlock
(
pBlock
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
source/libs/qworker/inc/qwInt.h
浏览文件 @
e55a76e2
...
...
@@ -228,9 +228,14 @@ typedef struct SQWorkerMgmt {
case QW_PHASE_POST_FETCH: \
ctx->inFetch = 0; \
break; \
default: \
case QW_PHASE_PRE_QUERY: \
case QW_PHASE_POST_QUERY: \
case QW_PHASE_PRE_CQUERY: \
case QW_PHASE_POST_CQUERY: \
atomic_store_8(&(ctx)->phase, _value); \
break; \
default: \
break; \
} \
} while (0)
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
e55a76e2
...
...
@@ -551,7 +551,9 @@ _return:
if
(
ctx
)
{
QW_UPDATE_RSP_CODE
(
ctx
,
code
);
QW_SET_PHASE
(
ctx
,
phase
);
if
(
QW_PHASE_POST_CQUERY
!=
phase
)
{
QW_SET_PHASE
(
ctx
,
phase
);
}
QW_UNLOCK
(
QW_WRITE
,
&
ctx
->
lock
);
qwReleaseTaskCtx
(
mgmt
,
ctx
);
...
...
@@ -758,7 +760,7 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
QW_LOCK
(
QW_WRITE
,
&
ctx
->
lock
);
if
(
qComplete
||
(
queryStop
&&
(
0
==
atomic_load_8
((
int8_t
*
)
&
ctx
->
queryContinue
)))
||
code
)
{
// Note: query is not running anymore
QW_SET_PHASE
(
ctx
,
0
);
QW_SET_PHASE
(
ctx
,
QW_PHASE_POST_CQUERY
);
QW_UNLOCK
(
QW_WRITE
,
&
ctx
->
lock
);
break
;
}
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
e55a76e2
...
...
@@ -2387,7 +2387,7 @@ static int32_t syncNodeAppendNoopOld(SSyncNode* ths) {
LRUHandle
*
h
=
NULL
;
if
(
ths
->
state
==
TAOS_SYNC_STATE_LEADER
)
{
int32_t
code
=
ths
->
pLogStore
->
syncLogAppendEntry
(
ths
->
pLogStore
,
pEntry
);
int32_t
code
=
ths
->
pLogStore
->
syncLogAppendEntry
(
ths
->
pLogStore
,
pEntry
,
false
);
if
(
code
!=
0
)
{
sError
(
"append noop error"
);
return
-
1
;
...
...
source/libs/sync/src/syncPipeline.c
浏览文件 @
e55a76e2
...
...
@@ -364,7 +364,11 @@ _out:
return
ret
;
}
int32_t
syncLogStorePersist
(
SSyncLogStore
*
pLogStore
,
SSyncRaftEntry
*
pEntry
)
{
static
inline
bool
syncLogStoreNeedFlush
(
SSyncRaftEntry
*
pEntry
,
int32_t
replicaNum
)
{
return
(
replicaNum
>
1
)
&&
(
pEntry
->
originalRpcType
==
TDMT_VND_COMMIT
);
}
int32_t
syncLogStorePersist
(
SSyncLogStore
*
pLogStore
,
SSyncNode
*
pNode
,
SSyncRaftEntry
*
pEntry
)
{
ASSERT
(
pEntry
->
index
>=
0
);
SyncIndex
lastVer
=
pLogStore
->
syncLogLastIndex
(
pLogStore
);
if
(
lastVer
>=
pEntry
->
index
&&
pLogStore
->
syncLogTruncate
(
pLogStore
,
pEntry
->
index
)
<
0
)
{
...
...
@@ -374,7 +378,8 @@ int32_t syncLogStorePersist(SSyncLogStore* pLogStore, SSyncRaftEntry* pEntry) {
lastVer
=
pLogStore
->
syncLogLastIndex
(
pLogStore
);
ASSERT
(
pEntry
->
index
==
lastVer
+
1
);
if
(
pLogStore
->
syncLogAppendEntry
(
pLogStore
,
pEntry
)
<
0
)
{
bool
doFsync
=
syncLogStoreNeedFlush
(
pEntry
,
pNode
->
replicaNum
);
if
(
pLogStore
->
syncLogAppendEntry
(
pLogStore
,
pEntry
,
doFsync
)
<
0
)
{
sError
(
"failed to append sync log entry since %s. index:%"
PRId64
", term:%"
PRId64
""
,
terrstr
(),
pEntry
->
index
,
pEntry
->
term
);
return
-
1
;
...
...
@@ -436,7 +441,7 @@ int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* p
(
void
)
syncNodeReplicateWithoutLock
(
pNode
);
// persist
if
(
syncLogStorePersist
(
pLogStore
,
pEntry
)
<
0
)
{
if
(
syncLogStorePersist
(
pLogStore
,
p
Node
,
p
Entry
)
<
0
)
{
sError
(
"vgId:%d, failed to persist sync log entry from buffer since %s. index:%"
PRId64
,
pNode
->
vgId
,
terrstr
(),
pEntry
->
index
);
goto
_out
;
...
...
source/libs/sync/src/syncRaftLog.c
浏览文件 @
e55a76e2
...
...
@@ -23,7 +23,7 @@
// public function
static
int32_t
raftLogRestoreFromSnapshot
(
struct
SSyncLogStore
*
pLogStore
,
SyncIndex
snapshotIndex
);
static
int32_t
raftLogAppendEntry
(
struct
SSyncLogStore
*
pLogStore
,
SSyncRaftEntry
*
pEntry
);
static
int32_t
raftLogAppendEntry
(
struct
SSyncLogStore
*
pLogStore
,
SSyncRaftEntry
*
pEntry
,
bool
forceSync
);
static
int32_t
raftLogTruncate
(
struct
SSyncLogStore
*
pLogStore
,
SyncIndex
fromIndex
);
static
bool
raftLogExist
(
struct
SSyncLogStore
*
pLogStore
,
SyncIndex
index
);
static
int32_t
raftLogUpdateCommitIndex
(
SSyncLogStore
*
pLogStore
,
SyncIndex
index
);
...
...
@@ -192,9 +192,7 @@ SyncTerm raftLogLastTerm(struct SSyncLogStore* pLogStore) {
return
SYNC_TERM_INVALID
;
}
static
inline
bool
raftLogForceSync
(
SSyncRaftEntry
*
pEntry
)
{
return
(
pEntry
->
originalRpcType
==
TDMT_VND_COMMIT
);
}
static
int32_t
raftLogAppendEntry
(
struct
SSyncLogStore
*
pLogStore
,
SSyncRaftEntry
*
pEntry
)
{
static
int32_t
raftLogAppendEntry
(
struct
SSyncLogStore
*
pLogStore
,
SSyncRaftEntry
*
pEntry
,
bool
forceSync
)
{
SSyncLogStoreData
*
pData
=
pLogStore
->
data
;
SWal
*
pWal
=
pData
->
pWal
;
...
...
@@ -221,7 +219,6 @@ static int32_t raftLogAppendEntry(struct SSyncLogStore* pLogStore, SSyncRaftEntr
ASSERT
(
pEntry
->
index
==
index
);
bool
forceSync
=
raftLogForceSync
(
pEntry
);
walFsync
(
pWal
,
forceSync
);
sNTrace
(
pData
->
pSyncNode
,
"write index:%"
PRId64
", type:%s, origin type:%s, elapsed:%"
PRId64
,
pEntry
->
index
,
...
...
source/os/src/osSysinfo.c
浏览文件 @
e55a76e2
...
...
@@ -834,7 +834,11 @@ int32_t taosGetSystemUUID(char *uid, int32_t uidlen) {
uuid_generate
(
uuid
);
// it's caller's responsibility to make enough space for `uid`, that's 36-char + 1-null
uuid_unparse_lower
(
uuid
,
buf
);
memcpy
(
uid
,
buf
,
uidlen
);
int
n
=
snprintf
(
uid
,
uidlen
,
"%.*s"
,
(
int
)
sizeof
(
buf
),
buf
);
// though less performance, much safer
if
(
n
>=
uidlen
)
{
// target buffer is too small
return
-
1
;
}
return
0
;
#else
int
len
=
0
;
...
...
source/util/src/tlog.c
浏览文件 @
e55a76e2
...
...
@@ -897,6 +897,7 @@ void taosLogCrashInfo(char* nodeType, char* pMsg, int64_t msgLen, int signum, vo
pFile
=
taosOpenFile
(
filepath
,
TD_FILE_CREATE
|
TD_FILE_WRITE
|
TD_FILE_APPEND
);
if
(
pFile
==
NULL
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
taosPrintLog
(
flags
,
level
,
dflag
,
"failed to open file:%s since %s"
,
filepath
,
terrstr
());
goto
_return
;
}
...
...
tests/parallel_test/cases.task
浏览文件 @
e55a76e2
...
...
@@ -145,6 +145,7 @@
,,y,script,./test.sh -f tsim/parser/precision_ns.sim
,,y,script,./test.sh -f tsim/parser/projection_limit_offset.sim
,,y,script,./test.sh -f tsim/parser/regex.sim
,,y,script,./test.sh -f tsim/parser/regressiontest.sim
,,y,script,./test.sh -f tsim/parser/select_across_vnodes.sim
,,y,script,./test.sh -f tsim/parser/select_distinct_tag.sim
,,y,script,./test.sh -f tsim/parser/select_from_cache_disk.sim
...
...
tests/parallel_test/container_build.sh
浏览文件 @
e55a76e2
...
...
@@ -37,9 +37,9 @@ if [ -z "$WORKDIR" ]; then
usage
exit
1
fi
if
[
-z
"
$THREAD_COUNT
"
]
;
then
THREAD_COUNT
=
1
fi
#
if [ -z "$THREAD_COUNT" ]; then
#
THREAD_COUNT=1
#
fi
ulimit
-c
unlimited
...
...
@@ -55,7 +55,7 @@ fi
date
docker run
\
-v
$REP_MOUNT_PARAM
\
--rm
--ulimit
core
=
-1
taos_test:v1.0 sh
-c
"cd
$REP_DIR
;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true;make -j
$THREAD_COUNT
|| exit 1"
--rm
--ulimit
core
=
-1
taos_test:v1.0 sh
-c
"cd
$REP_DIR
;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true;make -j || exit 1"
if
[[
-d
${
WORKDIR
}
/debugNoSan
]]
;
then
echo
"delete
${
WORKDIR
}
/debugNoSan"
...
...
@@ -70,7 +70,7 @@ mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugNoSan
date
docker run
\
-v
$REP_MOUNT_PARAM
\
--rm
--ulimit
core
=
-1
taos_test:v1.0 sh
-c
"cd
$REP_DIR
;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DTOOLS_BUILD_TYPE=Debug;make -j
$THREAD_COUNT
|| exit 1 "
--rm
--ulimit
core
=
-1
taos_test:v1.0 sh
-c
"cd
$REP_DIR
;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DTOOLS_BUILD_TYPE=Debug;make -j || exit 1 "
mv
${
REP_REAL_PATH
}
/debug
${
WORKDIR
}
/debugSan
...
...
tests/parallel_test/run.sh
浏览文件 @
e55a76e2
...
...
@@ -184,6 +184,10 @@ function run_thread() {
if
[
$?
-eq
0
]
;
then
case_file
=
`
echo
"
$case_cmd
"
|grep
-o
".*
\.
py"
|awk
'{print $NF}'
`
fi
echo
"
$case_cmd
"
|grep
-q
"^./pytest.sh"
if
[
$?
-eq
0
]
;
then
case_file
=
`
echo
"
$case_cmd
"
|grep
-o
".*
\.
py"
|awk
'{print $NF}'
`
fi
echo
"
$case_cmd
"
|grep
-q
"
\.
sim"
if
[
$?
-eq
0
]
;
then
case_file
=
`
echo
"
$case_cmd
"
|grep
-o
".*
\.
sim"
|awk
'{print $NF}'
`
...
...
tests/script/api/batchprepare.c
浏览文件 @
e55a76e2
...
...
@@ -2828,7 +2828,7 @@ void runAll(TAOS *taos) {
printf
(
"%s Begin
\n
"
,
gCaseCtrl
.
caseCatalog
);
runCaseList
(
taos
);
#if
0
#if
1
strcpy
(
gCaseCtrl
.
caseCatalog
,
"Micro DB precision Test"
);
printf
(
"%s Begin
\n
"
,
gCaseCtrl
.
caseCatalog
);
gCaseCtrl
.
precision
=
TIME_PRECISION_MICRO
;
...
...
tools/shell/inc/shellInt.h
浏览文件 @
e55a76e2
...
...
@@ -147,5 +147,6 @@ void shellRunSingleCommandWebsocketImp(char *command);
// shellMain.c
extern
SShellObj
shell
;
extern
void
tscWriteCrashInfo
(
int
signum
,
void
*
sigInfo
,
void
*
context
);
#endif
/*_TD_SHELL_INT_H_*/
tools/shell/src/shellEngine.c
浏览文件 @
e55a76e2
...
...
@@ -1136,10 +1136,8 @@ int32_t shellExecute() {
taosSetSignal
(
SIGTERM
,
shellQueryInterruptHandler
);
taosSetSignal
(
SIGHUP
,
shellQueryInterruptHandler
);
taosSetSignal
(
SIGABRT
,
shellQueryInterruptHandler
);
taosSetSignal
(
SIGINT
,
shellQueryInterruptHandler
);
#ifdef WEBSOCKET
if
(
!
shell
.
args
.
restful
&&
!
shell
.
args
.
cloud
)
{
#endif
...
...
tools/shell/src/shellMain.c
浏览文件 @
e55a76e2
...
...
@@ -19,6 +19,29 @@
SShellObj
shell
=
{
0
};
void
shellCrashHandler
(
int
signum
,
void
*
sigInfo
,
void
*
context
)
{
taosIgnSignal
(
SIGTERM
);
taosIgnSignal
(
SIGHUP
);
taosIgnSignal
(
SIGINT
);
taosIgnSignal
(
SIGBREAK
);
#if !defined(WINDOWS)
taosIgnSignal
(
SIGBUS
);
#endif
taosIgnSignal
(
SIGABRT
);
taosIgnSignal
(
SIGFPE
);
taosIgnSignal
(
SIGSEGV
);
tscWriteCrashInfo
(
signum
,
sigInfo
,
context
);
#ifdef _TD_DARWIN_64
exit
(
signum
);
#elif defined(WINDOWS)
exit
(
signum
);
#endif
}
int
main
(
int
argc
,
char
*
argv
[])
{
shell
.
exit
=
false
;
#ifdef WEBSOCKET
...
...
@@ -26,6 +49,13 @@ int main(int argc, char *argv[]) {
shell
.
args
.
cloud
=
true
;
#endif
#if !defined(WINDOWS)
taosSetSignal
(
SIGBUS
,
shellCrashHandler
);
#endif
taosSetSignal
(
SIGABRT
,
shellCrashHandler
);
taosSetSignal
(
SIGFPE
,
shellCrashHandler
);
taosSetSignal
(
SIGSEGV
,
shellCrashHandler
);
if
(
shellCheckIntSize
()
!=
0
)
{
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录