Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2013ba0d
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看板
提交
2013ba0d
编写于
2月 23, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix asan problem
上级
04d4ee92
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
50 addition
and
32 deletion
+50
-32
source/dnode/mgmt/node_util/inc/dmUtil.h
source/dnode/mgmt/node_util/inc/dmUtil.h
+6
-6
source/dnode/mnode/impl/inc/mndInt.h
source/dnode/mnode/impl/inc/mndInt.h
+7
-7
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+2
-2
source/libs/index/src/indexFstFile.c
source/libs/index/src/indexFstFile.c
+13
-5
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+22
-12
未找到文件。
source/dnode/mgmt/node_util/inc/dmUtil.h
浏览文件 @
2013ba0d
...
...
@@ -53,12 +53,12 @@ extern "C" {
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
#define dGFatal(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); dFatal(param ", gtid:%s", __VA_ARGS__, buf);
}
#define dGError(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); dError(param ", gtid:%s", __VA_ARGS__, buf);
}
#define dGWarn(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); dWarn (param ", gtid:%s", __VA_ARGS__, buf);
}
#define dGInfo(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); dInfo (param ", gtid:%s", __VA_ARGS__, buf);
}
#define dGDebug(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); dDebug(param ", gtid:%s", __VA_ARGS__, buf);
}
#define dGTrace(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); dTrace(param ", gtid:%s", __VA_ARGS__, buf);
}
#define dGFatal(param, ...) {
if (dDebugFlag & DEBUG_FATAL) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dFatal(param ", gtid:%s", __VA_ARGS__, buf);}
}
#define dGError(param, ...) {
if (dDebugFlag & DEBUG_ERROR) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dError(param ", gtid:%s", __VA_ARGS__, buf);}
}
#define dGWarn(param, ...) {
if (dDebugFlag & DEBUG_WARN) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dWarn(param ", gtid:%s", __VA_ARGS__, buf);}
}
#define dGInfo(param, ...) {
if (dDebugFlag & DEBUG_INFO) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dInfo(param ", gtid:%s", __VA_ARGS__, buf);}
}
#define dGDebug(param, ...) {
if (dDebugFlag & DEBUG_DEBUG) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dDebug(param ", gtid:%s", __VA_ARGS__, buf);}
}
#define dGTrace(param, ...) {
if (dDebugFlag & DEBUG_DEBUG) { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dTrace(param ", gtid:%s", __VA_ARGS__, buf);}
}
// clang-format on
...
...
source/dnode/mnode/impl/inc/mndInt.h
浏览文件 @
2013ba0d
...
...
@@ -41,12 +41,12 @@ extern "C" {
#define mDebug(...) { if (mDebugFlag & DEBUG_DEBUG) { taosPrintLog("MND ", DEBUG_DEBUG, mDebugFlag, __VA_ARGS__); }}
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", DEBUG_TRACE, mDebugFlag, __VA_ARGS__); }}
#define mGFatal(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); mFatal(param ", gtid:%s", __VA_ARGS__, buf);}
#define mGError(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); mError(param ", gtid:%s", __VA_ARGS__, buf);
}
#define mGWarn(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); mWarn (param ", gtid:%s", __VA_ARGS__, buf);
}
#define mGInfo(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); mInfo (param ", gtid:%s", __VA_ARGS__, buf);
}
#define mGDebug(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); mDebug(param ", gtid:%s", __VA_ARGS__, buf);
}
#define mGTrace(param, ...) {
char buf[40] = {0}; TRACE_TO_STR(trace, buf); mTrace(param ", gtid:%s", __VA_ARGS__, buf);
}
#define mGFatal(param, ...) {
if (mDebugFlag & DEBUG_FATAL){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mFatal(param ", gtid:%s", __VA_ARGS__, buf);}}
#define mGError(param, ...) {
if (mDebugFlag & DEBUG_ERROR){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mError(param ", gtid:%s", __VA_ARGS__, buf);}
}
#define mGWarn(param, ...) {
if (mDebugFlag & DEBUG_WARN){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mWarn (param ", gtid:%s", __VA_ARGS__, buf);}
}
#define mGInfo(param, ...) {
if (mDebugFlag & DEBUG_INFO){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mInfo (param ", gtid:%s", __VA_ARGS__, buf);}
}
#define mGDebug(param, ...) {
if (mDebugFlag & DEBUG_DEBUG){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mDebug(param ", gtid:%s", __VA_ARGS__, buf);}
}
#define mGTrace(param, ...) {
if (mDebugFlag & DEBUG_TRACE){ char buf[40] = {0}; TRACE_TO_STR(trace, buf); mTrace(param ", gtid:%s", __VA_ARGS__, buf);}
}
// clang-format on
#define SYSTABLE_SCH_TABLE_NAME_LEN ((TSDB_TABLE_NAME_LEN - 1) + VARSTR_HEADER_SIZE)
...
...
@@ -80,7 +80,7 @@ typedef struct {
typedef
struct
{
TdThreadMutex
lock
;
char
email
[
TSDB_FQDN_LEN
];
char
email
[
TSDB_FQDN_LEN
];
}
STelemMgmt
;
typedef
struct
{
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
2013ba0d
...
...
@@ -1921,10 +1921,10 @@ int metaCreateTagIdxKey(tb_uid_t suid, int32_t cid, const void *pTagData, int32_
// refactor
if
(
IS_VAR_DATA_TYPE
(
type
))
{
memcpy
((
*
ppTagIdxKey
)
->
data
,
(
uint16_t
*
)
&
nTagData
,
VARSTR_HEADER_SIZE
);
memcpy
((
*
ppTagIdxKey
)
->
data
+
VARSTR_HEADER_SIZE
,
pTagData
,
nTagData
);
if
(
pTagData
!=
NULL
)
memcpy
((
*
ppTagIdxKey
)
->
data
+
VARSTR_HEADER_SIZE
,
pTagData
,
nTagData
);
*
(
tb_uid_t
*
)((
*
ppTagIdxKey
)
->
data
+
VARSTR_HEADER_SIZE
+
nTagData
)
=
uid
;
}
else
{
memcpy
((
*
ppTagIdxKey
)
->
data
,
pTagData
,
nTagData
);
if
(
pTagData
!=
NULL
)
memcpy
((
*
ppTagIdxKey
)
->
data
,
pTagData
,
nTagData
);
*
(
tb_uid_t
*
)((
*
ppTagIdxKey
)
->
data
+
nTagData
)
=
uid
;
}
...
...
source/libs/index/src/indexFstFile.c
浏览文件 @
2013ba0d
...
...
@@ -18,6 +18,7 @@
#include "indexInt.h"
#include "indexUtil.h"
#include "os.h"
#include "osDef.h"
#include "tutil.h"
static
int32_t
kBlockSize
=
4096
;
...
...
@@ -172,7 +173,8 @@ static FORCE_INLINE int idxFileCtxDoFlush(IFileCtx* ctx) {
int32_t
nw
=
taosWriteFile
(
ctx
->
file
.
pFile
,
ctx
->
file
.
wBuf
,
ctx
->
file
.
wBufOffset
);
ctx
->
file
.
wBufOffset
=
0
;
}
taosFsyncFile
(
ctx
->
file
.
pFile
);
int
ret
=
taosFsyncFile
(
ctx
->
file
.
pFile
);
UNUSED
(
ret
);
}
else
{
// do nothing
}
...
...
@@ -180,11 +182,11 @@ static FORCE_INLINE int idxFileCtxDoFlush(IFileCtx* ctx) {
}
IFileCtx
*
idxFileCtxCreate
(
WriterType
type
,
const
char
*
path
,
bool
readOnly
,
int32_t
capacity
)
{
int
code
=
0
;
IFileCtx
*
ctx
=
taosMemoryCalloc
(
1
,
sizeof
(
IFileCtx
));
if
(
ctx
==
NULL
)
{
return
NULL
;
}
ctx
->
type
=
type
;
if
(
ctx
->
type
==
TFILE
)
{
// ugly code, refactor later
...
...
@@ -192,15 +194,21 @@ IFileCtx* idxFileCtxCreate(WriterType type, const char* path, bool readOnly, int
memcpy
(
ctx
->
file
.
buf
,
path
,
strlen
(
path
));
if
(
readOnly
==
false
)
{
ctx
->
file
.
pFile
=
taosOpenFile
(
path
,
TD_FILE_CREATE
|
TD_FILE_WRITE
|
TD_FILE_APPEND
);
taosFtruncateFile
(
ctx
->
file
.
pFile
,
0
);
taosStatFile
(
path
,
&
ctx
->
file
.
size
,
NULL
);
code
=
taosFtruncateFile
(
ctx
->
file
.
pFile
,
0
);
UNUSED
(
code
);
code
=
taosStatFile
(
path
,
&
ctx
->
file
.
size
,
NULL
);
UNUSED
(
code
);
ctx
->
file
.
wBufOffset
=
0
;
ctx
->
file
.
wBufCap
=
kBlockSize
*
4
;
ctx
->
file
.
wBuf
=
taosMemoryCalloc
(
1
,
ctx
->
file
.
wBufCap
);
}
else
{
ctx
->
file
.
pFile
=
taosOpenFile
(
path
,
TD_FILE_READ
);
taosFStatFile
(
ctx
->
file
.
pFile
,
&
ctx
->
file
.
size
,
NULL
);
code
=
taosFStatFile
(
ctx
->
file
.
pFile
,
&
ctx
->
file
.
size
,
NULL
);
UNUSED
(
code
);
ctx
->
file
.
wBufOffset
=
0
;
#ifdef USE_MMAP
...
...
source/libs/transport/src/transCli.c
浏览文件 @
2013ba0d
...
...
@@ -12,7 +12,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// #include "osMemory.h"
#include "transComm.h"
#include "tutil.h"
typedef
struct
SConnList
{
queue
conns
;
...
...
@@ -224,9 +226,14 @@ static void cliWalkCb(uv_handle_t* handle, void* arg);
} while (0);
// snprintf may cause performance problem
#define CONN_CONSTRUCT_HASH_KEY(key, ip, port) \
do { \
snprintf(key, sizeof(key), "%s:%d", ip, (int)port); \
#define CONN_CONSTRUCT_HASH_KEY(key, ip, port) \
do { \
char* t = key; \
int16_t len = strlen(ip); \
memcpy(t, ip, len); \
t += len; \
t[len] = ':'; \
titoa(port, 10, &t[len + 1]); \
} while (0)
#define CONN_PERSIST_TIME(para) ((para) <= 90000 ? 90000 : (para))
...
...
@@ -330,12 +337,8 @@ bool cliMaySendCachedMsg(SCliConn* conn) {
if
(
!
transQueueEmpty
(
&
conn
->
cliMsgs
))
{
SCliMsg
*
pCliMsg
=
NULL
;
CONN_GET_NEXT_SENDMSG
(
conn
);
if
(
pCliMsg
==
NULL
)
return
false
;
else
{
cliSend
(
conn
);
return
true
;
}
cliSend
(
conn
);
return
true
;
}
return
false
;
_RETURN:
...
...
@@ -359,6 +362,7 @@ void cliHandleResp(SCliConn* conn) {
int32_t
msgLen
=
transDumpFromBuffer
(
&
conn
->
readBuf
,
(
char
**
)
&
pHead
);
if
(
msgLen
<=
0
)
{
taosMemoryFree
(
pHead
);
tDebug
(
"%s conn %p recv invalid packet "
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
return
;
}
...
...
@@ -1705,17 +1709,23 @@ void* transInitClient(uint32_t ip, uint32_t port, char* label, int numOfThreads,
for
(
int
i
=
0
;
i
<
cli
->
numOfThreads
;
i
++
)
{
SCliThrd
*
pThrd
=
createThrdObj
(
shandle
);
if
(
pThrd
==
NULL
)
{
return
NULL
;
goto
_err
;
}
int
err
=
taosThreadCreate
(
&
pThrd
->
thread
,
NULL
,
cliWorkThread
,
(
void
*
)(
pThrd
));
if
(
err
==
0
)
{
if
(
err
!=
0
)
{
goto
_err
;
}
else
{
tDebug
(
"success to create tranport-cli thread:%d"
,
i
);
}
cli
->
pThreadObj
[
i
]
=
pThrd
;
}
return
cli
;
_err:
taosMemoryFree
(
cli
->
pThreadObj
);
taosMemoryFree
(
cli
);
return
NULL
;
}
static
FORCE_INLINE
void
destroyUserdata
(
STransMsg
*
userdata
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录