Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d0f6721d
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看板
未验证
提交
d0f6721d
编写于
3月 31, 2022
作者:
M
Minglei Jin
提交者:
GitHub
3月 31, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11155 from taosdata/TS-1292_dev
[TS-1292]<feature>: add time offset
上级
19d99491
9be274a0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
35 addition
and
2 deletion
+35
-2
packaging/cfg/taos.cfg
packaging/cfg/taos.cfg
+3
-0
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+10
-0
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+1
-0
src/common/src/tglobal.c
src/common/src/tglobal.c
+11
-0
src/tsdb/src/tsdbCommit.c
src/tsdb/src/tsdbCommit.c
+9
-1
src/util/inc/tconfig.h
src/util/inc/tconfig.h
+1
-1
未找到文件。
packaging/cfg/taos.cfg
浏览文件 @
d0f6721d
...
@@ -307,3 +307,6 @@ keepColumnName 1
...
@@ -307,3 +307,6 @@ keepColumnName 1
# unit MB. Flush vnode wal file if walSize > walFlushSize and walSize > cache*0.5*blocks
# unit MB. Flush vnode wal file if walSize > walFlushSize and walSize > cache*0.5*blocks
# walFlushSize 1024
# walFlushSize 1024
# unit Hour. Latency of data migration
# keepTimeOffset 0
src/client/src/tscSQLParser.c
浏览文件 @
d0f6721d
...
@@ -7715,6 +7715,7 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) {
...
@@ -7715,6 +7715,7 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) {
const
int
tokenDebugFlag
=
4
;
const
int
tokenDebugFlag
=
4
;
const
int
tokenDebugFlagEnd
=
20
;
const
int
tokenDebugFlagEnd
=
20
;
const
int
tokenOfflineInterval
=
21
;
const
int
tokenOfflineInterval
=
21
;
const
int
tokenKeepTimeOffset
=
22
;
const
SDNodeDynConfOption
cfgOptions
[]
=
{
const
SDNodeDynConfOption
cfgOptions
[]
=
{
{
"resetLog"
,
8
},
{
"resetQueryCache"
,
15
},
{
"balance"
,
7
},
{
"monitor"
,
7
},
{
"resetLog"
,
8
},
{
"resetQueryCache"
,
15
},
{
"balance"
,
7
},
{
"monitor"
,
7
},
{
"debugFlag"
,
9
},
{
"monDebugFlag"
,
12
},
{
"vDebugFlag"
,
10
},
{
"mDebugFlag"
,
10
},
{
"debugFlag"
,
9
},
{
"monDebugFlag"
,
12
},
{
"vDebugFlag"
,
10
},
{
"mDebugFlag"
,
10
},
...
@@ -7723,6 +7724,7 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) {
...
@@ -7723,6 +7724,7 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) {
{
"dDebugFlag"
,
10
},
{
"mqttDebugFlag"
,
13
},
{
"wDebugFlag"
,
10
},
{
"tmrDebugFlag"
,
12
},
{
"dDebugFlag"
,
10
},
{
"mqttDebugFlag"
,
13
},
{
"wDebugFlag"
,
10
},
{
"tmrDebugFlag"
,
12
},
{
"cqDebugFlag"
,
11
},
{
"cqDebugFlag"
,
11
},
{
"offlineInterval"
,
15
},
{
"offlineInterval"
,
15
},
{
"keepTimeOffset"
,
14
},
};
};
SStrToken
*
pOptionToken
=
taosArrayGet
(
pOptions
->
a
,
1
);
SStrToken
*
pOptionToken
=
taosArrayGet
(
pOptions
->
a
,
1
);
...
@@ -7762,6 +7764,14 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) {
...
@@ -7762,6 +7764,14 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) {
return
TSDB_CODE_TSC_INVALID_OPERATION
;
// options value is invalid
return
TSDB_CODE_TSC_INVALID_OPERATION
;
// options value is invalid
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
else
if
((
strncasecmp
(
cfgOptions
[
tokenKeepTimeOffset
].
name
,
pOptionToken
->
z
,
pOptionToken
->
n
)
==
0
)
&&
(
cfgOptions
[
tokenKeepTimeOffset
].
len
==
pOptionToken
->
n
))
{
SStrToken
*
pValToken
=
taosArrayGet
(
pOptions
->
a
,
2
);
int32_t
val
=
strtol
(
pValToken
->
z
,
NULL
,
10
);
if
(
val
<
-
23
||
val
>
23
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
// options value is invalid
}
return
TSDB_CODE_SUCCESS
;
}
else
{
}
else
{
SStrToken
*
pValToken
=
taosArrayGet
(
pOptions
->
a
,
2
);
SStrToken
*
pValToken
=
taosArrayGet
(
pOptions
->
a
,
2
);
...
...
src/common/inc/tglobal.h
浏览文件 @
d0f6721d
...
@@ -193,6 +193,7 @@ extern float tsReservedTmpDirectorySpace;
...
@@ -193,6 +193,7 @@ extern float tsReservedTmpDirectorySpace;
extern
float
tsMinimalDataDirGB
;
extern
float
tsMinimalDataDirGB
;
extern
int32_t
tsTotalMemoryMB
;
extern
int32_t
tsTotalMemoryMB
;
extern
uint32_t
tsVersion
;
extern
uint32_t
tsVersion
;
extern
int32_t
tsKeepTimeOffset
;
// build info
// build info
extern
char
version
[];
extern
char
version
[];
...
...
src/common/src/tglobal.c
浏览文件 @
d0f6721d
...
@@ -217,6 +217,7 @@ char tsMnodeBakDir[PATH_MAX] = {0};
...
@@ -217,6 +217,7 @@ char tsMnodeBakDir[PATH_MAX] = {0};
char
tsDataDir
[
PATH_MAX
]
=
{
0
};
char
tsDataDir
[
PATH_MAX
]
=
{
0
};
char
tsScriptDir
[
PATH_MAX
]
=
{
0
};
char
tsScriptDir
[
PATH_MAX
]
=
{
0
};
char
tsTempDir
[
PATH_MAX
]
=
"/tmp/"
;
char
tsTempDir
[
PATH_MAX
]
=
"/tmp/"
;
int32_t
tsKeepTimeOffset
=
0
;
int32_t
tsDiskCfgNum
=
0
;
int32_t
tsDiskCfgNum
=
0
;
int32_t
tsTopicBianryLen
=
16000
;
int32_t
tsTopicBianryLen
=
16000
;
...
@@ -665,6 +666,16 @@ static void doInitGlobalConfig(void) {
...
@@ -665,6 +666,16 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"keepTimeOffset"
;
cfg
.
ptr
=
&
tsKeepTimeOffset
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
-
23
;
cfg
.
maxValue
=
23
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
// 0-any; 1-mnode; 2-vnode
// 0-any; 1-mnode; 2-vnode
cfg
.
option
=
"role"
;
cfg
.
option
=
"role"
;
cfg
.
ptr
=
&
tsAlternativeRole
;
cfg
.
ptr
=
&
tsAlternativeRole
;
...
...
src/tsdb/src/tsdbCommit.c
浏览文件 @
d0f6721d
...
@@ -44,6 +44,14 @@ typedef struct {
...
@@ -44,6 +44,14 @@ typedef struct {
SDataCols
*
pDataCols
;
SDataCols
*
pDataCols
;
}
SCommitH
;
}
SCommitH
;
/*
* millisecond by default
* for TSDB_TIME_PRECISION_MILLI: 3600000L
* TSDB_TIME_PRECISION_MICRO: 3600000000L
* TSDB_TIME_PRECISION_NANO: 3600000000000L
*/
static
int64_t
tsTickPerHour
[]
=
{
3600000L
,
3600000000L
,
3600000000000L
};
#define TSDB_COMMIT_REPO(ch) TSDB_READ_REPO(&(ch->readh))
#define TSDB_COMMIT_REPO(ch) TSDB_READ_REPO(&(ch->readh))
#define TSDB_COMMIT_REPO_ID(ch) REPO_ID(TSDB_READ_REPO(&(ch->readh)))
#define TSDB_COMMIT_REPO_ID(ch) REPO_ID(TSDB_READ_REPO(&(ch->readh)))
#define TSDB_COMMIT_WRITE_FSET(ch) (&((ch)->wSet))
#define TSDB_COMMIT_WRITE_FSET(ch) (&((ch)->wSet))
...
@@ -397,7 +405,7 @@ void tsdbGetRtnSnap(STsdbRepo *pRepo, SRtn *pRtn) {
...
@@ -397,7 +405,7 @@ void tsdbGetRtnSnap(STsdbRepo *pRepo, SRtn *pRtn) {
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
TSKEY
minKey
,
midKey
,
maxKey
,
now
;
TSKEY
minKey
,
midKey
,
maxKey
,
now
;
now
=
taosGetTimestamp
(
pCfg
->
precision
);
now
=
taosGetTimestamp
(
pCfg
->
precision
)
-
tsKeepTimeOffset
*
tsTickPerHour
[
pCfg
->
precision
]
;
minKey
=
now
-
pCfg
->
keep
*
tsTickPerDay
[
pCfg
->
precision
];
minKey
=
now
-
pCfg
->
keep
*
tsTickPerDay
[
pCfg
->
precision
];
midKey
=
now
-
pCfg
->
keep2
*
tsTickPerDay
[
pCfg
->
precision
];
midKey
=
now
-
pCfg
->
keep2
*
tsTickPerDay
[
pCfg
->
precision
];
maxKey
=
now
-
pCfg
->
keep1
*
tsTickPerDay
[
pCfg
->
precision
];
maxKey
=
now
-
pCfg
->
keep1
*
tsTickPerDay
[
pCfg
->
precision
];
...
...
src/util/inc/tconfig.h
浏览文件 @
d0f6721d
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#define TSDB_CFG_MAX_NUM 13
3
#define TSDB_CFG_MAX_NUM 13
4
#define TSDB_CFG_PRINT_LEN 23
#define TSDB_CFG_PRINT_LEN 23
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_VALUE_LEN 41
#define TSDB_CFG_VALUE_LEN 41
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录