Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f7908813
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看板
提交
f7908813
编写于
11月 12, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix sdb bugs
上级
90922fd2
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
93 addition
and
63 deletion
+93
-63
include/dnode/mnode/mnode.h
include/dnode/mnode/mnode.h
+3
-3
include/dnode/mnode/sdb/sdb.h
include/dnode/mnode/sdb/sdb.h
+2
-2
source/dnode/mgmt/src/dnodeMnode.c
source/dnode/mgmt/src/dnodeMnode.c
+5
-5
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+5
-4
source/dnode/mnode/impl/src/mnodeAcct.c
source/dnode/mnode/impl/src/mnodeAcct.c
+3
-1
source/dnode/mnode/impl/src/mnodeUser.c
source/dnode/mnode/impl/src/mnodeUser.c
+5
-3
source/dnode/mnode/sdb/inc/sdbInt.h
source/dnode/mnode/sdb/inc/sdbInt.h
+2
-0
source/dnode/mnode/sdb/src/sdbFile.c
source/dnode/mnode/sdb/src/sdbFile.c
+29
-19
source/dnode/mnode/sdb/src/sdbHash.c
source/dnode/mnode/sdb/src/sdbHash.c
+39
-26
未找到文件。
include/dnode/mnode/mnode.h
浏览文件 @
f7908813
...
...
@@ -55,9 +55,9 @@ typedef struct {
int32_t
mnodeInit
(
SMnodePara
para
);
void
mnodeCleanup
();
int32_t
mnodeDeploy
(
char
*
path
,
SMnodeCfg
*
pCfg
);
void
mnodeUnDeploy
(
char
*
path
);
int32_t
mnodeStart
(
char
*
path
,
SMnodeCfg
*
pCfg
);
int32_t
mnodeDeploy
(
SMnodeCfg
*
pCfg
);
void
mnodeUnDeploy
();
int32_t
mnodeStart
(
SMnodeCfg
*
pCfg
);
int32_t
mnodeAlter
(
SMnodeCfg
*
pCfg
);
void
mnodeStop
();
...
...
include/dnode/mnode/sdb/sdb.h
浏览文件 @
f7908813
...
...
@@ -157,8 +157,8 @@ void sdbUnDeploy();
void
*
sdbAcquire
(
ESdbType
sdb
,
void
*
pKey
);
void
sdbRelease
(
void
*
pObj
);
void
*
sdbFetch
(
ESdbType
sdb
,
void
*
pIter
);
void
sdbCancelFetch
(
ESdbType
sdb
,
void
*
pIter
);
void
*
sdbFetch
(
ESdbType
sdb
,
void
*
pIter
,
void
**
ppObj
);
void
sdbCancelFetch
(
void
*
pIter
);
int32_t
sdbGetSize
(
ESdbType
sdb
);
SSdbRaw
*
sdbAllocRaw
(
ESdbType
sdb
,
int8_t
sver
,
int32_t
dataLen
);
...
...
source/dnode/mgmt/src/dnodeMnode.c
浏览文件 @
f7908813
...
...
@@ -136,8 +136,8 @@ static int32_t dnodeWriteMnodeFile() {
char
*
content
=
calloc
(
1
,
maxLen
+
1
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"{
\n
"
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
deployed
\"
:
\"
%d
\"
,
\n
"
,
tsMnode
.
d
ropp
ed
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
dropped
\"
:
\"
%d
\"
,
\n
"
,
tsMnode
.
dropped
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
deployed
\"
:
\"
%d
\"
,
\n
"
,
tsMnode
.
d
eploy
ed
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
dropped
\"
:
\"
%d
\"\n
"
,
tsMnode
.
dropped
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"}
\n
"
);
fwrite
(
content
,
1
,
len
,
fp
);
...
...
@@ -180,7 +180,7 @@ static int32_t dnodeStartMnode() {
tsMnode
.
deployed
=
1
;
taosWUnLockLatch
(
&
tsMnode
.
latch
);
return
code
;
return
mnodeStart
(
NULL
)
;
}
static
void
dnodeStopMnode
()
{
...
...
@@ -212,14 +212,14 @@ static int32_t dnodeUnDeployMnode() {
}
dnodeStopMnode
();
mnodeUnDeploy
(
tsMnodeDir
);
mnodeUnDeploy
();
dnodeWriteMnodeFile
();
return
code
;
}
static
int32_t
dnodeDeployMnode
(
SMnodeCfg
*
pCfg
)
{
int32_t
code
=
mnodeDeploy
(
tsMnodeDir
,
pCfg
);
int32_t
code
=
mnodeDeploy
(
pCfg
);
if
(
code
!=
0
)
{
dError
(
"failed to deploy mnode since %s"
,
tstrerror
(
code
));
return
code
;
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
f7908813
...
...
@@ -134,10 +134,11 @@ static int32_t mnodeAllocInitSteps() {
}
static
int32_t
mnodeAllocStartSteps
()
{
struct
SSteps
*
steps
=
taosStepInit
(
7
,
NULL
);
struct
SSteps
*
steps
=
taosStepInit
(
8
,
NULL
);
if
(
steps
==
NULL
)
return
-
1
;
taosStepAdd
(
steps
,
"mnode-timer"
,
mnodeInitTimer
,
NULL
);
taosStepAdd
(
steps
,
"mnode-sdb-file"
,
sdbRead
,
(
CleanupFp
)
sdbCommit
);
taosStepAdd
(
steps
,
"mnode-balance"
,
mnodeInitBalance
,
mnodeCleanupBalance
);
taosStepAdd
(
steps
,
"mnode-profile"
,
mnodeInitProfile
,
mnodeCleanupProfile
);
taosStepAdd
(
steps
,
"mnode-show"
,
mnodeInitShow
,
mnodeCleanUpShow
);
...
...
@@ -170,7 +171,7 @@ int32_t mnodeInit(SMnodePara para) {
void
mnodeCleanup
()
{
taosStepCleanup
(
tsMint
.
pInitSteps
);
}
int32_t
mnodeDeploy
(
char
*
path
,
SMnodeCfg
*
pCfg
)
{
int32_t
mnodeDeploy
(
SMnodeCfg
*
pCfg
)
{
if
(
tsMint
.
para
.
dnodeId
<=
0
&&
tsMint
.
para
.
clusterId
<=
0
)
{
if
(
sdbDeploy
()
!=
0
)
{
mError
(
"failed to deploy sdb since %s"
,
terrstr
());
...
...
@@ -182,9 +183,9 @@ int32_t mnodeDeploy(char *path, SMnodeCfg *pCfg) {
return
0
;
}
void
mnodeUnDeploy
(
char
*
path
)
{
sdbUnDeploy
();
}
void
mnodeUnDeploy
()
{
sdbUnDeploy
();
}
int32_t
mnodeStart
(
char
*
path
,
SMnodeCfg
*
pCfg
)
{
return
taosStepExec
(
tsMint
.
pStartSteps
);
}
int32_t
mnodeStart
(
SMnodeCfg
*
pCfg
)
{
return
taosStepExec
(
tsMint
.
pStartSteps
);
}
int32_t
mnodeAlter
(
SMnodeCfg
*
pCfg
)
{
return
0
;
}
...
...
source/dnode/mnode/impl/src/mnodeAcct.c
浏览文件 @
f7908813
...
...
@@ -73,7 +73,9 @@ static int32_t mnodeAcctActionInsert(SAcctObj *pAcct) { return 0; }
static
int32_t
mnodeAcctActionDelete
(
SAcctObj
*
pAcct
)
{
return
0
;
}
static
int32_t
mnodeAcctActionUpdate
(
SAcctObj
*
pSrcAcct
,
SAcctObj
*
pDstAcct
)
{
memcpy
(
pDstAcct
,
pSrcAcct
,
(
int32_t
)((
char
*
)
&
pDstAcct
->
info
-
(
char
*
)
&
pDstAcct
));
SAcctObj
tObj
;
int32_t
len
=
(
int32_t
)((
int8_t
*
)
&
tObj
.
info
-
(
int8_t
*
)
&
tObj
);
memcpy
(
pDstAcct
,
pSrcAcct
,
len
);
return
0
;
}
...
...
source/dnode/mnode/impl/src/mnodeUser.c
浏览文件 @
f7908813
...
...
@@ -28,7 +28,7 @@ static SSdbRaw *mnodeUserActionEncode(SUserObj *pUser) {
int32_t
dataPos
=
0
;
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pUser
->
user
,
TSDB_USER_LEN
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pUser
->
pass
,
TSDB_KEY_LEN
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pUser
->
acct
,
TSDB_
KEY
_LEN
)
SDB_SET_BINARY
(
pRaw
,
dataPos
,
pUser
->
acct
,
TSDB_
USER
_LEN
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pUser
->
createdTime
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pUser
->
updateTime
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pUser
->
rootAuth
)
...
...
@@ -46,7 +46,7 @@ static SSdbRow *mnodeUserActionDecode(SSdbRaw *pRaw) {
return
NULL
;
}
SSdbRow
*
pRow
=
sdbAllocRow
(
sizeof
(
S
Acct
Obj
));
SSdbRow
*
pRow
=
sdbAllocRow
(
sizeof
(
S
User
Obj
));
SUserObj
*
pUser
=
sdbGetRowObj
(
pRow
);
if
(
pUser
==
NULL
)
return
NULL
;
...
...
@@ -92,7 +92,9 @@ static int32_t mnodeUserActionDelete(SUserObj *pUser) {
}
static
int32_t
mnodeUserActionUpdate
(
SUserObj
*
pSrcUser
,
SUserObj
*
pDstUser
)
{
memcpy
(
pDstUser
,
pSrcUser
,
(
int32_t
)((
char
*
)
&
pDstUser
->
prohibitDbHash
-
(
char
*
)
&
pDstUser
));
SUserObj
tObj
;
int32_t
len
=
(
int32_t
)((
int8_t
*
)
tObj
.
prohibitDbHash
-
(
int8_t
*
)
&
tObj
);
memcpy
(
pDstUser
,
pSrcUser
,
len
);
return
0
;
}
...
...
source/dnode/mnode/sdb/inc/sdbInt.h
浏览文件 @
f7908813
...
...
@@ -71,6 +71,8 @@ typedef struct {
extern
SSdbMgr
tsSdb
;
int32_t
sdbWriteImp
(
SSdbRaw
*
pRaw
);
#ifdef __cplusplus
}
#endif
...
...
source/dnode/mnode/sdb/src/sdbFile.c
浏览文件 @
f7908813
...
...
@@ -66,7 +66,7 @@ static int32_t sdbReadDataFile() {
char
file
[
PATH_MAX
]
=
{
0
};
snprintf
(
file
,
sizeof
(
file
),
"%ssdb.data"
,
tsSdb
.
currDir
);
FileFd
fd
=
taosOpenFile
CreateWrite
(
file
);
FileFd
fd
=
taosOpenFile
Read
(
file
);
if
(
fd
<=
0
)
{
free
(
pRaw
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
...
...
@@ -76,9 +76,12 @@ static int32_t sdbReadDataFile() {
int64_t
offset
=
0
;
int32_t
code
=
0
;
int32_t
readLen
=
0
;
int64_t
ret
=
0
;
while
(
1
)
{
int64_t
ret
=
taosReadFile
(
fd
,
pRaw
,
sizeof
(
SSdbRaw
));
readLen
=
sizeof
(
SSdbRaw
);
ret
=
taosReadFile
(
fd
,
pRaw
,
readLen
);
if
(
ret
==
0
)
break
;
if
(
ret
<
0
)
{
...
...
@@ -87,33 +90,34 @@ static int32_t sdbReadDataFile() {
break
;
}
if
(
ret
<
sizeof
(
SSdbRaw
)
)
{
if
(
ret
!=
readLen
)
{
code
=
TSDB_CODE_FILE_CORRUPTED
;
mError
(
"failed to read file:%s since %s"
,
file
,
tstrerror
(
code
));
break
;
}
ret
=
taosReadFile
(
fd
,
pRaw
->
pData
,
pRaw
->
dataLen
+
sizeof
(
int32_t
));
readLen
=
pRaw
->
dataLen
+
sizeof
(
int32_t
);
ret
=
taosReadFile
(
fd
,
pRaw
->
pData
,
readLen
);
if
(
ret
<
0
)
{
code
=
TAOS_SYSTEM_ERROR
(
errno
);
mError
(
"failed to read file:%s since %s"
,
file
,
tstrerror
(
code
));
break
;
}
if
(
ret
<
pRaw
->
dataLen
+
sizeof
(
int32_t
)
)
{
if
(
ret
!=
readLen
)
{
code
=
TSDB_CODE_FILE_CORRUPTED
;
mError
(
"failed to read file:%s since %s"
,
file
,
tstrerror
(
code
));
break
;
}
uint32_t
cksum
=
*
(
int32_t
*
)(
pRaw
->
pData
+
pRaw
->
dataLen
);
if
(
!
taosCheckChecksumWhole
(
pRaw
,
sizeof
(
SSdbRaw
)
+
pRaw
->
dataLen
+
sizeof
(
int32_t
)
)
!=
0
)
{
int32_t
totalLen
=
sizeof
(
SSdbRaw
)
+
pRaw
->
dataLen
+
sizeof
(
int32_t
);
if
(
!
taosCheckChecksumWhole
(
(
const
uint8_t
*
)
pRaw
,
totalLen
)
!=
0
)
{
code
=
TSDB_CODE_CHECKSUM_ERROR
;
mError
(
"failed to read file:%s since %s"
,
file
,
tstrerror
(
code
));
break
;
}
code
=
sdbWrite
(
pRaw
);
code
=
sdbWrite
Imp
(
pRaw
);
if
(
code
!=
0
)
{
mError
(
"failed to read file:%s since %s"
,
file
,
terrstr
());
goto
PARSE_SDB_DATA_ERROR
;
...
...
@@ -150,39 +154,47 @@ static int32_t sdbWriteDataFile() {
SRWLatch
*
pLock
=
&
tsSdb
.
locks
[
i
];
taosWLockLatch
(
pLock
);
SSdbRow
*
pRow
=
taosHashIterate
(
hash
,
NULL
);
while
(
pRow
!=
NULL
)
{
if
(
pRow
->
status
!=
SDB_STATUS_READY
)
continue
;
SSdbRow
**
ppRow
=
taosHashIterate
(
hash
,
NULL
);
while
(
ppRow
!=
NULL
)
{
SSdbRow
*
pRow
=
*
ppRow
;
if
(
pRow
==
NULL
||
pRow
->
status
!=
SDB_STATUS_READY
)
{
ppRow
=
taosHashIterate
(
hash
,
ppRow
);
continue
;
}
SSdbRaw
*
pRaw
=
(
*
encodeFp
)(
pRow
->
pObj
);
if
(
pRaw
!=
NULL
)
{
pRaw
->
status
=
pRow
->
status
;
int32_t
writeLen
=
sizeof
(
SSdbRaw
)
+
pRaw
->
dataLen
;
if
(
taosWriteFile
(
fd
,
pRaw
,
writeLen
)
!=
writeLen
)
{
code
=
TAOS_SYSTEM_ERROR
(
terrno
);
taosHashCancelIterate
(
hash
,
ppRow
);
break
;
}
int32_t
cksum
=
taosCalcChecksum
(
0
,
pRaw
,
sizeof
(
SSdbRaw
)
+
pRaw
->
dataLen
);
int32_t
cksum
=
taosCalcChecksum
(
0
,
(
const
uint8_t
*
)
pRaw
,
sizeof
(
SSdbRaw
)
+
pRaw
->
dataLen
);
if
(
taosWriteFile
(
fd
,
&
cksum
,
sizeof
(
int32_t
))
!=
sizeof
(
int32_t
))
{
code
=
TAOS_SYSTEM_ERROR
(
terrno
);
taosHashCancelIterate
(
hash
,
ppRow
);
break
;
}
}
else
{
taosHashCancelIterate
(
hash
,
pRow
);
code
=
TSDB_CODE_SDB_APP_ERROR
;
taosHashCancelIterate
(
hash
,
ppRow
);
break
;
}
p
Row
=
taosHashIterate
(
hash
,
pRow
);
p
pRow
=
taosHashIterate
(
hash
,
p
pRow
);
}
taosWUnLockLatch
(
pLock
);
}
taosCloseFile
(
fd
);
if
(
code
==
0
)
{
code
=
taosFsyncFile
(
fd
);
}
taosCloseFile
(
fd
);
if
(
code
==
0
)
{
char
curfile
[
PATH_MAX
]
=
{
0
};
snprintf
(
curfile
,
sizeof
(
curfile
),
"%ssdb.data"
,
tsSdb
.
currDir
);
...
...
@@ -210,13 +222,11 @@ int32_t sdbRead() {
}
int32_t
sdbCommit
()
{
mDebug
(
"start to
commit
mnode file"
);
mDebug
(
"start to
write
mnode file"
);
return
sdbWriteDataFile
();
}
int32_t
sdbDeploy
()
{
mDebug
(
"start to deploy mnode"
);
if
(
sdbCreateDir
()
!=
0
)
{
return
-
1
;
}
...
...
source/dnode/mnode/sdb/src/sdbHash.c
浏览文件 @
f7908813
...
...
@@ -86,12 +86,12 @@ static int32_t sdbUpdateRow(SHashObj *hash, SSdbRaw *pRaw, SSdbRow *pRow, int32_
SRWLatch
*
pLock
=
&
tsSdb
.
locks
[
pRow
->
sdb
];
taosRLockLatch
(
pLock
);
SSdbRow
*
pDstRow
=
taosHashGet
(
hash
,
pRow
->
pObj
,
keySize
);
if
(
pDstRow
==
NULL
)
{
terrno
=
TSDB_CODE_SDB_OBJ_NOT_THERE
;
SSdbRow
**
ppDstRow
=
taosHashGet
(
hash
,
pRow
->
pObj
,
keySize
);
if
(
ppDstRow
==
NULL
||
*
ppDstRow
==
NULL
)
{
taosRUnLockLatch
(
pLock
);
return
-
1
;
return
sdbInsertRow
(
hash
,
pRaw
,
pRow
,
keySize
)
;
}
SSdbRow
*
pDstRow
=
*
ppDstRow
;
pRow
->
status
=
pRaw
->
status
;
taosRUnLockLatch
(
pLock
);
...
...
@@ -110,12 +110,13 @@ static int32_t sdbDeleteRow(SHashObj *hash, SSdbRaw *pRaw, SSdbRow *pRow, int32_
SRWLatch
*
pLock
=
&
tsSdb
.
locks
[
pRow
->
sdb
];
taosWLockLatch
(
pLock
);
SSdbRow
*
pDstRow
=
taosHashGet
(
hash
,
pRow
->
pObj
,
keySize
);
if
(
p
DstRow
==
NULL
)
{
SSdbRow
*
*
p
pDstRow
=
taosHashGet
(
hash
,
pRow
->
pObj
,
keySize
);
if
(
p
pDstRow
==
NULL
||
*
ppDstRow
)
{
terrno
=
TSDB_CODE_SDB_OBJ_NOT_THERE
;
taosWUnLockLatch
(
pLock
);
return
-
1
;
}
SSdbRow
*
pDstRow
=
*
ppDstRow
;
pRow
->
status
=
pRaw
->
status
;
taosHashRemove
(
hash
,
pRow
->
pObj
,
keySize
);
...
...
@@ -123,16 +124,14 @@ static int32_t sdbDeleteRow(SHashObj *hash, SSdbRaw *pRaw, SSdbRow *pRow, int32_
SdbDeleteFp
deleteFp
=
tsSdb
.
deleteFps
[
pRow
->
sdb
];
if
(
deleteFp
!=
NULL
)
{
if
((
*
deleteFp
)(
pRow
->
pObj
)
!=
0
)
{
return
-
1
;
}
(
void
)(
*
deleteFp
)(
pRow
->
pObj
);
}
sdbRelease
(
pRow
->
pObj
);
return
0
;
}
int32_t
sdbWrite
(
SSdbRaw
*
pRaw
)
{
int32_t
sdbWrite
Imp
(
SSdbRaw
*
pRaw
)
{
SHashObj
*
hash
=
sdbGetHash
(
pRaw
->
sdb
);
if
(
hash
==
NULL
)
return
-
1
;
...
...
@@ -171,6 +170,12 @@ int32_t sdbWrite(SSdbRaw *pRaw) {
return
0
;
}
int32_t
sdbWrite
(
SSdbRaw
*
pRaw
)
{
int32_t
code
=
sdbWriteImp
(
pRaw
);
sdbFreeRaw
(
pRaw
);
return
code
;
}
void
*
sdbAcquire
(
ESdbType
sdb
,
void
*
pKey
)
{
SHashObj
*
hash
=
sdbGetHash
(
sdb
);
if
(
hash
==
NULL
)
return
NULL
;
...
...
@@ -182,7 +187,7 @@ void *sdbAcquire(ESdbType sdb, void *pKey) {
taosRLockLatch
(
pLock
);
SSdbRow
**
ppRow
=
taosHashGet
(
hash
,
pKey
,
keySize
);
if
(
ppRow
==
NULL
||
*
ppRow
)
{
if
(
ppRow
==
NULL
||
*
ppRow
==
NULL
)
{
terrno
=
TSDB_CODE_SDB_OBJ_NOT_THERE
;
taosRUnLockLatch
(
pLock
);
return
NULL
;
...
...
@@ -226,27 +231,37 @@ void sdbRelease(void *pObj) {
taosRUnLockLatch
(
pLock
);
}
void
*
sdbFetch
Row
(
ESdbType
sdb
,
void
*
pIter
)
{
void
*
sdbFetch
(
ESdbType
sdb
,
void
*
pIter
,
void
**
ppObj
)
{
SHashObj
*
hash
=
sdbGetHash
(
sdb
);
if
(
hash
==
NULL
)
{
return
NULL
;
}
if
(
hash
==
NULL
)
return
NULL
;
SRWLatch
*
pLock
=
&
tsSdb
.
locks
[
sdb
];
taosRLockLatch
(
pLock
);
void
*
pRet
=
taosHashIterate
(
hash
,
pIter
);
SSdbRow
**
ppRow
=
taosHashIterate
(
hash
,
ppRow
);
while
(
ppRow
!=
NULL
)
{
SSdbRow
*
pRow
=
*
ppRow
;
if
(
pRow
==
NULL
||
pRow
->
status
!=
SDB_STATUS_READY
)
{
ppRow
=
taosHashIterate
(
hash
,
ppRow
);
continue
;
}
atomic_add_fetch_32
(
&
pRow
->
refCount
,
1
);
*
ppObj
=
pRow
->
pObj
;
break
;
}
taosRUnLockLatch
(
pLock
);
return
p
Ret
;
return
p
pRow
;
}
void
sdbCancelFetch
(
ESdbType
sdb
,
void
*
pIter
)
{
SHashObj
*
hash
=
sdbGetHash
(
sdb
)
;
if
(
hash
==
NULL
)
{
return
;
}
void
sdbCancelFetch
(
void
*
pIter
)
{
if
(
pIter
==
NULL
)
return
;
SSdbRow
*
pRow
=
*
(
SSdbRow
**
)
pIter
;
SHashObj
*
hash
=
sdbGetHash
(
pRow
->
sdb
)
;
if
(
hash
==
NULL
)
return
;
SRWLatch
*
pLock
=
&
tsSdb
.
locks
[
sdb
];
SRWLatch
*
pLock
=
&
tsSdb
.
locks
[
pRow
->
sdb
];
taosRLockLatch
(
pLock
);
taosHashCancelIterate
(
hash
,
pIter
);
taosRUnLockLatch
(
pLock
);
...
...
@@ -254,9 +269,7 @@ void sdbCancelFetch(ESdbType sdb, void *pIter) {
int32_t
sdbGetSize
(
ESdbType
sdb
)
{
SHashObj
*
hash
=
sdbGetHash
(
sdb
);
if
(
hash
==
NULL
)
{
return
0
;
}
if
(
hash
==
NULL
)
return
0
;
SRWLatch
*
pLock
=
&
tsSdb
.
locks
[
sdb
];
taosRLockLatch
(
pLock
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录