Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
289cfb93
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
289cfb93
编写于
4月 26, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
4月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11890 from taosdata/feature/dnode
fix: allow startup if the log directory does not exist
上级
cdbfe53c
8379c33a
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
44 addition
and
62 deletion
+44
-62
include/dnode/mnode/sdb/sdb.h
include/dnode/mnode/sdb/sdb.h
+1
-1
include/util/taoserror.h
include/util/taoserror.h
+3
-10
source/dnode/mnode/impl/src/mndAcct.c
source/dnode/mnode/impl/src/mndAcct.c
+10
-10
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+1
-1
source/dnode/mnode/impl/src/mndSync.c
source/dnode/mnode/impl/src/mndSync.c
+1
-1
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+1
-1
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+1
-1
source/dnode/mnode/impl/test/acct/acct.cpp
source/dnode/mnode/impl/test/acct/acct.cpp
+3
-3
source/dnode/mnode/sdb/src/sdbFile.c
source/dnode/mnode/sdb/src/sdbFile.c
+2
-2
source/dnode/mnode/sdb/src/sdbHash.c
source/dnode/mnode/sdb/src/sdbHash.c
+18
-16
source/dnode/mnode/sdb/src/sdbRaw.c
source/dnode/mnode/sdb/src/sdbRaw.c
+1
-1
source/dnode/mnode/sdb/src/sdbRow.c
source/dnode/mnode/sdb/src/sdbRow.c
+1
-1
source/util/src/tconfig.c
source/util/src/tconfig.c
+0
-6
source/util/src/terror.c
source/util/src/terror.c
+1
-8
未找到文件。
include/dnode/mnode/sdb/sdb.h
浏览文件 @
289cfb93
...
...
@@ -221,7 +221,7 @@ int32_t sdbWrite(SSdb *pSdb, SSdbRaw *pRaw);
* @param pRaw The raw data.
* @return int32_t 0 for success, -1 for failure.
*/
int32_t
sdbWrite
No
tFree
(
SSdb
*
pSdb
,
SSdbRaw
*
pRaw
);
int32_t
sdbWrite
Withou
tFree
(
SSdb
*
pSdb
,
SSdbRaw
*
pRaw
);
/**
* @brief Acquire a row from sdb
...
...
include/util/taoserror.h
浏览文件 @
289cfb93
...
...
@@ -139,16 +139,9 @@ int32_t* taosGetErrno();
// mnode-common
#define TSDB_CODE_MND_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x0300)
#define TSDB_CODE_MND_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x0301)
#define TSDB_CODE_MND_MSG_NOT_PROCESSED TAOS_DEF_ERROR_CODE(0, 0x0302)
#define TSDB_CODE_MND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0303)
#define TSDB_CODE_MND_ACTION_NEED_REPROCESSED TAOS_DEF_ERROR_CODE(0, 0x0304)
#define TSDB_CODE_MND_NO_RIGHTS TAOS_DEF_ERROR_CODE(0, 0x0305)
#define TSDB_CODE_MND_INVALID_OPTIONS TAOS_DEF_ERROR_CODE(0, 0x0306)
#define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0307)
#define TSDB_CODE_MND_INVALID_MSG_VERSION TAOS_DEF_ERROR_CODE(0, 0x0308)
#define TSDB_CODE_MND_INVALID_MSG_LEN TAOS_DEF_ERROR_CODE(0, 0x0309)
#define TSDB_CODE_MND_INVALID_MSG_TYPE TAOS_DEF_ERROR_CODE(0, 0x030A)
#define TSDB_CODE_MND_TOO_MANY_SHELL_CONNS TAOS_DEF_ERROR_CODE(0, 0x030B)
#define TSDB_CODE_MND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0302)
#define TSDB_CODE_MND_NO_RIGHTS TAOS_DEF_ERROR_CODE(0, 0x0303)
#define TSDB_CODE_MND_INVALID_CONNECTION TAOS_DEF_ERROR_CODE(0, 0x0304)
// mnode-show
#define TSDB_CODE_MND_INVALID_SHOWOBJ TAOS_DEF_ERROR_CODE(0, 0x0310)
...
...
source/dnode/mnode/impl/src/mndAcct.c
浏览文件 @
289cfb93
...
...
@@ -17,8 +17,8 @@
#include "mndAcct.h"
#include "mndShow.h"
#define
TSDB_
ACCT_VER_NUMBER 1
#define
TSDB_
ACCT_RESERVE_SIZE 128
#define ACCT_VER_NUMBER 1
#define ACCT_RESERVE_SIZE 128
static
int32_t
mndCreateDefaultAcct
(
SMnode
*
pMnode
);
static
SSdbRaw
*
mndAcctActionEncode
(
SAcctObj
*
pAcct
);
...
...
@@ -55,6 +55,7 @@ static int32_t mndCreateDefaultAcct(SMnode *pMnode) {
acctObj
.
createdTime
=
taosGetTimestampMs
();
acctObj
.
updateTime
=
acctObj
.
createdTime
;
acctObj
.
acctId
=
1
;
acctObj
.
status
=
0
;
acctObj
.
cfg
=
(
SAcctCfg
){.
maxUsers
=
INT32_MAX
,
.
maxDbs
=
INT32_MAX
,
.
maxStbs
=
INT32_MAX
,
...
...
@@ -79,7 +80,7 @@ static int32_t mndCreateDefaultAcct(SMnode *pMnode) {
static
SSdbRaw
*
mndAcctActionEncode
(
SAcctObj
*
pAcct
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
SSdbRaw
*
pRaw
=
sdbAllocRaw
(
SDB_ACCT
,
TSDB_ACCT_VER_NUMBER
,
sizeof
(
SAcctObj
)
+
TSDB_
ACCT_RESERVE_SIZE
);
SSdbRaw
*
pRaw
=
sdbAllocRaw
(
SDB_ACCT
,
ACCT_VER_NUMBER
,
sizeof
(
SAcctObj
)
+
ACCT_RESERVE_SIZE
);
if
(
pRaw
==
NULL
)
goto
_OVER
;
int32_t
dataPos
=
0
;
...
...
@@ -100,7 +101,7 @@ static SSdbRaw *mndAcctActionEncode(SAcctObj *pAcct) {
SDB_SET_INT32
(
pRaw
,
dataPos
,
pAcct
->
cfg
.
maxTopics
,
_OVER
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pAcct
->
cfg
.
maxStorage
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pAcct
->
cfg
.
accessState
,
_OVER
)
SDB_SET_RESERVE
(
pRaw
,
dataPos
,
TSDB_
ACCT_RESERVE_SIZE
,
_OVER
)
SDB_SET_RESERVE
(
pRaw
,
dataPos
,
ACCT_RESERVE_SIZE
,
_OVER
)
SDB_SET_DATALEN
(
pRaw
,
dataPos
,
_OVER
)
terrno
=
0
;
...
...
@@ -122,7 +123,7 @@ static SSdbRow *mndAcctActionDecode(SSdbRaw *pRaw) {
int8_t
sver
=
0
;
if
(
sdbGetRawSoftVer
(
pRaw
,
&
sver
)
!=
0
)
goto
_OVER
;
if
(
sver
!=
TSDB_
ACCT_VER_NUMBER
)
{
if
(
sver
!=
ACCT_VER_NUMBER
)
{
terrno
=
TSDB_CODE_SDB_INVALID_DATA_VER
;
goto
_OVER
;
}
...
...
@@ -151,7 +152,7 @@ static SSdbRow *mndAcctActionDecode(SSdbRaw *pRaw) {
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pAcct
->
cfg
.
maxTopics
,
_OVER
)
SDB_GET_INT64
(
pRaw
,
dataPos
,
&
pAcct
->
cfg
.
maxStorage
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pAcct
->
cfg
.
accessState
,
_OVER
)
SDB_GET_RESERVE
(
pRaw
,
dataPos
,
TSDB_
ACCT_RESERVE_SIZE
,
_OVER
)
SDB_GET_RESERVE
(
pRaw
,
dataPos
,
ACCT_RESERVE_SIZE
,
_OVER
)
terrno
=
0
;
...
...
@@ -178,7 +179,6 @@ static int32_t mndAcctActionDelete(SSdb *pSdb, SAcctObj *pAcct) {
static
int32_t
mndAcctActionUpdate
(
SSdb
*
pSdb
,
SAcctObj
*
pOld
,
SAcctObj
*
pNew
)
{
mTrace
(
"acct:%s, perform update action, old row:%p new row:%p"
,
pOld
->
acct
,
pOld
,
pNew
);
pOld
->
updateTime
=
pNew
->
updateTime
;
pOld
->
status
=
pNew
->
status
;
memcpy
(
&
pOld
->
cfg
,
&
pNew
->
cfg
,
sizeof
(
SAcctCfg
));
...
...
@@ -186,19 +186,19 @@ static int32_t mndAcctActionUpdate(SSdb *pSdb, SAcctObj *pOld, SAcctObj *pNew) {
}
static
int32_t
mndProcessCreateAcctReq
(
SNodeMsg
*
pReq
)
{
terrno
=
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
;
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
mError
(
"failed to process create acct request since %s"
,
terrstr
());
return
-
1
;
}
static
int32_t
mndProcessAlterAcctReq
(
SNodeMsg
*
pReq
)
{
terrno
=
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
;
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
mError
(
"failed to process create acct request since %s"
,
terrstr
());
return
-
1
;
}
static
int32_t
mndProcessDropAcctReq
(
SNodeMsg
*
pReq
)
{
terrno
=
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
;
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
mError
(
"failed to process create acct request since %s"
,
terrstr
());
return
-
1
;
}
\ No newline at end of file
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
289cfb93
...
...
@@ -363,7 +363,7 @@ static int32_t mndProcessStatusReq(SNodeMsg *pReq) {
pDnode
->
offlineReason
=
DND_REASON_VERSION_NOT_MATCH
;
}
mError
(
"dnode:%d, status msg version:%d not match cluster:%d"
,
statusReq
.
dnodeId
,
statusReq
.
sver
,
tsVersion
);
terrno
=
TSDB_CODE_
MND_INVALID_MSG_VERSION
;
terrno
=
TSDB_CODE_
VERSION_NOT_COMPATIBLE
;
goto
PROCESS_STATUS_MSG_OVER
;
}
...
...
source/dnode/mnode/impl/src/mndSync.c
浏览文件 @
289cfb93
...
...
@@ -72,7 +72,7 @@ static int32_t mndRestoreWal(SMnode *pMnode) {
}
mTrace
(
"wal:%"
PRId64
", will be restored, content:%p"
,
ver
,
pHead
->
head
.
body
);
if
(
sdbWrite
No
tFree
(
pSdb
,
(
void
*
)
pHead
->
head
.
body
)
<
0
)
{
if
(
sdbWrite
Withou
tFree
(
pSdb
,
(
void
*
)
pHead
->
head
.
body
)
<
0
)
{
mError
(
"failed to read wal from sdb since %s, ver:%"
PRId64
,
terrstr
(),
ver
);
goto
WAL_RESTORE_OVER
;
}
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
289cfb93
...
...
@@ -844,7 +844,7 @@ static int32_t mndTransExecuteLogs(SMnode *pMnode, SArray *pArray) {
for
(
int32_t
i
=
0
;
i
<
arraySize
;
++
i
)
{
SSdbRaw
*
pRaw
=
taosArrayGetP
(
pArray
,
i
);
int32_t
code
=
sdbWrite
No
tFree
(
pSdb
,
pRaw
);
int32_t
code
=
sdbWrite
Withou
tFree
(
pSdb
,
pRaw
);
if
(
code
!=
0
)
{
return
code
;
}
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
289cfb93
...
...
@@ -368,7 +368,7 @@ int32_t mndProcessMsg(SNodeMsg *pMsg) {
}
if
(
isReq
&&
(
pRpc
->
contLen
==
0
||
pRpc
->
pCont
==
NULL
))
{
terrno
=
TSDB_CODE_
MND_
INVALID_MSG_LEN
;
terrno
=
TSDB_CODE_INVALID_MSG_LEN
;
mError
(
"msg:%p, failed to process since %s, app:%p"
,
pMsg
,
terrstr
(),
ahandle
);
return
-
1
;
}
...
...
source/dnode/mnode/impl/test/acct/acct.cpp
浏览文件 @
289cfb93
...
...
@@ -32,7 +32,7 @@ TEST_F(MndTestAcct, 01_Create_Acct) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_ACCT
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_MSG_NOT_PROCESSED
);
}
TEST_F
(
MndTestAcct
,
02
_Alter_Acct
)
{
...
...
@@ -42,7 +42,7 @@ TEST_F(MndTestAcct, 02_Alter_Acct) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_ALTER_ACCT
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_MSG_NOT_PROCESSED
);
}
TEST_F
(
MndTestAcct
,
03
_Drop_Acct
)
{
...
...
@@ -52,5 +52,5 @@ TEST_F(MndTestAcct, 03_Drop_Acct) {
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_ACCT
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_M
ND_M
SG_NOT_PROCESSED
);
ASSERT_EQ
(
pRsp
->
code
,
TSDB_CODE_MSG_NOT_PROCESSED
);
}
source/dnode/mnode/sdb/src/sdbFile.c
浏览文件 @
289cfb93
...
...
@@ -202,7 +202,7 @@ int32_t sdbReadFile(SSdb *pSdb) {
break
;
}
code
=
sdbWrite
No
tFree
(
pSdb
,
pRaw
);
code
=
sdbWrite
Withou
tFree
(
pSdb
,
pRaw
);
if
(
code
!=
0
)
{
mError
(
"failed to read file:%s since %s"
,
file
,
terrstr
());
goto
PARSE_SDB_DATA_ERROR
;
...
...
@@ -263,7 +263,7 @@ static int32_t sdbWriteFileImp(SSdb *pSdb) {
continue
;
}
sdbPrintOper
(
pSdb
,
pRow
,
"write
File
"
);
sdbPrintOper
(
pSdb
,
pRow
,
"write"
);
SSdbRaw
*
pRaw
=
(
*
encodeFp
)(
pRow
->
pObj
);
if
(
pRaw
!=
NULL
)
{
...
...
source/dnode/mnode/sdb/src/sdbHash.c
浏览文件 @
289cfb93
...
...
@@ -51,7 +51,9 @@ const char *sdbTableName(ESdbType type) {
case
SDB_TOPIC
:
return
"topic"
;
case
SDB_VGROUP
:
return
"vgId"
;
return
"vgroup"
;
case
SDB_SMA
:
return
"sma"
;
case
SDB_STB
:
return
"stb"
;
case
SDB_DB
:
...
...
@@ -86,13 +88,13 @@ void sdbPrintOper(SSdb *pSdb, SSdbRow *pRow, const char *oper) {
EKeyType
keyType
=
pSdb
->
keyTypes
[
pRow
->
type
];
if
(
keyType
==
SDB_KEY_BINARY
)
{
mTrace
(
"%s:%s, ref
Count:%d oper:%s row:%p status:%s"
,
sdbTableName
(
pRow
->
type
),
(
char
*
)
pRow
->
pObj
,
pRow
->
refCount
,
oper
,
pRow
->
pObj
,
sdbStatusStr
(
pRow
->
status
));
mTrace
(
"%s:%s, ref
:%d oper:%s row:%p status:%s"
,
sdbTableName
(
pRow
->
type
),
(
char
*
)
pRow
->
pObj
,
pRow
->
refCount
,
oper
,
pRow
->
pObj
,
sdbStatusStr
(
pRow
->
status
));
}
else
if
(
keyType
==
SDB_KEY_INT32
)
{
mTrace
(
"%s:%d, ref
Count:%d oper:%s row:%p status:%s"
,
sdbTableName
(
pRow
->
type
),
*
(
int32_t
*
)
pRow
->
pObj
,
pRow
->
refCount
,
oper
,
pRow
->
pObj
,
sdbStatusStr
(
pRow
->
status
));
mTrace
(
"%s:%d, ref
:%d oper:%s row:%p status:%s"
,
sdbTableName
(
pRow
->
type
),
*
(
int32_t
*
)
pRow
->
pObj
,
pRow
->
refCount
,
oper
,
pRow
->
pObj
,
sdbStatusStr
(
pRow
->
status
));
}
else
if
(
keyType
==
SDB_KEY_INT64
)
{
mTrace
(
"%s:%"
PRId64
", ref
Count
:%d oper:%s row:%p status:%s"
,
sdbTableName
(
pRow
->
type
),
*
(
int64_t
*
)
pRow
->
pObj
,
mTrace
(
"%s:%"
PRId64
", ref:%d oper:%s row:%p status:%s"
,
sdbTableName
(
pRow
->
type
),
*
(
int64_t
*
)
pRow
->
pObj
,
pRow
->
refCount
,
oper
,
pRow
->
pObj
,
sdbStatusStr
(
pRow
->
status
));
}
else
{
}
...
...
@@ -142,7 +144,7 @@ static int32_t sdbInsertRow(SSdb *pSdb, SHashObj *hash, SSdbRaw *pRaw, SSdbRow *
pRow
->
refCount
=
0
;
pRow
->
status
=
pRaw
->
status
;
sdbPrintOper
(
pSdb
,
pRow
,
"insert
Row
"
);
sdbPrintOper
(
pSdb
,
pRow
,
"insert"
);
if
(
taosHashPut
(
hash
,
pRow
->
pObj
,
keySize
,
&
pRow
,
sizeof
(
void
*
))
!=
0
)
{
taosWUnLockLatch
(
pLock
);
...
...
@@ -191,7 +193,7 @@ static int32_t sdbUpdateRow(SSdb *pSdb, SHashObj *hash, SSdbRaw *pRaw, SSdbRow *
SSdbRow
*
pOldRow
=
*
ppOldRow
;
pOldRow
->
status
=
pRaw
->
status
;
sdbPrintOper
(
pSdb
,
pOldRow
,
"update
Row
"
);
sdbPrintOper
(
pSdb
,
pOldRow
,
"update"
);
taosRUnLockLatch
(
pLock
);
int32_t
code
=
0
;
...
...
@@ -220,7 +222,7 @@ static int32_t sdbDeleteRow(SSdb *pSdb, SHashObj *hash, SSdbRaw *pRaw, SSdbRow *
SSdbRow
*
pOldRow
=
*
ppOldRow
;
pOldRow
->
status
=
pRaw
->
status
;
sdbPrintOper
(
pSdb
,
pOldRow
,
"delete
Row
"
);
sdbPrintOper
(
pSdb
,
pOldRow
,
"delete"
);
taosHashRemove
(
hash
,
pOldRow
->
pObj
,
keySize
);
taosWUnLockLatch
(
pLock
);
...
...
@@ -233,7 +235,7 @@ static int32_t sdbDeleteRow(SSdb *pSdb, SHashObj *hash, SSdbRaw *pRaw, SSdbRow *
return
0
;
}
int32_t
sdbWrite
No
tFree
(
SSdb
*
pSdb
,
SSdbRaw
*
pRaw
)
{
int32_t
sdbWrite
Withou
tFree
(
SSdb
*
pSdb
,
SSdbRaw
*
pRaw
)
{
SHashObj
*
hash
=
sdbGetHash
(
pSdb
,
pRaw
->
type
);
if
(
hash
==
NULL
)
return
terrno
;
...
...
@@ -266,7 +268,7 @@ int32_t sdbWriteNotFree(SSdb *pSdb, SSdbRaw *pRaw) {
}
int32_t
sdbWrite
(
SSdb
*
pSdb
,
SSdbRaw
*
pRaw
)
{
int32_t
code
=
sdbWrite
No
tFree
(
pSdb
,
pRaw
);
int32_t
code
=
sdbWrite
Withou
tFree
(
pSdb
,
pRaw
);
sdbFreeRaw
(
pRaw
);
return
code
;
}
...
...
@@ -296,7 +298,7 @@ void *sdbAcquire(SSdb *pSdb, ESdbType type, const void *pKey) {
case
SDB_STATUS_UPDATING
:
atomic_add_fetch_32
(
&
pRow
->
refCount
,
1
);
pRet
=
pRow
->
pObj
;
sdbPrintOper
(
pSdb
,
pRow
,
"acquire
Row
"
);
sdbPrintOper
(
pSdb
,
pRow
,
"acquire"
);
break
;
case
SDB_STATUS_CREATING
:
terrno
=
TSDB_CODE_SDB_OBJ_CREATING
;
...
...
@@ -318,7 +320,7 @@ static void sdbCheck(SSdb *pSdb, SSdbRow *pRow) {
taosRLockLatch
(
pLock
);
int32_t
ref
=
atomic_load_32
(
&
pRow
->
refCount
);
sdbPrintOper
(
pSdb
,
pRow
,
"check
Row
"
);
sdbPrintOper
(
pSdb
,
pRow
,
"check"
);
if
(
ref
<=
0
&&
pRow
->
status
==
SDB_STATUS_DROPPED
)
{
sdbFreeRow
(
pSdb
,
pRow
);
}
...
...
@@ -330,13 +332,13 @@ void sdbRelease(SSdb *pSdb, void *pObj) {
if
(
pObj
==
NULL
)
return
;
SSdbRow
*
pRow
=
(
SSdbRow
*
)((
char
*
)
pObj
-
sizeof
(
SSdbRow
));
if
(
pRow
->
type
>=
SDB_MAX
)
return
;
if
(
pRow
->
type
>=
SDB_MAX
)
return
;
SRWLatch
*
pLock
=
&
pSdb
->
locks
[
pRow
->
type
];
taosRLockLatch
(
pLock
);
int32_t
ref
=
atomic_sub_fetch_32
(
&
pRow
->
refCount
,
1
);
sdbPrintOper
(
pSdb
,
pRow
,
"release
Row
"
);
sdbPrintOper
(
pSdb
,
pRow
,
"release"
);
if
(
ref
<=
0
&&
pRow
->
status
==
SDB_STATUS_DROPPED
)
{
sdbFreeRow
(
pSdb
,
pRow
);
}
...
...
@@ -372,7 +374,7 @@ void *sdbFetch(SSdb *pSdb, ESdbType type, void *pIter, void **ppObj) {
}
atomic_add_fetch_32
(
&
pRow
->
refCount
,
1
);
sdbPrintOper
(
pSdb
,
pRow
,
"fetch
Row
"
);
sdbPrintOper
(
pSdb
,
pRow
,
"fetch"
);
*
ppObj
=
pRow
->
pObj
;
break
;
}
...
...
source/dnode/mnode/sdb/src/sdbRaw.c
浏览文件 @
289cfb93
...
...
@@ -27,7 +27,7 @@ SSdbRaw *sdbAllocRaw(ESdbType type, int8_t sver, int32_t dataLen) {
pRaw
->
sver
=
sver
;
pRaw
->
dataLen
=
dataLen
;
mTrace
(
"raw:%p, is created, len:%d
"
,
pRaw
,
dataLen
);
mTrace
(
"raw:%p, is created, len:%d
table:%s"
,
pRaw
,
dataLen
,
sdbTableName
(
type
)
);
return
pRaw
;
}
...
...
source/dnode/mnode/sdb/src/sdbRow.c
浏览文件 @
289cfb93
...
...
@@ -43,7 +43,7 @@ void sdbFreeRow(SSdb *pSdb, SSdbRow *pRow) {
(
*
deleteFp
)(
pSdb
,
pRow
->
pObj
);
}
sdbPrintOper
(
pSdb
,
pRow
,
"free
Row
"
);
sdbPrintOper
(
pSdb
,
pRow
,
"free"
);
mTrace
(
"row:%p, is freed"
,
pRow
->
pObj
);
taosMemoryFreeClear
(
pRow
);
...
...
source/util/src/tconfig.c
浏览文件 @
289cfb93
...
...
@@ -145,12 +145,6 @@ static int32_t cfgCheckAndSetDir(SConfigItem *pItem, const char *inputDir) {
return
-
1
;
}
if
(
taosRealPath
(
fullDir
,
NULL
,
PATH_MAX
)
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
uError
(
"failed to get realpath of dir:%s since %s"
,
inputDir
,
terrstr
());
return
-
1
;
}
taosMemoryFreeClear
(
pItem
->
str
);
pItem
->
str
=
strdup
(
fullDir
);
if
(
pItem
->
str
==
NULL
)
{
...
...
source/util/src/terror.c
浏览文件 @
289cfb93
...
...
@@ -144,17 +144,10 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSC_STMT_CLAUSE_ERROR, "not supported stmt cl
// mnode-common
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_APP_ERROR
,
"Mnode internal error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NOT_READY
,
"Cluster not ready"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_MSG_NOT_PROCESSED
,
"Message not processed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NOT_READY
,
"Mnode not ready"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_ACTION_IN_PROGRESS
,
"Message is progressing"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_ACTION_NEED_REPROCESSED
,
"Message need to be reprocessed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NO_RIGHTS
,
"Insufficient privilege for operation"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_OPTIONS
,
"Invalid mnode options"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_CONNECTION
,
"Invalid message connection"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_MSG_VERSION
,
"Incompatible protocol version"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_MSG_LEN
,
"Invalid message length"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_MSG_TYPE
,
"Invalid message type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_SHELL_CONNS
,
"Too many connections"
)
// mnode-show
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_SHOWOBJ
,
"Data expired"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录