Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
04d97168
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看板
提交
04d97168
编写于
8月 23, 2023
作者:
D
dmchen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more audit
上级
1aef2746
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
5 deletion
+23
-5
include/common/tmsg.h
include/common/tmsg.h
+10
-0
include/libs/audit/audit.h
include/libs/audit/audit.h
+1
-1
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+8
-0
source/libs/audit/src/auditMain.c
source/libs/audit/src/auditMain.c
+4
-4
未找到文件。
include/common/tmsg.h
浏览文件 @
04d97168
...
@@ -1306,6 +1306,8 @@ void tFreeSUserAuthBatchRsp(SUserAuthBatchRsp* pRsp);
...
@@ -1306,6 +1306,8 @@ void tFreeSUserAuthBatchRsp(SUserAuthBatchRsp* pRsp);
typedef
struct
{
typedef
struct
{
char
db
[
TSDB_DB_FNAME_LEN
];
char
db
[
TSDB_DB_FNAME_LEN
];
STimeWindow
timeRange
;
STimeWindow
timeRange
;
int32_t
sqlLen
;
char
*
sql
;
}
SCompactDbReq
;
}
SCompactDbReq
;
int32_t
tSerializeSCompactDbReq
(
void
*
buf
,
int32_t
bufLen
,
SCompactDbReq
*
pReq
);
int32_t
tSerializeSCompactDbReq
(
void
*
buf
,
int32_t
bufLen
,
SCompactDbReq
*
pReq
);
...
@@ -1898,6 +1900,8 @@ enum {
...
@@ -1898,6 +1900,8 @@ enum {
typedef
struct
{
typedef
struct
{
int32_t
dnodeId
;
int32_t
dnodeId
;
int8_t
restoreType
;
int8_t
restoreType
;
int32_t
sqlLen
;
char
*
sql
;
}
SRestoreDnodeReq
;
}
SRestoreDnodeReq
;
int32_t
tSerializeSRestoreDnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SRestoreDnodeReq
*
pReq
);
int32_t
tSerializeSRestoreDnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SRestoreDnodeReq
*
pReq
);
...
@@ -1966,6 +1970,8 @@ int32_t tDeserializeSKillTransReq(void* buf, int32_t bufLen, SKillTransReq* pReq
...
@@ -1966,6 +1970,8 @@ int32_t tDeserializeSKillTransReq(void* buf, int32_t bufLen, SKillTransReq* pReq
typedef
struct
{
typedef
struct
{
int32_t
useless
;
// useless
int32_t
useless
;
// useless
int32_t
sqlLen
;
char
*
sql
;
}
SBalanceVgroupReq
;
}
SBalanceVgroupReq
;
int32_t
tSerializeSBalanceVgroupReq
(
void
*
buf
,
int32_t
bufLen
,
SBalanceVgroupReq
*
pReq
);
int32_t
tSerializeSBalanceVgroupReq
(
void
*
buf
,
int32_t
bufLen
,
SBalanceVgroupReq
*
pReq
);
...
@@ -1984,6 +1990,8 @@ typedef struct {
...
@@ -1984,6 +1990,8 @@ typedef struct {
int32_t
dnodeId1
;
int32_t
dnodeId1
;
int32_t
dnodeId2
;
int32_t
dnodeId2
;
int32_t
dnodeId3
;
int32_t
dnodeId3
;
int32_t
sqlLen
;
char
*
sql
;
}
SRedistributeVgroupReq
;
}
SRedistributeVgroupReq
;
int32_t
tSerializeSRedistributeVgroupReq
(
void
*
buf
,
int32_t
bufLen
,
SRedistributeVgroupReq
*
pReq
);
int32_t
tSerializeSRedistributeVgroupReq
(
void
*
buf
,
int32_t
bufLen
,
SRedistributeVgroupReq
*
pReq
);
...
@@ -1991,6 +1999,8 @@ int32_t tDeserializeSRedistributeVgroupReq(void* buf, int32_t bufLen, SRedistrib
...
@@ -1991,6 +1999,8 @@ int32_t tDeserializeSRedistributeVgroupReq(void* buf, int32_t bufLen, SRedistrib
typedef
struct
{
typedef
struct
{
int32_t
useless
;
int32_t
useless
;
int32_t
sqlLen
;
char
*
sql
;
}
SBalanceVgroupLeaderReq
;
}
SBalanceVgroupLeaderReq
;
int32_t
tSerializeSBalanceVgroupLeaderReq
(
void
*
buf
,
int32_t
bufLen
,
SBalanceVgroupLeaderReq
*
pReq
);
int32_t
tSerializeSBalanceVgroupLeaderReq
(
void
*
buf
,
int32_t
bufLen
,
SBalanceVgroupLeaderReq
*
pReq
);
...
...
include/libs/audit/audit.h
浏览文件 @
04d97168
...
@@ -36,7 +36,7 @@ typedef struct {
...
@@ -36,7 +36,7 @@ typedef struct {
int32_t
auditInit
(
const
SAuditCfg
*
pCfg
);
int32_t
auditInit
(
const
SAuditCfg
*
pCfg
);
void
auditSend
(
SJson
*
pJson
);
void
auditSend
(
SJson
*
pJson
);
void
auditRecord
(
SRpcMsg
*
pReq
,
char
*
oper
,
char
*
db
,
char
*
stable
,
int32_t
detailL
en
,
char
*
detail
);
void
auditRecord
(
SRpcMsg
*
pReq
,
char
*
oper
ation
,
char
*
target1
,
char
*
target2
,
int32_t
l
en
,
char
*
detail
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
04d97168
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "mndTrans.h"
#include "mndTrans.h"
#include "mndUser.h"
#include "mndUser.h"
#include "tmisce.h"
#include "tmisce.h"
#include "audit.h"
#define VGROUP_VER_NUMBER 1
#define VGROUP_VER_NUMBER 1
#define VGROUP_RESERVE_SIZE 64
#define VGROUP_RESERVE_SIZE 64
...
@@ -2171,6 +2172,11 @@ static int32_t mndProcessRedistributeVgroupMsg(SRpcMsg *pReq) {
...
@@ -2171,6 +2172,11 @@ static int32_t mndProcessRedistributeVgroupMsg(SRpcMsg *pReq) {
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
code
==
0
)
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
char
obj
[
33
]
=
{
0
};
sprintf
(
obj
,
"%d"
,
req
.
vgId
);
auditRecord
(
pReq
,
"RedistributeVgroup"
,
obj
,
""
,
req
.
sqlLen
,
req
.
sql
);
_OVER:
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"vgId:%d, failed to redistribute to dnode %d:%d:%d since %s"
,
req
.
vgId
,
req
.
dnodeId1
,
req
.
dnodeId2
,
mError
(
"vgId:%d, failed to redistribute to dnode %d:%d:%d since %s"
,
req
.
vgId
,
req
.
dnodeId1
,
req
.
dnodeId2
,
...
@@ -2981,6 +2987,8 @@ static int32_t mndProcessBalanceVgroupMsg(SRpcMsg *pReq) {
...
@@ -2981,6 +2987,8 @@ static int32_t mndProcessBalanceVgroupMsg(SRpcMsg *pReq) {
code
=
mndBalanceVgroup
(
pMnode
,
pReq
,
pArray
);
code
=
mndBalanceVgroup
(
pMnode
,
pReq
,
pArray
);
}
}
auditRecord
(
pReq
,
"BalanceVgroup"
,
""
,
""
,
req
.
sqlLen
,
req
.
sql
);
_OVER:
_OVER:
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
)
{
mError
(
"failed to balance vgroup since %s"
,
terrstr
());
mError
(
"failed to balance vgroup since %s"
,
terrstr
());
...
...
source/libs/audit/src/auditMain.c
浏览文件 @
04d97168
...
@@ -29,14 +29,14 @@ int32_t auditInit(const SAuditCfg *pCfg) {
...
@@ -29,14 +29,14 @@ int32_t auditInit(const SAuditCfg *pCfg) {
return
0
;
return
0
;
}
}
extern
void
auditRecordImp
(
SRpcMsg
*
pReq
,
char
*
oper
,
char
*
db
,
char
*
stable
,
int32_t
detailL
en
,
char
*
detail
);
extern
void
auditRecordImp
(
SRpcMsg
*
pReq
,
char
*
oper
ation
,
char
*
target1
,
char
*
target2
,
int32_t
l
en
,
char
*
detail
);
void
auditRecord
(
SRpcMsg
*
pReq
,
char
*
oper
,
char
*
db
,
char
*
stable
,
int32_t
detailL
en
,
char
*
detail
)
{
void
auditRecord
(
SRpcMsg
*
pReq
,
char
*
oper
ation
,
char
*
target1
,
char
*
target2
,
int32_t
l
en
,
char
*
detail
)
{
auditRecordImp
(
pReq
,
oper
,
db
,
stable
,
detailL
en
,
detail
);
auditRecordImp
(
pReq
,
oper
ation
,
target1
,
target2
,
l
en
,
detail
);
}
}
#ifndef TD_ENTERPRISE
#ifndef TD_ENTERPRISE
void
auditRecordImp
(
SRpcMsg
*
pReq
,
char
*
oper
,
char
*
db
,
char
*
stable
,
int32_t
detailL
en
,
char
*
detail
)
{
void
auditRecordImp
(
SRpcMsg
*
pReq
,
char
*
oper
ation
,
char
*
target1
,
char
*
target2
,
int32_t
l
en
,
char
*
detail
)
{
}
}
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录