Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1f2b8ae1
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看板
提交
1f2b8ae1
编写于
4月 26, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(cluster): adjust log print
上级
f7fda015
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
19 deletion
+19
-19
source/dnode/mnode/impl/src/mndSync.c
source/dnode/mnode/impl/src/mndSync.c
+2
-2
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+16
-16
source/dnode/mnode/sdb/src/sdbFile.c
source/dnode/mnode/sdb/src/sdbFile.c
+1
-1
未找到文件。
source/dnode/mnode/impl/src/mndSync.c
浏览文件 @
1f2b8ae1
...
...
@@ -160,11 +160,11 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw) {
int64_t
ver
=
sdbUpdateVer
(
pSdb
,
1
);
if
(
walWrite
(
pWal
,
ver
,
1
,
pRaw
,
sdbGetRawTotalSize
(
pRaw
))
<
0
)
{
sdbUpdateVer
(
pSdb
,
-
1
);
mError
(
"
failed to write raw:%p since %s, ver:%"
PRId64
,
pRaw
,
terrstr
(),
ver
);
mError
(
"
ver:%"
PRId64
", failed to write raw:%p to wal since %s"
,
ver
,
pRaw
,
terrstr
()
);
return
-
1
;
}
mTrace
(
"
raw:%p, write to wal, ver:%"
PRId64
,
pRaw
,
ver
);
mTrace
(
"
ver:%"
PRId64
", write to wal, raw:%p"
,
ver
,
pRaw
);
walCommit
(
pWal
,
ver
);
walFsync
(
pWal
,
true
);
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
1f2b8ae1
...
...
@@ -21,8 +21,8 @@
#include "mndTrans.h"
#include "tbase64.h"
#define
TSDB_
USER_VER_NUMBER 1
#define
TSDB_
USER_RESERVE_SIZE 64
#define USER_VER_NUMBER 1
#define USER_RESERVE_SIZE 64
static
int32_t
mndCreateDefaultUsers
(
SMnode
*
pMnode
);
static
SSdbRaw
*
mndUserActionEncode
(
SUserObj
*
pUser
);
...
...
@@ -35,7 +35,7 @@ static int32_t mndProcessCreateUserReq(SNodeMsg *pReq);
static
int32_t
mndProcessAlterUserReq
(
SNodeMsg
*
pReq
);
static
int32_t
mndProcessDropUserReq
(
SNodeMsg
*
pReq
);
static
int32_t
mndProcessGetUserAuthReq
(
SNodeMsg
*
pReq
);
static
int32_t
mndRetrieveUsers
(
SNodeMsg
*
pReq
,
SShowObj
*
pShow
,
SSDataBlock
*
pBlock
,
int32_t
rows
);
static
int32_t
mndRetrieveUsers
(
SNodeMsg
*
pReq
,
SShowObj
*
pShow
,
SSDataBlock
*
pBlock
,
int32_t
rows
);
static
void
mndCancelGetNextUser
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitUser
(
SMnode
*
pMnode
)
{
...
...
@@ -93,9 +93,9 @@ static SSdbRaw *mndUserActionEncode(SUserObj *pUser) {
int32_t
numOfReadDbs
=
taosHashGetSize
(
pUser
->
readDbs
);
int32_t
numOfWriteDbs
=
taosHashGetSize
(
pUser
->
writeDbs
);
int32_t
size
=
sizeof
(
SUserObj
)
+
TSDB_
USER_RESERVE_SIZE
+
(
numOfReadDbs
+
numOfWriteDbs
)
*
TSDB_DB_FNAME_LEN
;
int32_t
size
=
sizeof
(
SUserObj
)
+
USER_RESERVE_SIZE
+
(
numOfReadDbs
+
numOfWriteDbs
)
*
TSDB_DB_FNAME_LEN
;
SSdbRaw
*
pRaw
=
sdbAllocRaw
(
SDB_USER
,
TSDB_
USER_VER_NUMBER
,
size
);
SSdbRaw
*
pRaw
=
sdbAllocRaw
(
SDB_USER
,
USER_VER_NUMBER
,
size
);
if
(
pRaw
==
NULL
)
goto
USER_ENCODE_OVER
;
int32_t
dataPos
=
0
;
...
...
@@ -120,7 +120,7 @@ static SSdbRaw *mndUserActionEncode(SUserObj *pUser) {
db
=
taosHashIterate
(
pUser
->
writeDbs
,
db
);
}
SDB_SET_RESERVE
(
pRaw
,
dataPos
,
TSDB_
USER_RESERVE_SIZE
,
USER_ENCODE_OVER
)
SDB_SET_RESERVE
(
pRaw
,
dataPos
,
USER_RESERVE_SIZE
,
USER_ENCODE_OVER
)
SDB_SET_DATALEN
(
pRaw
,
dataPos
,
USER_ENCODE_OVER
)
terrno
=
0
;
...
...
@@ -142,7 +142,7 @@ static SSdbRow *mndUserActionDecode(SSdbRaw *pRaw) {
int8_t
sver
=
0
;
if
(
sdbGetRawSoftVer
(
pRaw
,
&
sver
)
!=
0
)
goto
USER_DECODE_OVER
;
if
(
sver
!=
TSDB_
USER_VER_NUMBER
)
{
if
(
sver
!=
USER_VER_NUMBER
)
{
terrno
=
TSDB_CODE_SDB_INVALID_DATA_VER
;
goto
USER_DECODE_OVER
;
}
...
...
@@ -184,7 +184,7 @@ static SSdbRow *mndUserActionDecode(SSdbRaw *pRaw) {
taosHashPut
(
pUser
->
writeDbs
,
db
,
len
,
db
,
TSDB_DB_FNAME_LEN
);
}
SDB_GET_RESERVE
(
pRaw
,
dataPos
,
TSDB_
USER_RESERVE_SIZE
,
USER_DECODE_OVER
)
SDB_GET_RESERVE
(
pRaw
,
dataPos
,
USER_RESERVE_SIZE
,
USER_DECODE_OVER
)
terrno
=
0
;
...
...
@@ -639,7 +639,7 @@ GET_AUTH_OVER:
return
code
;
}
static
int32_t
mndRetrieveUsers
(
SNodeMsg
*
pReq
,
SShowObj
*
pShow
,
SSDataBlock
*
pBlock
,
int32_t
rows
)
{
static
int32_t
mndRetrieveUsers
(
SNodeMsg
*
pReq
,
SShowObj
*
pShow
,
SSDataBlock
*
pBlock
,
int32_t
rows
)
{
SMnode
*
pMnode
=
pReq
->
pNode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
...
...
@@ -652,29 +652,29 @@ static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pB
if
(
pShow
->
pIter
==
NULL
)
break
;
cols
=
0
;
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
char
name
[
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
name
,
pUser
->
user
,
pShow
->
bytes
[
cols
]);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
name
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
name
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
const
char
*
src
=
pUser
->
superUser
?
"super"
:
"normal"
;
char
b
[
10
+
VARSTR_HEADER_SIZE
]
=
{
0
};
const
char
*
src
=
pUser
->
superUser
?
"super"
:
"normal"
;
char
b
[
10
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_SIZE_TO_VARSTR
(
b
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
b
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
b
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pUser
->
createdTime
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
&
pUser
->
createdTime
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
STR_WITH_MAXSIZE_TO_VARSTR
(
name
,
pUser
->
acct
,
pShow
->
bytes
[
cols
]);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
name
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
name
,
false
);
numOfRows
++
;
sdbRelease
(
pSdb
,
pUser
);
...
...
source/dnode/mnode/sdb/src/sdbFile.c
浏览文件 @
1f2b8ae1
...
...
@@ -28,7 +28,7 @@ static int32_t sdbRunDeployFp(SSdb *pSdb) {
if
(
fp
==
NULL
)
continue
;
if
((
*
fp
)(
pSdb
->
pMnode
)
!=
0
)
{
mError
(
"failed to deploy sdb:%
d since %s"
,
i
,
terrstr
());
mError
(
"failed to deploy sdb:%
s since %s"
,
sdbTableName
(
i
)
,
terrstr
());
return
-
1
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录