Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
哥们要飞
TDengine
提交
a3d4443a
T
TDengine
项目概览
哥们要飞
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a3d4443a
编写于
4月 16, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-52] modify updatefp in sdb
上级
13b44b30
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
54 addition
and
19 deletion
+54
-19
src/mnode/src/mgmtDb.c
src/mnode/src/mgmtDb.c
+6
-0
src/mnode/src/mgmtSdb.c
src/mnode/src/mgmtSdb.c
+3
-9
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+23
-0
src/mnode/src/mgmtUser.c
src/mnode/src/mgmtUser.c
+6
-0
src/mnode/src/mgmtVgroup.c
src/mnode/src/mgmtVgroup.c
+16
-10
未找到文件。
src/mnode/src/mgmtDb.c
浏览文件 @
a3d4443a
...
@@ -83,6 +83,12 @@ static int32_t mgmtDbActionDelete(SSdbOperDesc *pOper) {
...
@@ -83,6 +83,12 @@ static int32_t mgmtDbActionDelete(SSdbOperDesc *pOper) {
}
}
static
int32_t
mgmtDbActionUpdate
(
SSdbOperDesc
*
pOper
)
{
static
int32_t
mgmtDbActionUpdate
(
SSdbOperDesc
*
pOper
)
{
SDbObj
*
pDb
=
pOper
->
pObj
;
SDbObj
*
pSaved
=
mgmtGetDb
(
pDb
->
name
);
if
(
pDb
!=
pSaved
)
{
memcpy
(
pSaved
,
pDb
,
pOper
->
rowSize
);
free
(
pDb
);
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
src/mnode/src/mgmtSdb.c
浏览文件 @
a3d4443a
...
@@ -335,25 +335,19 @@ static int32_t sdbProcessWriteFromWal(SSdbTable *pTable, SWalHead *pHead, int32_
...
@@ -335,25 +335,19 @@ static int32_t sdbProcessWriteFromWal(SSdbTable *pTable, SWalHead *pHead, int32_
SRowMeta
*
rowMeta
=
sdbGetRowMeta
(
pTable
,
pHead
->
cont
);
SRowMeta
*
rowMeta
=
sdbGetRowMeta
(
pTable
,
pHead
->
cont
);
assert
(
rowMeta
!=
NULL
&&
rowMeta
->
row
!=
NULL
);
assert
(
rowMeta
!=
NULL
&&
rowMeta
->
row
!=
NULL
);
SSdbOperDesc
oper1
=
{
SSdbOperDesc
oper
=
{
.
table
=
pTable
,
.
pObj
=
rowMeta
->
row
,
};
sdbDeleteLocal
(
pTable
,
&
oper1
);
SSdbOperDesc
oper2
=
{
.
rowSize
=
pHead
->
len
,
.
rowSize
=
pHead
->
len
,
.
rowData
=
pHead
->
cont
,
.
rowData
=
pHead
->
cont
,
.
table
=
pTable
,
.
table
=
pTable
,
};
};
code
=
(
*
pTable
->
decodeFp
)(
&
oper
2
);
code
=
(
*
pTable
->
decodeFp
)(
&
oper
);
if
(
code
<
0
)
{
if
(
code
<
0
)
{
sdbTrace
(
"table:%s, failed to decode %s record:%s from file, version:%"
PRId64
,
pTable
->
tableName
,
sdbTrace
(
"table:%s, failed to decode %s record:%s from file, version:%"
PRId64
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetkeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
sdbGetActionStr
(
action
),
sdbGetkeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
pthread_mutex_unlock
(
&
tsSdbObj
->
mutex
);
pthread_mutex_unlock
(
&
tsSdbObj
->
mutex
);
return
code
;
return
code
;
}
}
code
=
sdb
InsertLocal
(
pTable
,
&
oper2
);
code
=
sdb
UpdateLocal
(
pTable
,
&
oper
);
}
}
pthread_mutex_unlock
(
&
tsSdbObj
->
mutex
);
pthread_mutex_unlock
(
&
tsSdbObj
->
mutex
);
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
a3d4443a
...
@@ -165,6 +165,19 @@ static int32_t mgmtChildTableActionDelete(SSdbOperDesc *pOper) {
...
@@ -165,6 +165,19 @@ static int32_t mgmtChildTableActionDelete(SSdbOperDesc *pOper) {
}
}
static
int32_t
mgmtChildTableActionUpdate
(
SSdbOperDesc
*
pOper
)
{
static
int32_t
mgmtChildTableActionUpdate
(
SSdbOperDesc
*
pOper
)
{
SChildTableObj
*
pNew
=
pOper
->
pObj
;
SChildTableObj
*
pTable
=
mgmtGetChildTable
(
pNew
->
info
.
tableId
);
if
(
pTable
!=
pNew
)
{
void
*
oldSql
=
pTable
->
sql
;
void
*
oldSchema
=
pTable
->
schema
;
memcpy
(
pTable
,
pNew
,
pOper
->
rowSize
);
pTable
->
sql
=
pNew
->
sql
;
pTable
->
schema
=
pNew
->
schema
;
free
(
pNew
);
free
(
oldSql
);
free
(
oldSchema
);
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -371,6 +384,16 @@ static int32_t mgmtSuperTableActionDelete(SSdbOperDesc *pOper) {
...
@@ -371,6 +384,16 @@ static int32_t mgmtSuperTableActionDelete(SSdbOperDesc *pOper) {
}
}
static
int32_t
mgmtSuperTableActionUpdate
(
SSdbOperDesc
*
pOper
)
{
static
int32_t
mgmtSuperTableActionUpdate
(
SSdbOperDesc
*
pOper
)
{
SChildTableObj
*
pNew
=
pOper
->
pObj
;
SChildTableObj
*
pTable
=
mgmtGetChildTable
(
pNew
->
info
.
tableId
);
if
(
pTable
!=
pNew
)
{
void
*
oldSchema
=
pTable
->
schema
;
memcpy
(
pTable
,
pNew
,
pOper
->
rowSize
);
pTable
->
schema
=
pNew
->
schema
;
free
(
pNew
);
free
(
oldSchema
);
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
src/mnode/src/mgmtUser.c
浏览文件 @
a3d4443a
...
@@ -65,6 +65,12 @@ static int32_t mgmtUserActionDelete(SSdbOperDesc *pOper) {
...
@@ -65,6 +65,12 @@ static int32_t mgmtUserActionDelete(SSdbOperDesc *pOper) {
}
}
static
int32_t
mgmtUserActionUpdate
(
SSdbOperDesc
*
pOper
)
{
static
int32_t
mgmtUserActionUpdate
(
SSdbOperDesc
*
pOper
)
{
SUserObj
*
pUser
=
pOper
->
pObj
;
SUserObj
*
pSaved
=
mgmtGetUser
(
pUser
->
user
);
if
(
pUser
!=
pSaved
)
{
memcpy
(
pSaved
,
pUser
,
pOper
->
rowSize
);
free
(
pUser
);
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
src/mnode/src/mgmtVgroup.c
浏览文件 @
a3d4443a
...
@@ -53,14 +53,6 @@ static int32_t mgmtVgroupActionDestroy(SSdbOperDesc *pOper) {
...
@@ -53,14 +53,6 @@ static int32_t mgmtVgroupActionDestroy(SSdbOperDesc *pOper) {
tfree
(
pVgroup
->
tableList
);
tfree
(
pVgroup
->
tableList
);
}
}
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
SDnodeObj
*
pDnode
=
clusterGetDnode
(
pVgroup
->
vnodeGid
[
i
].
dnodeId
);
if
(
pDnode
)
{
atomic_sub_fetch_32
(
&
pDnode
->
openVnodes
,
1
);
}
clusterReleaseDnode
(
pDnode
);
}
tfree
(
pOper
->
pObj
);
tfree
(
pOper
->
pObj
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -115,13 +107,27 @@ static int32_t mgmtVgroupActionDelete(SSdbOperDesc *pOper) {
...
@@ -115,13 +107,27 @@ static int32_t mgmtVgroupActionDelete(SSdbOperDesc *pOper) {
}
}
mgmtReleaseDb
(
pVgroup
->
pDb
);
mgmtReleaseDb
(
pVgroup
->
pDb
);
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
SDnodeObj
*
pDnode
=
clusterGetDnode
(
pVgroup
->
vnodeGid
[
i
].
dnodeId
);
if
(
pDnode
)
{
atomic_sub_fetch_32
(
&
pDnode
->
openVnodes
,
1
);
}
clusterReleaseDnode
(
pDnode
);
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
mgmtVgroupActionUpdate
(
SSdbOperDesc
*
pOper
)
{
static
int32_t
mgmtVgroupActionUpdate
(
SSdbOperDesc
*
pOper
)
{
SVgObj
*
pVgroup
=
pOper
->
pObj
;
SVgObj
*
pNew
=
pOper
->
pObj
;
int32_t
oldTables
=
taosIdPoolMaxSize
(
pVgroup
->
idPool
);
SVgObj
*
pVgroup
=
mgmtGetVgroup
(
pNew
->
vgId
);
if
(
pVgroup
!=
pNew
)
{
memcpy
(
pVgroup
,
pNew
,
pOper
->
rowSize
);
free
(
pNew
);
}
int32_t
oldTables
=
taosIdPoolMaxSize
(
pVgroup
->
idPool
);
SDbObj
*
pDb
=
pVgroup
->
pDb
;
SDbObj
*
pDb
=
pVgroup
->
pDb
;
if
(
pDb
!=
NULL
)
{
if
(
pDb
!=
NULL
)
{
if
(
pDb
->
cfg
.
maxSessions
!=
oldTables
)
{
if
(
pDb
->
cfg
.
maxSessions
!=
oldTables
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录