Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b51aceef
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
提交
b51aceef
编写于
6月 19, 2020
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-353
上级
53844d6b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
14 deletion
+16
-14
src/tsdb/src/tsdbFile.c
src/tsdb/src/tsdbFile.c
+1
-1
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+4
-4
src/tsdb/src/tsdbMeta.c
src/tsdb/src/tsdbMeta.c
+3
-3
src/tsdb/src/tsdbRWHelper.c
src/tsdb/src/tsdbRWHelper.c
+6
-4
src/util/src/tkvstore.c
src/util/src/tkvstore.c
+2
-2
未找到文件。
src/tsdb/src/tsdbFile.c
浏览文件 @
b51aceef
...
...
@@ -249,7 +249,7 @@ int tsdbCreateFile(SFile *pFile, STsdbRepo *pRepo, int fid, int type) {
tsdbGetDataFileName
(
pRepo
,
fid
,
type
,
pFile
->
fname
);
if
(
access
(
pFile
->
fname
,
F_OK
)
==
0
)
{
tsdbError
(
"vgId:%d file %s already exists"
,
REPO_ID
(
pRepo
),
fid
);
tsdbError
(
"vgId:%d file %s already exists"
,
REPO_ID
(
pRepo
),
pFile
->
fname
);
terrno
=
TSDB_CODE_TDB_FILE_ALREADY_EXISTS
;
goto
_err
;
}
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
b51aceef
...
...
@@ -710,7 +710,7 @@ static int32_t tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, TSKEY
STable
*
pTable
=
tsdbGetTableByUid
(
pMeta
,
pBlock
->
uid
);
if
(
pTable
==
NULL
||
TABLE_TID
(
pTable
)
!=
pBlock
->
tid
)
{
tsdbError
(
"vgId:%d failed to get table to insert data, uid "
PRIu64
" tid %d"
,
REPO_ID
(
pRepo
),
pBlock
->
uid
,
tsdbError
(
"vgId:%d failed to get table to insert data, uid
%
"
PRIu64
" tid %d"
,
REPO_ID
(
pRepo
),
pBlock
->
uid
,
pBlock
->
tid
);
terrno
=
TSDB_CODE_TDB_INVALID_TABLE_ID
;
return
-
1
;
...
...
@@ -738,8 +738,8 @@ static int32_t tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, TSKEY
tsdbInitSubmitBlkIter
(
pBlock
,
&
blkIter
);
while
((
row
=
tsdbGetSubmitBlkNext
(
&
blkIter
))
!=
NULL
)
{
if
(
dataRowKey
(
row
)
<
minKey
||
dataRowKey
(
row
)
>
maxKey
)
{
tsdbError
(
"vgId:%d table %s tid %d uid %
ld timestamp is out of range! now "
PRId64
" maxKey
"
PRId64
" m
inKey
"
PRId64
,
tsdbError
(
"vgId:%d table %s tid %d uid %
"
PRIu64
" timestamp is out of range! now %"
PRId64
" minKey %
"
PRId64
" m
axKey %
"
PRId64
,
REPO_ID
(
pRepo
),
TABLE_CHAR_NAME
(
pTable
),
TABLE_TID
(
pTable
),
TABLE_UID
(
pTable
),
now
,
minKey
,
maxKey
);
terrno
=
TSDB_CODE_TDB_TIMESTAMP_OUT_OF_RANGE
;
return
-
1
;
...
...
@@ -836,7 +836,7 @@ static int tsdbInitSubmitBlkIter(SSubmitBlk *pBlock, SSubmitBlkIter *pIter) {
static
void
tsdbAlterCompression
(
STsdbRepo
*
pRepo
,
int8_t
compression
)
{
int8_t
ocompression
=
pRepo
->
config
.
compression
;
pRepo
->
config
.
compression
=
compression
;
tsdbTrace
(
"vgId:%d tsdb compression is changed from %d to %d"
,
ocompression
,
compression
);
tsdbTrace
(
"vgId:%d tsdb compression is changed from %d to %d"
,
REPO_ID
(
pRepo
),
ocompression
,
compression
);
}
static
int
tsdbAlterKeep
(
STsdbRepo
*
pRepo
,
int32_t
keep
)
{
...
...
src/tsdb/src/tsdbMeta.c
浏览文件 @
b51aceef
...
...
@@ -317,9 +317,9 @@ int tsdbUpdateTagValue(TSDB_REPO_T *repo, SUpdateTableTagValMsg *pMsg) {
if
(
schemaVersion
(
pTagSchema
)
>
tversion
)
{
tsdbError
(
"vgId:%d failed to update tag value of table %s since version out of date, client tag version
:
%d server tag "
"version
:
%d"
,
pRepo
->
config
.
tsdbId
,
varDataVal
(
pTable
->
nam
e
),
tversion
,
schemaVersion
(
pTable
->
tagSchema
));
"vgId:%d failed to update tag value of table %s since version out of date, client tag version
%d server tag "
"version
%d"
,
REPO_ID
(
pRepo
),
TABLE_CHAR_NAME
(
pTabl
e
),
tversion
,
schemaVersion
(
pTable
->
tagSchema
));
return
TSDB_CODE_TDB_TAG_VER_OUT_OF_DATE
;
}
if
(
schemaColAt
(
pTagSchema
,
DEFAULT_TAG_INDEX_COLUMN
)
->
colId
==
htons
(
pMsg
->
colId
))
{
...
...
src/tsdb/src/tsdbRWHelper.c
浏览文件 @
b51aceef
...
...
@@ -659,7 +659,8 @@ static int tsdbWriteBlockToFile(SRWHelper *pHelper, SFile *pFile, SDataCols *pDa
// Write the whole block to file
if
(
twrite
(
pFile
->
fd
,
(
void
*
)
pCompData
,
lsize
)
<
lsize
)
{
tsdbError
(
"vgId:%d failed to write %d bytes to file %s since %s"
,
REPO_ID
(
helperRepo
(
pHelper
)),
lsize
,
strerror
(
errno
));
tsdbError
(
"vgId:%d failed to write %d bytes to file %s since %s"
,
REPO_ID
(
helperRepo
(
pHelper
)),
lsize
,
pFile
->
fname
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
goto
_err
;
}
...
...
@@ -678,8 +679,9 @@ static int tsdbWriteBlockToFile(SRWHelper *pHelper, SFile *pFile, SDataCols *pDa
tsdbTrace
(
"vgId:%d tid:%d a block of data is written to file %s, offset %"
PRId64
" numOfRows %d len %d numOfCols %"
PRId16
" keyFirst %"
PRId64
" keyLast %"
PRId64
,
REPO_ID
(
helperRepo
(
pHelper
)),
pHelper
->
tableInfo
.
tid
,
pFile
->
fname
,
pCompBlock
->
offset
,
pCompBlock
->
numOfRows
,
pCompBlock
->
len
,
pCompBlock
->
numOfCols
,
pCompBlock
->
keyFirst
,
pCompBlock
->
keyLast
);
REPO_ID
(
helperRepo
(
pHelper
)),
pHelper
->
tableInfo
.
tid
,
pFile
->
fname
,
(
int64_t
)(
pCompBlock
->
offset
),
(
int
)(
pCompBlock
->
numOfRows
),
pCompBlock
->
len
,
pCompBlock
->
numOfCols
,
pCompBlock
->
keyFirst
,
pCompBlock
->
keyLast
);
return
0
;
...
...
@@ -1239,7 +1241,7 @@ static int tsdbLoadBlockDataImpl(SRWHelper *pHelper, SCompBlock *pCompBlock, SDa
int32_t
tsize
=
sizeof
(
SCompData
)
+
sizeof
(
SCompCol
)
*
pCompBlock
->
numOfCols
+
sizeof
(
TSCKSUM
);
if
(
!
taosCheckChecksumWhole
((
uint8_t
*
)
pCompData
,
tsize
))
{
tsdbError
(
"vgId:%d file %s block data is corrupted offset %"
PRId64
" len %d"
,
REPO_ID
(
pHelper
->
pRepo
),
pFile
->
fname
,
pCompBlock
->
offset
,
pCompBlock
->
len
);
pFile
->
fname
,
(
int64_t
)(
pCompBlock
->
offset
)
,
pCompBlock
->
len
);
terrno
=
TSDB_CODE_TDB_FILE_CORRUPTED
;
goto
_err
;
}
...
...
src/util/src/tkvstore.c
浏览文件 @
b51aceef
...
...
@@ -119,7 +119,7 @@ SKVStore *tdOpenKVStore(char *fname, iterFunc iFunc, afterFunc aFunc, void *appH
if
(
terrno
!=
TSDB_CODE_COM_FILE_CORRUPTED
)
goto
_err
;
}
else
{
if
(
ftruncate
(
pStore
->
fd
,
info
.
size
)
<
0
)
{
uError
(
"failed to truncate %s to "
PRId64
" size since %s"
,
pStore
->
fname
,
info
.
size
,
strerror
(
errno
));
uError
(
"failed to truncate %s to
%
"
PRId64
" size since %s"
,
pStore
->
fname
,
info
.
size
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
goto
_err
;
}
...
...
@@ -492,7 +492,7 @@ static int tdRestoreKVStore(SKVStore *pStore) {
ssize_t
tsize
=
tread
(
pStore
->
fd
,
tbuf
,
sizeof
(
SKVRecord
));
if
(
tsize
==
0
)
break
;
if
(
tsize
<
sizeof
(
SKVRecord
))
{
uError
(
"failed to read %
d
bytes from file %s at offset %"
PRId64
"since %s"
,
sizeof
(
SKVRecord
),
pStore
->
fname
,
uError
(
"failed to read %
zu
bytes from file %s at offset %"
PRId64
"since %s"
,
sizeof
(
SKVRecord
),
pStore
->
fname
,
pStore
->
info
.
size
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
goto
_err
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录