Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a52a6ec7
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1181
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,发现更多精彩内容 >>
提交
a52a6ec7
编写于
5月 12, 2022
作者:
P
plum-lihui
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of github.com:taosdata/TDengine into 3.0
上级
d0c284d1
d203a093
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
26 addition
and
26 deletion
+26
-26
include/common/tglobal.h
include/common/tglobal.h
+2
-2
source/common/src/tglobal.c
source/common/src/tglobal.c
+5
-5
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+5
-4
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+4
-4
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+4
-5
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+3
-3
source/dnode/vnode/src/tsdb/tsdbSma.c
source/dnode/vnode/src/tsdb/tsdbSma.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbWrite.c
source/dnode/vnode/src/tsdb/tsdbWrite.c
+2
-2
未找到文件。
include/common/tglobal.h
浏览文件 @
a52a6ec7
...
...
@@ -43,7 +43,7 @@ extern int32_t tsMaxNumOfDistinctResults;
extern
int32_t
tsCompatibleModel
;
extern
bool
tsEnableSlaveQuery
;
extern
bool
tsPrintAuth
;
extern
int64_t
tsTickPer
Day
[
3
];
extern
int64_t
tsTickPer
Min
[
3
];
// multi-process
extern
bool
tsMultiProcess
;
...
...
@@ -122,7 +122,7 @@ extern int32_t tsDiskCfgNum;
extern
SDiskCfg
tsDiskCfg
[];
// udf
extern
bool
tsStartUdfd
;
extern
bool
tsStartUdfd
;
// internal
extern
int32_t
tsTransPullupInterval
;
...
...
source/common/src/tglobal.c
浏览文件 @
a52a6ec7
...
...
@@ -153,11 +153,11 @@ bool tsStreamSchedV = true;
/*
* minimum scale for whole system, millisecond by default
* for TSDB_TIME_PRECISION_MILLI:
8640
0000L
* TSDB_TIME_PRECISION_MICRO:
8640
0000000L
* TSDB_TIME_PRECISION_NANO:
8640
0000000000L
* for TSDB_TIME_PRECISION_MILLI:
6
0000L
* TSDB_TIME_PRECISION_MICRO:
6
0000000L
* TSDB_TIME_PRECISION_NANO:
6
0000000000L
*/
int64_t
tsTickPer
Day
[]
=
{
86400000L
,
86400000000L
,
8640
0000000000L
};
int64_t
tsTickPer
Min
[]
=
{
60000L
,
60000000L
,
6
0000000000L
};
// lossy compress 6
char
tsLossyColumns
[
32
]
=
""
;
// "float|double" means all float and double columns can be lossy compressed. set empty
...
...
@@ -170,7 +170,7 @@ uint32_t tsCurRange = 100; // range
char
tsCompressor
[
32
]
=
"ZSTD_COMPRESSOR"
;
// ZSTD_COMPRESSOR or GZIP_COMPRESSOR
// udf
bool
tsStartUdfd
=
true
;
bool
tsStartUdfd
=
true
;
// internal
int32_t
tsTransPullupInterval
=
6
;
...
...
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
a52a6ec7
...
...
@@ -144,11 +144,12 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
pCfg
->
szCache
=
pCreate
->
pages
;
pCfg
->
szBuf
=
pCreate
->
buffer
*
1024
*
1024
;
pCfg
->
isWeak
=
true
;
pCfg
->
tsdbCfg
.
compression
=
pCreate
->
compression
;
pCfg
->
tsdbCfg
.
precision
=
pCreate
->
precision
;
pCfg
->
tsdbCfg
.
days
=
10
;
pCfg
->
tsdbCfg
.
keep0
=
365
0
;
pCfg
->
tsdbCfg
.
keep1
=
3650
;
pCfg
->
tsdbCfg
.
keep2
=
3650
;
pCfg
->
tsdbCfg
.
days
=
pCreate
->
daysPerFile
;
pCfg
->
tsdbCfg
.
keep0
=
pCreate
->
daysToKeep
0
;
pCfg
->
tsdbCfg
.
keep1
=
pCreate
->
daysToKeep1
;
pCfg
->
tsdbCfg
.
keep2
=
pCreate
->
daysToKeep2
;
pCfg
->
tsdbCfg
.
minRows
=
pCreate
->
minRows
;
pCfg
->
tsdbCfg
.
maxRows
=
pCreate
->
maxRows
;
for
(
size_t
i
=
0
;
i
<
taosArrayGetSize
(
pCreate
->
pRetensions
);
++
i
)
{
...
...
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
a52a6ec7
...
...
@@ -518,9 +518,9 @@ void tsdbGetRtnSnap(STsdb *pRepo, SRtn *pRtn);
static
FORCE_INLINE
int
TSDB_KEY_FID
(
TSKEY
key
,
int32_t
days
,
int8_t
precision
)
{
if
(
key
<
0
)
{
return
(
int
)((
key
+
1
)
/
tsTickPer
Day
[
precision
]
/
days
-
1
);
return
(
int
)((
key
+
1
)
/
tsTickPer
Min
[
precision
]
/
days
-
1
);
}
else
{
return
(
int
)((
key
/
tsTickPer
Day
[
precision
]
/
days
));
return
(
int
)((
key
/
tsTickPer
Min
[
precision
]
/
days
));
}
}
...
...
@@ -770,8 +770,8 @@ static FORCE_INLINE int tsdbCopyDFileSet(SDFileSet *pSrc, SDFileSet *pDest) {
}
static
FORCE_INLINE
void
tsdbGetFidKeyRange
(
int
days
,
int8_t
precision
,
int
fid
,
TSKEY
*
minKey
,
TSKEY
*
maxKey
)
{
*
minKey
=
fid
*
days
*
tsTickPer
Day
[
precision
];
*
maxKey
=
*
minKey
+
days
*
tsTickPer
Day
[
precision
]
-
1
;
*
minKey
=
fid
*
days
*
tsTickPer
Min
[
precision
];
*
maxKey
=
*
minKey
+
days
*
tsTickPer
Min
[
precision
]
-
1
;
}
static
FORCE_INLINE
bool
tsdbFSetIsOk
(
SDFileSet
*
pSet
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
a52a6ec7
...
...
@@ -216,9 +216,9 @@ void tsdbGetRtnSnap(STsdb *pRepo, SRtn *pRtn) {
TSKEY
minKey
,
midKey
,
maxKey
,
now
;
now
=
taosGetTimestamp
(
pCfg
->
precision
);
minKey
=
now
-
pCfg
->
keep2
*
tsTickPer
Day
[
pCfg
->
precision
];
midKey
=
now
-
pCfg
->
keep1
*
tsTickPer
Day
[
pCfg
->
precision
];
maxKey
=
now
-
pCfg
->
keep0
*
tsTickPer
Day
[
pCfg
->
precision
];
minKey
=
now
-
pCfg
->
keep2
*
tsTickPer
Min
[
pCfg
->
precision
];
midKey
=
now
-
pCfg
->
keep1
*
tsTickPer
Min
[
pCfg
->
precision
];
maxKey
=
now
-
pCfg
->
keep0
*
tsTickPer
Min
[
pCfg
->
precision
];
pRtn
->
minKey
=
minKey
;
pRtn
->
minFid
=
(
int
)(
TSDB_KEY_FID
(
minKey
,
pCfg
->
days
,
pCfg
->
precision
));
...
...
@@ -398,7 +398,7 @@ static int tsdbCommitToFile(SCommitH *pCommith, SDFileSet *pSet, int fid) {
++
mIter
;
}
else
if
(
pIter
&&
!
pIter
->
pTable
)
{
// When table already dropped during commit, pIter is not NULL but pIter->pTable is NULL.
++
mIter
;
// skip the table and do nothing
++
mIter
;
// skip the table and do nothing
}
else
if
(
pIdx
)
{
if
(
tsdbMoveBlkIdx
(
pCommith
,
pIdx
)
<
0
)
{
tsdbCloseCommitFile
(
pCommith
,
true
);
...
...
@@ -948,7 +948,6 @@ static int tsdbMoveBlkIdx(SCommitH *pCommith, SBlockIdx *pIdx) {
static
int
tsdbSetCommitTable
(
SCommitH
*
pCommith
,
STable
*
pTable
)
{
STSchema
*
pSchema
=
tsdbGetTableSchemaImpl
(
pTable
,
false
,
false
,
-
1
);
pCommith
->
pTable
=
pTable
;
if
(
tdInitDataCols
(
pCommith
->
pDataCols
,
pSchema
)
<
0
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
a52a6ec7
...
...
@@ -323,7 +323,7 @@ static int64_t getEarliestValidTimestamp(STsdb* pTsdb) {
STsdbKeepCfg
*
pCfg
=
REPO_KEEP_CFG
(
pTsdb
);
int64_t
now
=
taosGetTimestamp
(
pCfg
->
precision
);
return
now
-
(
tsTickPer
Day
[
pCfg
->
precision
]
*
pCfg
->
keep2
)
+
1
;
// needs to add one tick
return
now
-
(
tsTickPer
Min
[
pCfg
->
precision
]
*
pCfg
->
keep2
)
+
1
;
// needs to add one tick
}
static
void
setQueryTimewindow
(
STsdbReadHandle
*
pTsdbReadHandle
,
SQueryTableDataCond
*
pCond
)
{
...
...
@@ -1047,10 +1047,10 @@ static int32_t getFileIdFromKey(TSKEY key, int32_t daysPerFile, int32_t precisio
}
if
(
key
<
0
)
{
key
-=
(
daysPerFile
*
tsTickPer
Day
[
precision
]);
key
-=
(
daysPerFile
*
tsTickPer
Min
[
precision
]);
}
int64_t
fid
=
(
int64_t
)(
key
/
(
daysPerFile
*
tsTickPer
Day
[
precision
]));
// set the starting fileId
int64_t
fid
=
(
int64_t
)(
key
/
(
daysPerFile
*
tsTickPer
Min
[
precision
]));
// set the starting fileId
if
(
fid
<
0L
&&
llabs
(
fid
)
>
INT32_MAX
)
{
// data value overflow for INT32
fid
=
INT32_MIN
;
}
...
...
source/dnode/vnode/src/tsdb/tsdbSma.c
浏览文件 @
a52a6ec7
...
...
@@ -1017,7 +1017,7 @@ static int32_t tsdbGetTSmaDays(STsdb *pTsdb, int64_t interval, int32_t storageLe
int32_t
daysPerFile
=
pCfg
->
days
;
if
(
storageLevel
==
SMA_STORAGE_LEVEL_TSDB
)
{
int32_t
days
=
SMA_STORAGE_TSDB_TIMES
*
(
interval
/
tsTickPer
Day
[
pCfg
->
precision
]);
int32_t
days
=
SMA_STORAGE_TSDB_TIMES
*
(
interval
/
tsTickPer
Min
[
pCfg
->
precision
]);
daysPerFile
=
days
>
SMA_STORAGE_TSDB_DAYS
?
days
:
SMA_STORAGE_TSDB_DAYS
;
}
...
...
source/dnode/vnode/src/tsdb/tsdbWrite.c
浏览文件 @
a52a6ec7
...
...
@@ -63,8 +63,8 @@ static int tsdbScanAndConvertSubmitMsg(STsdb *pTsdb, SSubmitReq *pMsg) {
STSRow
*
row
=
NULL
;
STsdbKeepCfg
*
pCfg
=
REPO_KEEP_CFG
(
pTsdb
);
TSKEY
now
=
taosGetTimestamp
(
pCfg
->
precision
);
TSKEY
minKey
=
now
-
tsTickPer
Day
[
pCfg
->
precision
]
*
pCfg
->
keep2
;
TSKEY
maxKey
=
now
+
tsTickPer
Day
[
pCfg
->
precision
]
*
pCfg
->
days
;
TSKEY
minKey
=
now
-
tsTickPer
Min
[
pCfg
->
precision
]
*
pCfg
->
keep2
;
TSKEY
maxKey
=
now
+
tsTickPer
Min
[
pCfg
->
precision
]
*
pCfg
->
days
;
terrno
=
TSDB_CODE_SUCCESS
;
// pMsg->length = htonl(pMsg->length);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录