Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN产品汪
TDengine
提交
ee14fa07
T
TDengine
项目概览
CSDN产品汪
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
5
Star
0
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,发现更多精彩内容 >>
提交
ee14fa07
编写于
7月 14, 2020
作者:
陶建辉(Jeff)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add fsync option
上级
e78ce3bb
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
28 addition
and
6 deletion
+28
-6
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+7
-0
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+1
-0
src/inc/ttokendef.h
src/inc/ttokendef.h
+0
-1
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+7
-0
src/query/inc/sql.y
src/query/inc/sql.y
+1
-1
src/query/src/sql.c
src/query/src/sql.c
+7
-3
src/wal/src/walMain.c
src/wal/src/walMain.c
+5
-1
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
ee14fa07
...
...
@@ -5530,6 +5530,13 @@ int32_t tscCheckCreateDbParams(SSqlCmd* pCmd, SCMCreateDbMsg* pCreate) {
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
);
}
val
=
htonl
(
pCreate
->
fsyncPeriod
);
if
(
val
!=
-
1
&&
(
val
<
TSDB_MIN_FSYNC_PERIOD
||
val
>
TSDB_MAX_FSYNC_PERIOD
))
{
snprintf
(
msg
,
tListLen
(
msg
),
"invalid db option fsyncPeriod: %d valid range: [%d, %d]"
,
val
,
TSDB_MIN_FSYNC_PERIOD
,
TSDB_MAX_FSYNC_PERIOD
);
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
);
}
if
(
pCreate
->
compression
!=
-
1
&&
(
pCreate
->
compression
<
TSDB_MIN_COMP_LEVEL
||
pCreate
->
compression
>
TSDB_MAX_COMP_LEVEL
))
{
snprintf
(
msg
,
tListLen
(
msg
),
"invalid db option compression: %d valid range: [%d, %d]"
,
pCreate
->
compression
,
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
ee14fa07
...
...
@@ -401,6 +401,7 @@ static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) {
pCreate
->
cfg
.
daysToKeep
=
htonl
(
pCreate
->
cfg
.
daysToKeep
);
pCreate
->
cfg
.
minRowsPerFileBlock
=
htonl
(
pCreate
->
cfg
.
minRowsPerFileBlock
);
pCreate
->
cfg
.
maxRowsPerFileBlock
=
htonl
(
pCreate
->
cfg
.
maxRowsPerFileBlock
);
pCreate
->
cfg
.
fsyncPeriod
=
htonl
(
pCreate
->
cfg
.
fsyncPeriod
);
pCreate
->
cfg
.
commitTime
=
htonl
(
pCreate
->
cfg
.
commitTime
);
for
(
int32_t
j
=
0
;
j
<
pCreate
->
cfg
.
replications
;
++
j
)
{
...
...
src/inc/ttokendef.h
浏览文件 @
ee14fa07
...
...
@@ -222,7 +222,6 @@
#define TK_INTO 204
#define TK_VALUES 205
#define TK_SPACE 300
#define TK_COMMENT 301
#define TK_ILLEGAL 302
...
...
src/mnode/src/mnodeDb.c
浏览文件 @
ee14fa07
...
...
@@ -561,6 +561,12 @@ static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
pShow
->
bytes
[
cols
]
=
4
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_INT
;
strcpy
(
pSchema
[
cols
].
name
,
"fsync"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
pShow
->
bytes
[
cols
]
=
1
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_TINYINT
;
strcpy
(
pSchema
[
cols
].
name
,
"comp"
);
...
...
@@ -764,6 +770,7 @@ static int32_t mnodeProcessCreateDbMsg(SMnodeMsg *pMsg) {
pCreate
->
daysToKeep1
=
htonl
(
pCreate
->
daysToKeep1
);
pCreate
->
daysToKeep2
=
htonl
(
pCreate
->
daysToKeep2
);
pCreate
->
commitTime
=
htonl
(
pCreate
->
commitTime
);
pCreate
->
fsyncPeriod
=
htonl
(
pCreate
->
fsyncPeriod
);
pCreate
->
minRowsPerFileBlock
=
htonl
(
pCreate
->
minRowsPerFileBlock
);
pCreate
->
maxRowsPerFileBlock
=
htonl
(
pCreate
->
maxRowsPerFileBlock
);
...
...
src/query/inc/sql.y
浏览文件 @
ee14fa07
...
...
@@ -237,7 +237,7 @@ db_optr(Y) ::= db_optr(Z) maxrows(X). { Y = Z; Y.maxRowsPerBlock = strtod
db_optr(Y) ::= db_optr(Z) blocks(X). { Y = Z; Y.numOfBlocks = strtol(X.z, NULL, 10); }
db_optr(Y) ::= db_optr(Z) ctime(X). { Y = Z; Y.commitTime = strtol(X.z, NULL, 10); }
db_optr(Y) ::= db_optr(Z) wal(X). { Y = Z; Y.walLevel = strtol(X.z, NULL, 10); }
db_optr(Y) ::= db_optr(Z) fsync(X). { Y = Z; Y.fsyncPeriod = strto
d(X.z, NULL
); }
db_optr(Y) ::= db_optr(Z) fsync(X). { Y = Z; Y.fsyncPeriod = strto
l(X.z, NULL, 10
); }
db_optr(Y) ::= db_optr(Z) comp(X). { Y = Z; Y.compressionLevel = strtol(X.z, NULL, 10); }
db_optr(Y) ::= db_optr(Z) prec(X). { Y = Z; Y.precision = X; }
db_optr(Y) ::= db_optr(Z) keep(X). { Y = Z; Y.keep = X; }
...
...
src/query/src/sql.c
浏览文件 @
ee14fa07
...
...
@@ -30,8 +30,12 @@
#include <string.h>
#include <assert.h>
#include <stdbool.h>
#include "qsqlparser.h"
#include "tcmdtype.h"
#include "tstoken.h"
#include "ttokendef.h"
#include "tutil.h"
#include "tvariant.h"
/**************** End of %include directives **********************************/
/* These constants specify the various numeric values for terminal symbols
** in a format understandable to "makeheaders". This section is blank unless
...
...
@@ -2252,7 +2256,7 @@ static void yy_reduce(
yymsp
[
-
1
].
minor
.
yy158
=
yylhsminor
.
yy158
;
break
;
case
93
:
/* db_optr ::= db_optr fsync */
{
yylhsminor
.
yy158
=
yymsp
[
-
1
].
minor
.
yy158
;
yylhsminor
.
yy158
.
fsyncPeriod
=
strto
d
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
);
}
{
yylhsminor
.
yy158
=
yymsp
[
-
1
].
minor
.
yy158
;
yylhsminor
.
yy158
.
fsyncPeriod
=
strto
l
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy158
=
yylhsminor
.
yy158
;
break
;
case
94
:
/* db_optr ::= db_optr comp */
...
...
@@ -2273,7 +2277,7 @@ static void yy_reduce(
{
setDefaultCreateDbOption
(
&
yymsp
[
1
].
minor
.
yy158
);}
break
;
case
104
:
/* alter_db_optr ::= alter_db_optr fsync */
{
yylhsminor
.
yy158
=
yymsp
[
-
1
].
minor
.
yy158
;
yylhsminor
.
yy158
.
fsyncPeriod
=
strto
d
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
{
yylhsminor
.
yy158
=
yymsp
[
-
1
].
minor
.
yy158
;
yylhsminor
.
yy158
.
fsyncPeriod
=
strto
l
(
yymsp
[
0
].
minor
.
yy0
.
z
,
NULL
,
10
);
}
yymsp
[
-
1
].
minor
.
yy158
=
yylhsminor
.
yy158
;
break
;
case
105
:
/* typename ::= ids */
...
...
src/wal/src/walMain.c
浏览文件 @
ee14fa07
...
...
@@ -68,7 +68,10 @@ static void walRelease(SWal *pWal);
static
void
walModuleInitFunc
()
{
walTmrCtrl
=
taosTmrInit
(
1000
,
100
,
300000
,
"WAL"
);
if
(
walTmrCtrl
==
NULL
)
walModuleInit
=
PTHREAD_ONCE_INIT
;
if
(
walTmrCtrl
==
NULL
)
walModuleInit
=
PTHREAD_ONCE_INIT
;
else
wDebug
(
"WAL module is initialized"
);
}
void
*
walOpen
(
const
char
*
path
,
const
SWalCfg
*
pCfg
)
{
...
...
@@ -343,6 +346,7 @@ static void walRelease(SWal *pWal) {
if
(
walTmrCtrl
)
taosTmrCleanUp
(
walTmrCtrl
);
walTmrCtrl
=
NULL
;
walModuleInit
=
PTHREAD_ONCE_INIT
;
wDebug
(
"WAL module is cleaned up"
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录