Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d1d32be0
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
未验证
提交
d1d32be0
编写于
9月 02, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
9月 02, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #16614 from taosdata/fix/dnode
enh: let create database SST_TRIGGER 2 worker
上级
b809fd48
674014bf
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
26 addition
and
5 deletion
+26
-5
docs/en/12-taos-sql/10-function.md
docs/en/12-taos-sql/10-function.md
+2
-2
include/common/tmsg.h
include/common/tmsg.h
+1
-0
source/common/src/systable.c
source/common/src/systable.c
+1
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-0
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+4
-2
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+1
-0
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+10
-1
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+1
-0
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-0
source/dnode/vnode/src/vnd/vnodeCfg.c
source/dnode/vnode/src/vnd/vnodeCfg.c
+3
-0
未找到文件。
docs/en/12-taos-sql/10-function.md
浏览文件 @
d1d32be0
...
...
@@ -917,7 +917,7 @@ SELECT MAX(field_name) FROM { tb_name | stb_name } [WHERE clause];
**Return value type**:Same as the data type of the column being operated upon
**Applicable data types**: Numeric
**Applicable data types**: Numeric
, Timestamp
**Applicable table types**: standard tables and supertables
...
...
@@ -932,7 +932,7 @@ SELECT MIN(field_name) FROM {tb_name | stb_name} [WHERE clause];
**Return value type**:Same as the data type of the column being operated upon
**Applicable data types**: Numeric
**Applicable data types**: Numeric
, Timestamp
**Applicable table types**: standard tables and supertables
...
...
include/common/tmsg.h
浏览文件 @
d1d32be0
...
...
@@ -1192,6 +1192,7 @@ typedef struct {
int64_t
walRetentionSize
;
int32_t
walRollPeriod
;
int64_t
walSegmentSize
;
int16_t
sstTrigger
;
}
SCreateVnodeReq
;
int32_t
tSerializeSCreateVnodeReq
(
void
*
buf
,
int32_t
bufLen
,
SCreateVnodeReq
*
pReq
);
...
...
source/common/src/systable.c
浏览文件 @
d1d32be0
...
...
@@ -102,6 +102,7 @@ static const SSysDbTableSchema userDBSchema[] = {
{.
name
=
"wal_retention_size"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_BIGINT
,
.
sysInfo
=
true
},
{.
name
=
"wal_roll_period"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
,
.
sysInfo
=
true
},
{.
name
=
"wal_segment_size"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_BIGINT
,
.
sysInfo
=
true
},
{.
name
=
"sst_trigger"
,
.
bytes
=
2
,
.
type
=
TSDB_DATA_TYPE_SMALLINT
,
.
sysInfo
=
true
},
};
static
const
SSysDbTableSchema
userFuncSchema
[]
=
{
...
...
source/common/src/tmsg.c
浏览文件 @
d1d32be0
...
...
@@ -3766,6 +3766,7 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR
if
(
tEncodeI64
(
&
encoder
,
pReq
->
walRetentionSize
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
walRollPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
&
encoder
,
pReq
->
walSegmentSize
)
<
0
)
return
-
1
;
if
(
tEncodeI16
(
&
encoder
,
pReq
->
sstTrigger
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
...
...
@@ -3838,6 +3839,7 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *
if
(
tDecodeI64
(
&
decoder
,
&
pReq
->
walRetentionSize
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
walRollPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
pReq
->
walSegmentSize
)
<
0
)
return
-
1
;
if
(
tDecodeI16
(
&
decoder
,
&
pReq
->
sstTrigger
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tDecoderClear
(
&
decoder
);
...
...
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
d1d32be0
...
...
@@ -167,6 +167,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
pCfg
->
walCfg
.
segSize
=
pCreate
->
walSegmentSize
;
pCfg
->
walCfg
.
level
=
pCreate
->
walLevel
;
pCfg
->
sstTrigger
=
pCreate
->
sstTrigger
;
pCfg
->
hashBegin
=
pCreate
->
hashBegin
;
pCfg
->
hashEnd
=
pCreate
->
hashEnd
;
pCfg
->
hashMethod
=
pCreate
->
hashMethod
;
...
...
@@ -219,8 +220,9 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
-
1
;
}
dDebug
(
"vgId:%d, start to create vnode, tsma:%d standby:%d cacheLast:%d cacheLastSize:%d"
,
createReq
.
vgId
,
createReq
.
isTsma
,
createReq
.
standby
,
createReq
.
cacheLast
,
createReq
.
cacheLastSize
);
dDebug
(
"vgId:%d, start to create vnode, tsma:%d standby:%d cacheLast:%d cacheLastSize:%d sstTrigger:%d"
,
createReq
.
vgId
,
createReq
.
isTsma
,
createReq
.
standby
,
createReq
.
cacheLast
,
createReq
.
cacheLastSize
,
createReq
.
sstTrigger
);
vmGenerateVnodeCfg
(
&
createReq
,
&
vnodeCfg
);
if
(
vmTsmaAdjustDays
(
&
vnodeCfg
,
&
createReq
)
<
0
)
{
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
d1d32be0
...
...
@@ -311,6 +311,7 @@ typedef struct {
int64_t
walRetentionSize
;
int32_t
walRollPeriod
;
int64_t
walSegmentSize
;
int16_t
sstTrigger
;
}
SDbCfg
;
typedef
struct
{
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
d1d32be0
...
...
@@ -30,7 +30,7 @@
#include "systable.h"
#define DB_VER_NUMBER 1
#define DB_RESERVE_SIZE 6
4
#define DB_RESERVE_SIZE 6
2
static
SSdbRaw
*
mndDbActionEncode
(
SDbObj
*
pDb
);
static
SSdbRow
*
mndDbActionDecode
(
SSdbRaw
*
pRaw
);
...
...
@@ -124,6 +124,7 @@ static SSdbRaw *mndDbActionEncode(SDbObj *pDb) {
SDB_SET_INT64
(
pRaw
,
dataPos
,
pDb
->
cfg
.
walRetentionSize
,
_OVER
)
SDB_SET_INT32
(
pRaw
,
dataPos
,
pDb
->
cfg
.
walRollPeriod
,
_OVER
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pDb
->
cfg
.
walSegmentSize
,
_OVER
)
SDB_SET_INT16
(
pRaw
,
dataPos
,
pDb
->
cfg
.
sstTrigger
,
_OVER
)
SDB_SET_RESERVE
(
pRaw
,
dataPos
,
DB_RESERVE_SIZE
,
_OVER
)
SDB_SET_DATALEN
(
pRaw
,
dataPos
,
_OVER
)
...
...
@@ -207,6 +208,7 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw) {
SDB_GET_INT64
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
walRetentionSize
,
_OVER
)
SDB_GET_INT32
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
walRollPeriod
,
_OVER
)
SDB_GET_INT64
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
walSegmentSize
,
_OVER
)
SDB_GET_INT16
(
pRaw
,
dataPos
,
&
pDb
->
cfg
.
sstTrigger
,
_OVER
)
SDB_GET_RESERVE
(
pRaw
,
dataPos
,
DB_RESERVE_SIZE
,
_OVER
)
taosInitRWLatch
(
&
pDb
->
lock
);
...
...
@@ -254,6 +256,7 @@ static int32_t mndDbActionUpdate(SSdb *pSdb, SDbObj *pOld, SDbObj *pNew) {
pOld
->
cfg
.
strict
=
pNew
->
cfg
.
strict
;
pOld
->
cfg
.
cacheLast
=
pNew
->
cfg
.
cacheLast
;
pOld
->
cfg
.
replications
=
pNew
->
cfg
.
replications
;
pOld
->
cfg
.
sstTrigger
=
pNew
->
cfg
.
sstTrigger
;
taosWUnLockLatch
(
&
pOld
->
lock
);
return
0
;
}
...
...
@@ -330,6 +333,7 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) {
if
(
pCfg
->
walRetentionSize
<
TSDB_DB_MIN_WAL_RETENTION_SIZE
)
return
-
1
;
if
(
pCfg
->
walRollPeriod
<
TSDB_DB_MIN_WAL_ROLL_PERIOD
)
return
-
1
;
if
(
pCfg
->
walSegmentSize
<
TSDB_DB_MIN_WAL_SEGMENT_SIZE
)
return
-
1
;
if
(
pCfg
->
sstTrigger
<
TSDB_MIN_SST_TRIGGER
||
pCfg
->
sstTrigger
>
TSDB_MAX_SST_TRIGGER
)
return
-
1
;
terrno
=
0
;
return
terrno
;
...
...
@@ -363,6 +367,7 @@ static void mndSetDefaultDbCfg(SDbCfg *pCfg) {
pCfg
->
walRetentionSize
=
TSDB_REPS_DEF_DB_WAL_RET_SIZE
;
if
(
pCfg
->
walRollPeriod
<
0
)
pCfg
->
walRollPeriod
=
TSDB_REPS_DEF_DB_WAL_ROLL_PERIOD
;
if
(
pCfg
->
walSegmentSize
<
0
)
pCfg
->
walSegmentSize
=
TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE
;
if
(
pCfg
->
sstTrigger
<=
0
)
pCfg
->
sstTrigger
=
TSDB_DEFAULT_SST_TRIGGER
;
}
static
int32_t
mndSetCreateDbRedoLogs
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroups
)
{
...
...
@@ -479,6 +484,7 @@ static int32_t mndCreateDb(SMnode *pMnode, SRpcMsg *pReq, SCreateDbReq *pCreate,
.
walRetentionSize
=
pCreate
->
walRetentionSize
,
.
walRollPeriod
=
pCreate
->
walRollPeriod
,
.
walSegmentSize
=
pCreate
->
walSegmentSize
,
.
sstTrigger
=
pCreate
->
sstTrigger
,
};
dbObj
.
cfg
.
numOfRetensions
=
pCreate
->
numOfRetensions
;
...
...
@@ -1682,6 +1688,9 @@ static void mndDumpDbInfoData(SMnode *pMnode, SSDataBlock *pBlock, SDbObj *pDb,
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
walSegmentSize
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
sstTrigger
,
false
);
}
taosMemoryFree
(
buf
);
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
d1d32be0
...
...
@@ -234,6 +234,7 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg
createReq
.
walRetentionSize
=
pDb
->
cfg
.
walRetentionSize
;
createReq
.
walRollPeriod
=
pDb
->
cfg
.
walRollPeriod
;
createReq
.
walSegmentSize
=
pDb
->
cfg
.
walSegmentSize
;
createReq
.
sstTrigger
=
pDb
->
cfg
.
sstTrigger
;
for
(
int32_t
v
=
0
;
v
<
pVgroup
->
replica
;
++
v
)
{
SReplica
*
pReplica
=
&
createReq
.
replicas
[
v
];
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
d1d32be0
...
...
@@ -287,6 +287,7 @@ struct SVnodeCfg {
SVnodeStats
vndStats
;
uint32_t
hashBegin
;
uint32_t
hashEnd
;
int16_t
sstTrigger
;
};
typedef
struct
{
...
...
source/dnode/vnode/src/vnd/vnodeCfg.c
浏览文件 @
d1d32be0
...
...
@@ -106,6 +106,7 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) {
if
(
tjsonAddIntegerToObject
(
pJson
,
"wal.retentionSize"
,
pCfg
->
walCfg
.
retentionSize
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"wal.segSize"
,
pCfg
->
walCfg
.
segSize
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"wal.level"
,
pCfg
->
walCfg
.
level
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"sstTrigger"
,
pCfg
->
sstTrigger
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"hashBegin"
,
pCfg
->
hashBegin
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"hashEnd"
,
pCfg
->
hashEnd
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"hashMethod"
,
pCfg
->
hashMethod
)
<
0
)
return
-
1
;
...
...
@@ -205,6 +206,8 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"wal.level"
,
pCfg
->
walCfg
.
level
,
code
);
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"sstTrigger"
,
pCfg
->
sstTrigger
,
code
);
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"hashBegin"
,
pCfg
->
hashBegin
,
code
);
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"hashEnd"
,
pCfg
->
hashEnd
,
code
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录