Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
be112f71
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看板
提交
be112f71
编写于
4月 12, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(tsdb): windows build error and add check error
上级
fc3d921b
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
24 addition
and
14 deletion
+24
-14
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-1
src/tsdb/src/tsdbDelete.c
src/tsdb/src/tsdbDelete.c
+23
-13
未找到文件。
src/client/src/tscServer.c
浏览文件 @
be112f71
...
...
@@ -3349,7 +3349,7 @@ int tscBuildDelDataMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
tagCondLen
=
pCond
->
len
;
}
size
_t
payloadLen
=
sizeof
(
SMsgDesc
)
+
sizeof
(
SSubmitMsg
)
+
sizeof
(
SSubmitBlk
)
+
sizeof
(
SControlData
)
+
tagCondLen
;
int32
_t
payloadLen
=
sizeof
(
SMsgDesc
)
+
sizeof
(
SSubmitMsg
)
+
sizeof
(
SSubmitBlk
)
+
sizeof
(
SControlData
)
+
tagCondLen
;
int32_t
ret
=
tscAllocPayload
(
pCmd
,
payloadLen
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
...
...
src/tsdb/src/tsdbDelete.c
浏览文件 @
be112f71
...
...
@@ -74,7 +74,7 @@ static int tsdbInitDeleteTblArray(SDeleteH *pdh);
static
void
tsdbDestroyDeleteTblArray
(
SDeleteH
*
pdh
);
static
int
tsdbCacheFSetIndex
(
SDeleteH
*
pdh
);
static
int
tsdbFSetInit
(
SDeleteH
*
pdh
,
SDFileSet
*
pSet
);
static
void
tsdb
Delete
FSetEnd
(
SDeleteH
*
pdh
);
static
void
tsdbFSetEnd
(
SDeleteH
*
pdh
);
static
int
tsdbFSetDeleteImpl
(
SDeleteH
*
pdh
);
static
int
tsdbBlockSolve
(
SDeleteH
*
pdh
,
SBlock
*
pBlock
);
static
int
tsdbWriteBlockToFile
(
SDeleteH
*
pdh
,
STable
*
pTable
,
SDataCols
*
pDCols
,
void
**
ppBuf
,
...
...
@@ -112,7 +112,8 @@ static void tsdbClearUpdates(SArray * pArray) {
taosArrayDestroy
(
&
pArray
);
}
static
int
tsdbDeleteMeta
(
STsdbRepo
*
pRepo
)
{
// init new meta file with current meta file
static
int
tsdbInitNewMFile
(
STsdbRepo
*
pRepo
)
{
STsdbFS
*
pfs
=
REPO_FS
(
pRepo
);
tsdbUpdateMFile
(
pfs
,
pfs
->
cstatus
->
pmf
);
return
TSDB_CODE_SUCCESS
;
...
...
@@ -133,9 +134,9 @@ static int tsdbDeleteImplCommon(STsdbRepo *pRepo, SControlDataInfo* pCtlInfo) {
// start transaction
tsdbStartDeleteTrans
(
pRepo
);
int32_t
ret
=
tsdb
DeleteMeta
(
pRepo
);
int32_t
ret
=
tsdb
InitNewMFile
(
pRepo
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
tsdbError
(
"vgId:%d :SDEL failed errcode=%d to
delete META data since %s"
,
REPO_ID
(
pRepo
),
ret
,
tstrerror
(
terrno
)
);
tsdbError
(
"vgId:%d :SDEL failed errcode=%d to
init new META"
,
REPO_ID
(
pRepo
),
ret
);
goto
_err
;
}
...
...
@@ -193,6 +194,7 @@ static int tsdbDeleteTSData(STsdbRepo *pRepo, SControlDataInfo* pCtlInfo, SArray
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
SDeleteH
deleteH
=
{
0
};
SDFileSet
*
pSet
=
NULL
;
int32_t
numSet
=
0
;
if
(
tsdbInitDeleteH
(
&
deleteH
,
pRepo
)
<
0
)
{
return
-
1
;
...
...
@@ -232,14 +234,16 @@ static int tsdbDeleteTSData(STsdbRepo *pRepo, SControlDataInfo* pCtlInfo, SArray
tsdbError
(
"vgId:%d :SDEL failed to delete data in FSET %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
return
-
1
;
}
}
else
{
ASSERT
(
false
);
numSet
++
;
}
}
tsdbDestroyDeleteH
(
&
deleteH
);
tsdbDebug
(
"vgId:%d :SDEL delete TS data over"
,
REPO_ID
(
pRepo
));
if
(
numSet
==
0
||
pCtlInfo
->
affectedRows
==
0
)
{
tsdbInfo
(
"vgId:%d :SDEL zero num FSet to delete."
,
REPO_ID
(
pRepo
));
return
-
1
;
}
return
0
;
}
...
...
@@ -282,7 +286,7 @@ static int tsdbFSetDelete(SDeleteH *pdh, SDFileSet *pSet) {
if
(
did
.
level
==
TFS_UNDECIDED_LEVEL
)
{
terrno
=
TSDB_CODE_TDB_NO_AVAIL_DISK
;
tsdbError
(
"vgId:%d :SDEL failed to delete table in FSET %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
tsdb
Delete
FSetEnd
(
pdh
);
tsdbFSetEnd
(
pdh
);
return
-
1
;
}
...
...
@@ -295,10 +299,12 @@ static int tsdbFSetDelete(SDeleteH *pdh, SDFileSet *pSet) {
tsdbDebug
(
"vgId:%d :SDEL pWSet is ver0. fid=%d"
,
REPO_ID
(
pRepo
),
pSet
->
fid
);
if
(
tsdbSDFileCreate
(
pRepo
,
pWSet
,
pSet
,
did
,
TSDB_FILE_SMAD
)
<
0
)
{
tsdbError
(
"vgId:%d :SDEL failed to create sma files. fid=%d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
tsdbFSetEnd
(
pdh
);
return
-
1
;
}
if
(
tsdbSDFileCreate
(
pRepo
,
pWSet
,
pSet
,
did
,
TSDB_FILE_SMAL
)
<
0
)
{
tsdbError
(
"vgId:%d :SDEL failed to create sma files. fid=%d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
tsdbFSetEnd
(
pdh
);
return
-
1
;
}
pWSet
->
ver
=
TSDB_FS_VER_1
;
...
...
@@ -311,19 +317,23 @@ static int tsdbFSetDelete(SDeleteH *pdh, SDFileSet *pSet) {
tsdbError
(
"vgId:%d :SDEL failed to delete table in FSET %d since %s"
,
REPO_ID
(
pRepo
),
pSet
->
fid
,
tstrerror
(
terrno
));
tsdbCloseDFile
(
pHeadFile
);
tsdbRemoveDFile
(
pHeadFile
);
tsdbFSetEnd
(
pdh
);
return
-
1
;
}
tsdbCloseDFile
(
pHeadFile
);
if
(
tsdbOpenDFileSet
(
pWSet
,
O_RDWR
)
<
0
)
{
tsdbError
(
"vgId:%d :SDEL failed to open file set %d since %s"
,
REPO_ID
(
pRepo
),
TSDB_FSET_FID
(
pWSet
),
tstrerror
(
terrno
));
tsdbCloseDFile
(
pHeadFile
);
tsdbRemoveDFile
(
pHeadFile
);
tsdbFSetEnd
(
pdh
);
return
-
1
;
}
if
(
tsdbFSetDeleteImpl
(
pdh
)
<
0
)
{
tsdbCloseDFileSet
(
TSDB_DELETE_WSET
(
pdh
));
tsdbRemoveDFileSet
(
TSDB_DELETE_WSET
(
pdh
));
tsdb
Delete
FSetEnd
(
pdh
);
tsdbFSetEnd
(
pdh
);
return
-
1
;
}
...
...
@@ -331,7 +341,7 @@ static int tsdbFSetDelete(SDeleteH *pdh, SDFileSet *pSet) {
tsdbUpdateDFileSet
(
REPO_FS
(
pRepo
),
TSDB_DELETE_WSET
(
pdh
));
tsdbDebug
(
"vgId:%d :SDEL FSET %d delete data over"
,
REPO_ID
(
pRepo
),
pSet
->
fid
);
tsdb
Delete
FSetEnd
(
pdh
);
tsdbFSetEnd
(
pdh
);
return
0
;
}
...
...
@@ -521,7 +531,7 @@ static int tsdbFSetInit(SDeleteH *pdh, SDFileSet *pSet) {
return
0
;
}
static
void
tsdb
Delete
FSetEnd
(
SDeleteH
*
pdh
)
{
static
void
tsdbFSetEnd
(
SDeleteH
*
pdh
)
{
tsdbCloseAndUnsetFSet
(
&
(
pdh
->
readh
));
}
...
...
@@ -774,7 +784,7 @@ static int tsdbFSetDeleteImpl(SDeleteH *pdh) {
continue
;
// 2.WRITE INFO OF EACH TABLE BLOCK INFO TO HEAD FILE
if
(
tableInDel
(
pdh
,
tid
))
{
if
(
tableInDel
(
pdh
,
(
int32_t
)
tid
))
{
// modify blocks info and write to head file then save offset to blkIdx
ret
=
tsdbModifyBlocks
(
pdh
,
pItem
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录