Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
哥们要飞
TDengine
提交
aac2d1c4
T
TDengine
项目概览
哥们要飞
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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,发现更多精彩内容 >>
未验证
提交
aac2d1c4
编写于
5月 22, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
5月 22, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1992 from taosdata/hotfix/boundary
Hotfix/boundary
上级
bf4c6d0e
5e899afb
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
1709 addition
and
109 deletion
+1709
-109
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+10
-8
src/client/src/tscStream.c
src/client/src/tscStream.c
+8
-8
src/common/src/tglobal.c
src/common/src/tglobal.c
+0
-1
src/dnode/src/dnodeModule.c
src/dnode/src/dnodeModule.c
+14
-12
src/inc/taosdef.h
src/inc/taosdef.h
+8
-7
src/inc/taoserror.h
src/inc/taoserror.h
+1
-0
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+6
-4
src/mnode/inc/mgmtMnode.h
src/mnode/inc/mgmtMnode.h
+1
-1
src/mnode/inc/mgmtVgroup.h
src/mnode/inc/mgmtVgroup.h
+1
-0
src/mnode/src/mgmtAcct.c
src/mnode/src/mgmtAcct.c
+1
-1
src/mnode/src/mgmtDb.c
src/mnode/src/mgmtDb.c
+2
-1
src/mnode/src/mgmtDnode.c
src/mnode/src/mgmtDnode.c
+1
-1
src/mnode/src/mgmtMnode.c
src/mnode/src/mgmtMnode.c
+64
-25
src/mnode/src/mgmtSdb.c
src/mnode/src/mgmtSdb.c
+4
-2
src/mnode/src/mgmtShell.c
src/mnode/src/mgmtShell.c
+1
-1
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+3
-3
src/mnode/src/mgmtUser.c
src/mnode/src/mgmtUser.c
+1
-1
src/mnode/src/mgmtVgroup.c
src/mnode/src/mgmtVgroup.c
+39
-12
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-2
src/tsdb/src/tsdbCache.c
src/tsdb/src/tsdbCache.c
+1
-0
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+25
-5
src/tsdb/src/tsdbMeta.c
src/tsdb/src/tsdbMeta.c
+3
-2
src/tsdb/src/tsdbRWHelper.c
src/tsdb/src/tsdbRWHelper.c
+2
-1
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+10
-1
tests/script/general/db/alter_tables_d2.sim
tests/script/general/db/alter_tables_d2.sim
+468
-0
tests/script/general/db/alter_tables_v1.sim
tests/script/general/db/alter_tables_v1.sim
+352
-0
tests/script/general/db/alter_tables_v4.sim
tests/script/general/db/alter_tables_v4.sim
+457
-0
tests/script/general/db/alter_vgroups.sim
tests/script/general/db/alter_vgroups.sim
+210
-0
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+13
-9
未找到文件。
src/client/src/tscLocal.c
浏览文件 @
aac2d1c4
...
...
@@ -56,7 +56,7 @@ static int32_t getToStringLength(const char *pData, int32_t length, int32_t type
}
break
;
case
TSDB_DATA_TYPE_TIMESTAMP
:
case
TSDB_DATA_TYPE_BIGINT
:
len
=
sprintf
(
buf
,
"%"
PRId64
""
,
*
(
int64_t
*
)
pData
);
len
=
sprintf
(
buf
,
"%"
PRId64
,
*
(
int64_t
*
)
pData
);
break
;
case
TSDB_DATA_TYPE_BOOL
:
len
=
MAX_BOOL_TYPE_LENGTH
;
...
...
src/client/src/tscSQLParser.c
浏览文件 @
aac2d1c4
...
...
@@ -4540,11 +4540,13 @@ int32_t validateDNodeConfig(tDCLSQL* pOptions) {
return
TSDB_CODE_INVALID_SQL
;
}
const
SDNodeDynConfOption
DNODE_DYNAMIC_CFG_OPTIONS
[
14
]
=
{
{
"resetLog"
,
8
},
{
"resetQueryCache"
,
15
},
{
"dDebugFlag"
,
10
},
{
"rpcDebugFlag"
,
12
},
{
"tmrDebugFlag"
,
12
},
{
"cDebugFlag"
,
10
},
{
"uDebugFlag"
,
10
},
{
"mDebugFlag"
,
10
},
{
"sdbDebugFlag"
,
12
},
{
"httpDebugFlag"
,
13
},
{
"monitorDebugFlag"
,
16
},
{
"qDebugflag"
,
10
},
{
"debugFlag"
,
9
},
{
"monitor"
,
7
}};
const
int
DNODE_DYNAMIC_CFG_OPTIONS_SIZE
=
17
;
const
SDNodeDynConfOption
DNODE_DYNAMIC_CFG_OPTIONS
[]
=
{
{
"resetLog"
,
8
},
{
"resetQueryCache"
,
15
},
{
"debugFlag"
,
9
},
{
"mDebugFlag"
,
10
},
{
"dDebugFlag"
,
10
},
{
"sdbDebugFlag"
,
12
},
{
"vDebugFlag"
,
10
},
{
"cDebugFlag"
,
10
},
{
"httpDebugFlag"
,
13
},
{
"monitorDebugFlag"
,
16
},
{
"rpcDebugFlag"
,
12
},
{
"uDebugFlag"
,
10
},
{
"tmrDebugFlag"
,
12
},
{
"qDebugflag"
,
10
},
{
"sDebugflag"
,
10
},
{
"tsdbDebugFlag"
,
13
},
{
"monitor"
,
7
}};
SSQLToken
*
pOptionToken
=
&
pOptions
->
a
[
1
];
...
...
@@ -4556,8 +4558,8 @@ int32_t validateDNodeConfig(tDCLSQL* pOptions) {
return
TSDB_CODE_SUCCESS
;
}
}
}
else
if
((
strncasecmp
(
DNODE_DYNAMIC_CFG_OPTIONS
[
13
].
name
,
pOptionToken
->
z
,
pOptionToken
->
n
)
==
0
)
&&
(
DNODE_DYNAMIC_CFG_OPTIONS
[
13
].
len
==
pOptionToken
->
n
))
{
}
else
if
((
strncasecmp
(
DNODE_DYNAMIC_CFG_OPTIONS
[
DNODE_DYNAMIC_CFG_OPTIONS_SIZE
-
1
].
name
,
pOptionToken
->
z
,
pOptionToken
->
n
)
==
0
)
&&
(
DNODE_DYNAMIC_CFG_OPTIONS
[
DNODE_DYNAMIC_CFG_OPTIONS_SIZE
-
1
].
len
==
pOptionToken
->
n
))
{
SSQLToken
*
pValToken
=
&
pOptions
->
a
[
2
];
int32_t
val
=
strtol
(
pValToken
->
z
,
NULL
,
10
);
if
(
val
!=
0
&&
val
!=
1
)
{
...
...
@@ -4573,7 +4575,7 @@ int32_t validateDNodeConfig(tDCLSQL* pOptions) {
return
TSDB_CODE_INVALID_SQL
;
}
for
(
int32_t
i
=
2
;
i
<
tListLen
(
DNODE_DYNAMIC_CFG_OPTIONS
)
-
1
;
++
i
)
{
for
(
int32_t
i
=
2
;
i
<
DNODE_DYNAMIC_CFG_OPTIONS_SIZE
-
1
;
++
i
)
{
const
SDNodeDynConfOption
*
pOption
=
&
DNODE_DYNAMIC_CFG_OPTIONS
[
i
];
if
((
strncasecmp
(
pOption
->
name
,
pOptionToken
->
z
,
pOptionToken
->
n
)
==
0
)
&&
(
pOption
->
len
==
pOptionToken
->
n
))
{
...
...
src/client/src/tscStream.c
浏览文件 @
aac2d1c4
...
...
@@ -165,7 +165,7 @@ static void tscSetTimestampForRes(SSqlStream *pStream, SSqlObj *pSql) {
if
(
timestamp
!=
actualTimestamp
)
{
// reset the timestamp of each agg point by using start time of each interval
*
((
int64_t
*
)
pRes
->
data
)
=
actualTimestamp
;
tscWarn
(
"%p stream:%p, timestamp of points is:%"
PRId64
", reset to %"
PRId64
""
,
pSql
,
pStream
,
timestamp
,
actualTimestamp
);
tscWarn
(
"%p stream:%p, timestamp of points is:%"
PRId64
", reset to %"
PRId64
,
pSql
,
pStream
,
timestamp
,
actualTimestamp
);
}
}
...
...
@@ -287,10 +287,10 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer)
return
;
}
tscTrace
(
"%p stream:%p, next start at %"
PRId64
", in %"
PRId64
"ms. delay:%"
PRId64
"ms qrange %"
PRId64
"-%"
PRId64
""
,
pStream
->
pSql
,
pStream
,
tscTrace
(
"%p stream:%p, next start at %"
PRId64
", in %"
PRId64
"ms. delay:%"
PRId64
"ms qrange %"
PRId64
"-%"
PRId64
,
pStream
->
pSql
,
pStream
,
now
+
timer
,
timer
,
delay
,
pStream
->
stime
,
etime
);
}
else
{
tscTrace
(
"%p stream:%p, next start at %"
PRId64
", in %"
PRId64
"ms. delay:%"
PRId64
"ms qrange %"
PRId64
"-%"
PRId64
""
,
pStream
->
pSql
,
pStream
,
tscTrace
(
"%p stream:%p, next start at %"
PRId64
", in %"
PRId64
"ms. delay:%"
PRId64
"ms qrange %"
PRId64
"-%"
PRId64
,
pStream
->
pSql
,
pStream
,
pStream
->
stime
,
timer
,
delay
,
pStream
->
stime
-
pStream
->
interval
,
pStream
->
stime
-
1
);
}
...
...
@@ -380,7 +380,7 @@ static void tscSetSlidingWindowInfo(SSqlObj *pSql, SSqlStream *pStream) {
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
&
pSql
->
cmd
,
0
);
if
(
pQueryInfo
->
intervalTime
<
minIntervalTime
)
{
tscWarn
(
"%p stream:%p, original sample interval:%ld too small, reset to:%"
PRId64
""
,
pSql
,
pStream
,
tscWarn
(
"%p stream:%p, original sample interval:%ld too small, reset to:%"
PRId64
,
pSql
,
pStream
,
pQueryInfo
->
intervalTime
,
minIntervalTime
);
pQueryInfo
->
intervalTime
=
minIntervalTime
;
}
...
...
@@ -397,14 +397,14 @@ static void tscSetSlidingWindowInfo(SSqlObj *pSql, SSqlStream *pStream) {
if
(
pQueryInfo
->
slidingTime
==
-
1
)
{
pQueryInfo
->
slidingTime
=
pQueryInfo
->
intervalTime
;
}
else
if
(
pQueryInfo
->
slidingTime
<
minSlidingTime
)
{
tscWarn
(
"%p stream:%p, original sliding value:%"
PRId64
" too small, reset to:%"
PRId64
""
,
pSql
,
pStream
,
tscWarn
(
"%p stream:%p, original sliding value:%"
PRId64
" too small, reset to:%"
PRId64
,
pSql
,
pStream
,
pQueryInfo
->
slidingTime
,
minSlidingTime
);
pQueryInfo
->
slidingTime
=
minSlidingTime
;
}
if
(
pQueryInfo
->
slidingTime
>
pQueryInfo
->
intervalTime
)
{
tscWarn
(
"%p stream:%p, sliding value:%"
PRId64
" can not be larger than interval range, reset to:%"
PRId64
""
,
pSql
,
pStream
,
tscWarn
(
"%p stream:%p, sliding value:%"
PRId64
" can not be larger than interval range, reset to:%"
PRId64
,
pSql
,
pStream
,
pQueryInfo
->
slidingTime
,
pQueryInfo
->
intervalTime
);
pQueryInfo
->
slidingTime
=
pQueryInfo
->
intervalTime
;
...
...
@@ -433,11 +433,11 @@ static int64_t tscGetStreamStartTimestamp(SSqlObj *pSql, SSqlStream *pStream, in
}
else
{
// timewindow based aggregation stream
if
(
stime
==
0
)
{
// no data in meter till now
stime
=
((
int64_t
)
taosGetTimestamp
(
pStream
->
precision
)
/
pStream
->
interval
)
*
pStream
->
interval
;
tscWarn
(
"%p stream:%p, last timestamp:0, reset to:%"
PRId64
""
,
pSql
,
pStream
,
stime
);
tscWarn
(
"%p stream:%p, last timestamp:0, reset to:%"
PRId64
,
pSql
,
pStream
,
stime
);
}
else
{
int64_t
newStime
=
(
stime
/
pStream
->
interval
)
*
pStream
->
interval
;
if
(
newStime
!=
stime
)
{
tscWarn
(
"%p stream:%p, last timestamp:%"
PRId64
", reset to:%"
PRId64
""
,
pSql
,
pStream
,
stime
,
newStime
);
tscWarn
(
"%p stream:%p, last timestamp:%"
PRId64
", reset to:%"
PRId64
,
pSql
,
pStream
,
stime
,
newStime
);
stime
=
newStime
;
}
}
...
...
src/common/src/tglobal.c
浏览文件 @
aac2d1c4
...
...
@@ -107,7 +107,6 @@ int32_t tsReplications = TSDB_DEFAULT_REPLICA_NUM;
int16_t
tsAffectedRowsMod
=
0
;
int32_t
tsNumOfMPeers
=
3
;
int32_t
tsMaxShellConns
=
2000
;
int32_t
tsMaxTables
=
100000
;
char
tsDefaultDB
[
TSDB_DB_NAME_LEN
]
=
{
0
};
char
tsDefaultUser
[
64
]
=
"root"
;
...
...
src/dnode/src/dnodeModule.c
浏览文件 @
aac2d1c4
...
...
@@ -114,18 +114,20 @@ void dnodeStartModules() {
}
void
dnodeProcessModuleStatus
(
uint32_t
moduleStatus
)
{
bool
enableMgmtModule
=
moduleStatus
&
(
1
<<
TSDB_MOD_MGMT
);
if
(
!
tsModule
[
TSDB_MOD_MGMT
].
enable
&&
enableMgmtModule
)
{
dPrint
(
"module status is received, start mgmt module"
,
tsModuleStatus
,
moduleStatus
);
tsModule
[
TSDB_MOD_MGMT
].
enable
=
true
;
dnodeSetModuleStatus
(
TSDB_MOD_MGMT
);
(
*
tsModule
[
TSDB_MOD_MGMT
].
startFp
)();
}
for
(
int32_t
module
=
TSDB_MOD_MGMT
;
module
<
TSDB_MOD_HTTP
;
++
module
)
{
bool
enableModule
=
moduleStatus
&
(
1
<<
module
);
if
(
!
tsModule
[
module
].
enable
&&
enableModule
)
{
dPrint
(
"module status:%u is received, start %s module"
,
tsModuleStatus
,
tsModule
[
module
].
name
);
tsModule
[
module
].
enable
=
true
;
dnodeSetModuleStatus
(
module
);
(
*
tsModule
[
module
].
startFp
)();
}
if
(
tsModule
[
TSDB_MOD_MGMT
].
enable
&&
!
enableMgmtModule
)
{
dPrint
(
"module status is received, stop mgmt module"
,
tsModuleStatus
,
moduleStatus
);
tsModule
[
TSDB_MOD_MGMT
].
enable
=
false
;
dnodeUnSetModuleStatus
(
TSDB_MOD_MGMT
);
(
*
tsModule
[
TSDB_MOD_MGMT
].
stopFp
)();
if
(
tsModule
[
module
].
enable
&&
!
enableModule
)
{
dPrint
(
"module status:%u is received, stop %s module"
,
tsModuleStatus
,
tsModule
[
module
].
name
);
tsModule
[
module
].
enable
=
false
;
dnodeUnSetModuleStatus
(
module
);
(
*
tsModule
[
module
].
stopFp
)();
}
}
}
src/inc/taosdef.h
浏览文件 @
aac2d1c4
...
...
@@ -340,13 +340,14 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
#define TSDB_SESSIONS_PER_VNODE (300)
#define TSDB_SESSIONS_PER_DNODE (TSDB_SESSIONS_PER_VNODE * TSDB_MAX_VNODES)
#define TSDB_MAX_MNODES 5
#define TSDB_MAX_DNODES 10
#define TSDB_MAX_ACCOUNTS 10
#define TSDB_MAX_USERS 20
#define TSDB_MAX_DBS 100
#define TSDB_MAX_VGROUPS 1000
#define TSDB_MAX_SUPER_TABLES 100
#define TSDB_DEFAULT_MNODES_HASH_SIZE 5
#define TSDB_DEFAULT_DNODES_HASH_SIZE 10
#define TSDB_DEFAULT_ACCOUNTS_HASH_SIZE 10
#define TSDB_DEFAULT_USERS_HASH_SIZE 20
#define TSDB_DEFAULT_DBS_HASH_SIZE 100
#define TSDB_DEFAULT_VGROUPS_HASH_SIZE 100
#define TSDB_DEFAULT_STABLES_HASH_SIZE 100
#define TSDB_DEFAULT_CTABLES_HASH_SIZE 10000
#define TSDB_PORT_DNODESHELL 0
#define TSDB_PORT_DNODEDNODE 5
...
...
src/inc/taoserror.h
浏览文件 @
aac2d1c4
...
...
@@ -156,6 +156,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_SERV_OUT_OF_MEMORY, 0, 405, "server out of m
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_DISK_PERMISSIONS
,
0
,
406
,
"no disk permissions"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_FILE_CORRUPTED
,
0
,
407
,
"file corrupted"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MEMORY_CORRUPTED
,
0
,
408
,
"memory corrupted"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_SUCH_FILE_OR_DIR
,
0
,
409
,
"no such file or directory"
)
// client
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_CLIENT_VERSION
,
0
,
451
,
"invalid client version"
)
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
aac2d1c4
...
...
@@ -37,6 +37,8 @@
#define COMMAND_SIZE 65536
#define DEFAULT_DUMP_FILE "taosdump.sql"
#define MAX_DBS 100
int
converStringToReadable
(
char
*
str
,
int
size
,
char
*
buf
,
int
bufsize
);
int
convertNCharToReadable
(
char
*
str
,
int
size
,
char
*
buf
,
int
bufsize
);
void
taosDumpCharset
(
FILE
*
fp
);
...
...
@@ -359,7 +361,7 @@ int main(int argc, char *argv[]) {
void
taosFreeDbInfos
()
{
if
(
dbInfos
==
NULL
)
return
;
for
(
int
i
=
0
;
i
<
TSDB_
MAX_DBS
;
i
++
)
tfree
(
dbInfos
[
i
]);
for
(
int
i
=
0
;
i
<
MAX_DBS
;
i
++
)
tfree
(
dbInfos
[
i
]);
tfree
(
dbInfos
);
}
...
...
@@ -437,7 +439,7 @@ int taosDumpOut(SDumpArguments *arguments) {
return
-
1
;
}
dbInfos
=
(
SDbInfo
**
)
calloc
(
TSDB_
MAX_DBS
,
sizeof
(
SDbInfo
*
));
dbInfos
=
(
SDbInfo
**
)
calloc
(
MAX_DBS
,
sizeof
(
SDbInfo
*
));
if
(
dbInfos
==
NULL
)
{
fprintf
(
stderr
,
"failed to allocate memory
\n
"
);
goto
_exit_failure
;
...
...
@@ -941,7 +943,7 @@ int taosDumpTableData(FILE *fp, char *tbname, SDumpArguments *arguments) {
pstr
+=
sprintf
(
pstr
,
"%d"
,
*
((
int
*
)
row
[
col
]));
break
;
case
TSDB_DATA_TYPE_BIGINT
:
pstr
+=
sprintf
(
pstr
,
"%"
PRId64
""
,
*
((
int64_t
*
)
row
[
col
]));
pstr
+=
sprintf
(
pstr
,
"%"
PRId64
,
*
((
int64_t
*
)
row
[
col
]));
break
;
case
TSDB_DATA_TYPE_FLOAT
:
pstr
+=
sprintf
(
pstr
,
"%f"
,
GET_FLOAT_VAL
(
row
[
col
]));
...
...
@@ -960,7 +962,7 @@ int taosDumpTableData(FILE *fp, char *tbname, SDumpArguments *arguments) {
pstr
+=
sprintf
(
pstr
,
"
\'
%s
\'
"
,
tbuf
);
break
;
case
TSDB_DATA_TYPE_TIMESTAMP
:
pstr
+=
sprintf
(
pstr
,
"%"
PRId64
""
,
*
(
int64_t
*
)
row
[
col
]);
pstr
+=
sprintf
(
pstr
,
"%"
PRId64
,
*
(
int64_t
*
)
row
[
col
]);
break
;
default:
break
;
...
...
src/mnode/inc/mgmtMnode.h
浏览文件 @
aac2d1c4
...
...
@@ -44,7 +44,7 @@ void mgmtDecMnodeRef(struct SMnodeObj *pMnode);
char
*
mgmtGetMnodeRoleStr
();
void
mgmtGetMnodeIpSet
(
SRpcIpSet
*
ipSet
);
void
mgmtGetMnodeInfos
(
void
*
mnodes
);
void
mgmtUpdateMnodeIpSet
();
#ifdef __cplusplus
}
...
...
src/mnode/inc/mgmtVgroup.h
浏览文件 @
aac2d1c4
...
...
@@ -29,6 +29,7 @@ void mgmtIncVgroupRef(SVgObj *pVgroup);
void
mgmtDecVgroupRef
(
SVgObj
*
pVgroup
);
void
mgmtDropAllDbVgroups
(
SDbObj
*
pDropDb
,
bool
sendMsg
);
void
mgmtDropAllDnodeVgroups
(
SDnodeObj
*
pDropDnode
);
void
mgmtUpdateAllDbVgroups
(
SDbObj
*
pAlterDb
);
void
*
mgmtGetNextVgroup
(
void
*
pIter
,
SVgObj
**
pVgroup
);
void
mgmtUpdateVgroup
(
SVgObj
*
pVgroup
);
...
...
src/mnode/src/mgmtAcct.c
浏览文件 @
aac2d1c4
...
...
@@ -94,7 +94,7 @@ int32_t mgmtInitAccts() {
SSdbTableDesc
tableDesc
=
{
.
tableId
=
SDB_TABLE_ACCOUNT
,
.
tableName
=
"accounts"
,
.
hashSessions
=
TSDB_
MAX_ACCOUNTS
,
.
hashSessions
=
TSDB_
DEFAULT_ACCOUNTS_HASH_SIZE
,
.
maxRowSize
=
tsAcctUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_STRING
,
...
...
src/mnode/src/mgmtDb.c
浏览文件 @
aac2d1c4
...
...
@@ -96,6 +96,7 @@ static int32_t mgmtDbActionUpdate(SSdbOper *pOper) {
memcpy
(
pSaved
,
pDb
,
pOper
->
rowSize
);
free
(
pDb
);
}
mgmtUpdateAllDbVgroups
(
pSaved
);
mgmtDecDbRef
(
pSaved
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -127,7 +128,7 @@ int32_t mgmtInitDbs() {
SSdbTableDesc
tableDesc
=
{
.
tableId
=
SDB_TABLE_DB
,
.
tableName
=
"dbs"
,
.
hashSessions
=
TSDB_
MAX_DBS
,
.
hashSessions
=
TSDB_
DEFAULT_DBS_HASH_SIZE
,
.
maxRowSize
=
tsDbUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_STRING
,
...
...
src/mnode/src/mgmtDnode.c
浏览文件 @
aac2d1c4
...
...
@@ -130,7 +130,7 @@ int32_t mgmtInitDnodes() {
SSdbTableDesc
tableDesc
=
{
.
tableId
=
SDB_TABLE_DNODE
,
.
tableName
=
"dnodes"
,
.
hashSessions
=
TSDB_
MAX_DNODES
,
.
hashSessions
=
TSDB_
DEFAULT_DNODES_HASH_SIZE
,
.
maxRowSize
=
tsDnodeUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_AUTO
,
...
...
src/mnode/src/mgmtMnode.c
浏览文件 @
aac2d1c4
...
...
@@ -36,6 +36,25 @@ static int32_t tsMnodeUpdateSize = 0;
static
int32_t
mgmtGetMnodeMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mgmtRetrieveMnodes
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
SRpcIpSet
tsMnodeRpcIpSet
;
static
SDMMnodeInfos
tsMnodeInfos
;
#if defined(LINUX)
static
pthread_rwlock_t
tsMnodeLock
;
#define mgmtMnodeWrLock() pthread_rwlock_wrlock(&tsMnodeLock)
#define mgmtMnodeRdLock() pthread_rwlock_rdlock(&tsMnodeLock)
#define mgmtMnodeUnLock() pthread_rwlock_unlock(&tsMnodeLock)
#define mgmtMnodeInitLock() pthread_rwlock_init(&tsMnodeLock, NULL)
#define mgmtMnodeDestroyLock() pthread_rwlock_destroy(&tsMnodeLock)
#else
static
pthread_mutex_t
tsMnodeLock
;
#define mgmtMnodeWrLock() pthread_mutex_lock(&tsMnodeLock)
#define mgmtMnodeRdLock() pthread_mutex_lock(&tsMnodeLock)
#define mgmtMnodeUnLock() pthread_mutex_unlock(&tsMnodeLock)
#define mgmtMnodeInitLock() pthread_mutex_init(&tsMnodeLock, NULL)
#define mgmtMnodeDestroyLock() pthread_mutex_destroy(&tsMnodeLock)
#endif
static
int32_t
mgmtMnodeActionDestroy
(
SSdbOper
*
pOper
)
{
tfree
(
pOper
->
pObj
);
return
TSDB_CODE_SUCCESS
;
...
...
@@ -102,17 +121,22 @@ static int32_t mgmtMnodeActionRestored() {
}
sdbFreeIter
(
pIter
);
}
mgmtUpdateMnodeIpSet
();
return
TSDB_CODE_SUCCESS
;
}
int32_t
mgmtInitMnodes
()
{
mgmtMnodeInitLock
();
SMnodeObj
tObj
;
tsMnodeUpdateSize
=
(
int8_t
*
)
tObj
.
updateEnd
-
(
int8_t
*
)
&
tObj
;
SSdbTableDesc
tableDesc
=
{
.
tableId
=
SDB_TABLE_MNODE
,
.
tableName
=
"mnodes"
,
.
hashSessions
=
TSDB_
MAX_MNODES
,
.
hashSessions
=
TSDB_
DEFAULT_MNODES_HASH_SIZE
,
.
maxRowSize
=
tsMnodeUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_INT
,
...
...
@@ -140,6 +164,7 @@ int32_t mgmtInitMnodes() {
void
mgmtCleanupMnodes
()
{
sdbCloseTable
(
tsMnodeSdb
);
mgmtMnodeDestroyLock
();
}
int32_t
mgmtGetMnodesNum
()
{
...
...
@@ -177,50 +202,57 @@ char *mgmtGetMnodeRoleStr(int32_t role) {
}
}
void
mgmtGetMnodeIpSet
(
SRpcIpSet
*
ipSet
)
{
void
*
pIter
=
NULL
;
while
(
1
)
{
SMnodeObj
*
pMnode
=
NULL
;
pIter
=
mgmtGetNextMnode
(
pIter
,
&
pMnode
);
if
(
pMnode
==
NULL
)
break
;
strcpy
(
ipSet
->
fqdn
[
ipSet
->
numOfIps
],
pMnode
->
pDnode
->
dnodeFqdn
);
ipSet
->
port
[
ipSet
->
numOfIps
]
=
htons
(
pMnode
->
pDnode
->
dnodePort
);
void
mgmtUpdateMnodeIpSet
()
{
SRpcIpSet
*
ipSet
=
&
tsMnodeRpcIpSet
;
SDMMnodeInfos
*
mnodes
=
&
tsMnodeInfos
;
if
(
pMnode
->
role
==
TAOS_SYNC_ROLE_MASTER
)
{
ipSet
->
inUse
=
ipSet
->
numOfIps
;
}
mPrint
(
"update mnodes ipset, numOfIps:%d "
,
mgmtGetMnodesNum
());
ipSet
->
numOfIps
++
;
mgmtDecMnodeRef
(
pMnode
);
}
sdbFreeIter
(
pIter
);
}
mgmtMnodeWrLock
();
void
mgmtGetMnodeInfos
(
void
*
param
)
{
SDMMnodeInfos
*
mnodes
=
param
;
mnodes
->
inUse
=
0
;
int32_t
index
=
0
;
void
*
pIter
=
NULL
;
void
*
pIter
=
NULL
;
while
(
1
)
{
SMnodeObj
*
pMnode
=
NULL
;
pIter
=
mgmtGetNextMnode
(
pIter
,
&
pMnode
);
if
(
pMnode
==
NULL
)
break
;
strcpy
(
ipSet
->
fqdn
[
ipSet
->
numOfIps
],
pMnode
->
pDnode
->
dnodeFqdn
);
ipSet
->
port
[
ipSet
->
numOfIps
]
=
htons
(
pMnode
->
pDnode
->
dnodePort
);
mnodes
->
nodeInfos
[
index
].
nodeId
=
htonl
(
pMnode
->
mnodeId
);
strcpy
(
mnodes
->
nodeInfos
[
index
].
nodeEp
,
pMnode
->
pDnode
->
dnodeEp
);
if
(
pMnode
->
role
==
TAOS_SYNC_ROLE_MASTER
)
{
ipSet
->
inUse
=
ipSet
->
numOfIps
;
mnodes
->
inUse
=
index
;
}
mPrint
(
"mnode:%d, ep:%s %s"
,
index
,
pMnode
->
pDnode
->
dnodeEp
,
pMnode
->
role
==
TAOS_SYNC_ROLE_MASTER
?
"master"
:
""
);
ipSet
->
numOfIps
++
;
index
++
;
mgmtDecMnodeRef
(
pMnode
);
}
sdbFreeIter
(
pIter
);
mnodes
->
nodeNum
=
index
;
sdbFreeIter
(
pIter
);
mgmtMnodeUnLock
();
}
void
mgmtGetMnodeIpSet
(
SRpcIpSet
*
ipSet
)
{
mgmtMnodeRdLock
();
*
ipSet
=
tsMnodeRpcIpSet
;
mgmtMnodeUnLock
();
}
void
mgmtGetMnodeInfos
(
void
*
mnodeInfos
)
{
mgmtMnodeRdLock
();
*
(
SDMMnodeInfos
*
)
mnodeInfos
=
tsMnodeInfos
;
mgmtMnodeUnLock
();
}
int32_t
mgmtAddMnode
(
int32_t
dnodeId
)
{
...
...
@@ -240,6 +272,8 @@ int32_t mgmtAddMnode(int32_t dnodeId) {
code
=
TSDB_CODE_SDB_ERROR
;
}
mgmtUpdateMnodeIpSet
();
return
code
;
}
...
...
@@ -250,6 +284,8 @@ void mgmtDropMnodeLocal(int32_t dnodeId) {
sdbDeleteRow
(
&
oper
);
mgmtDecMnodeRef
(
pMnode
);
}
mgmtUpdateMnodeIpSet
();
}
int32_t
mgmtDropMnode
(
int32_t
dnodeId
)
{
...
...
@@ -270,6 +306,9 @@ int32_t mgmtDropMnode(int32_t dnodeId) {
}
sdbDecRef
(
tsMnodeSdb
,
pMnode
);
mgmtUpdateMnodeIpSet
();
return
code
;
}
...
...
src/mnode/src/mgmtSdb.c
浏览文件 @
aac2d1c4
...
...
@@ -196,6 +196,8 @@ void sdbUpdateMnodeRoles() {
mgmtDecMnodeRef
(
pMnode
);
}
}
mgmtUpdateMnodeIpSet
();
}
static
uint32_t
sdbGetFileInfo
(
void
*
ahandle
,
char
*
name
,
uint32_t
*
index
,
int32_t
*
size
,
uint64_t
*
fversion
)
{
...
...
@@ -442,8 +444,8 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) {
pthread_mutex_unlock
(
&
pTable
->
mutex
);
sdbTrace
(
"table:%s, insert record:%s to hash, numOfRows:%d version:%"
PRIu64
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
),
pTable
->
numOfRows
,
sdbGetVersion
());
sdbTrace
(
"table:%s, insert record:%s to hash,
rowSize:%d v
numOfRows:%d version:%"
PRIu64
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
),
p
Oper
->
rowSize
,
p
Table
->
numOfRows
,
sdbGetVersion
());
(
*
pTable
->
insertFp
)(
pOper
);
return
TSDB_CODE_SUCCESS
;
...
...
src/mnode/src/mgmtShell.c
浏览文件 @
aac2d1c4
...
...
@@ -119,7 +119,7 @@ static void mgmtDoDealyedAddToShellQueue(void *param, void *tmrId) {
void
mgmtDealyedAddToShellQueue
(
SQueuedMsg
*
queuedMsg
)
{
void
*
unUsed
=
NULL
;
taosTmrReset
(
mgmtDoDealyedAddToShellQueue
,
10
00
,
queuedMsg
,
tsMgmtTmr
,
&
unUsed
);
taosTmrReset
(
mgmtDoDealyedAddToShellQueue
,
3
00
,
queuedMsg
,
tsMgmtTmr
,
&
unUsed
);
}
void
mgmtProcessMsgFromShell
(
SRpcMsg
*
rpcMsg
)
{
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
aac2d1c4
...
...
@@ -340,7 +340,7 @@ static int32_t mgmtInitChildTables() {
SSdbTableDesc
tableDesc
=
{
.
tableId
=
SDB_TABLE_CTABLE
,
.
tableName
=
"ctables"
,
.
hashSessions
=
tsMaxTables
,
.
hashSessions
=
TSDB_DEFAULT_CTABLES_HASH_SIZE
,
.
maxRowSize
=
sizeof
(
SChildTableObj
)
+
sizeof
(
SSchema
)
*
(
TSDB_MAX_TAGS
+
TSDB_MAX_COLUMNS
+
16
)
+
TSDB_TABLE_ID_LEN
+
TSDB_CQ_SQL_SIZE
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_VAR_STRING
,
...
...
@@ -507,7 +507,7 @@ static int32_t mgmtInitSuperTables() {
SSdbTableDesc
tableDesc
=
{
.
tableId
=
SDB_TABLE_STABLE
,
.
tableName
=
"stables"
,
.
hashSessions
=
TSDB_
MAX_SUPER_TABLES
,
.
hashSessions
=
TSDB_
DEFAULT_STABLES_HASH_SIZE
,
.
maxRowSize
=
sizeof
(
SSuperTableObj
)
+
sizeof
(
SSchema
)
*
(
TSDB_MAX_TAGS
+
TSDB_MAX_COLUMNS
+
16
)
+
TSDB_TABLE_ID_LEN
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_VAR_STRING
,
...
...
@@ -1538,7 +1538,7 @@ static void mgmtProcessCreateChildTableMsg(SQueuedMsg *pMsg) {
SRpcIpSet
ipSet
=
mgmtGetIpSetFromVgroup
(
pVgroup
);
SQueuedMsg
*
newMsg
=
mgmtCloneQueuedMsg
(
pMsg
);
newMsg
->
ahandle
=
pMsg
->
pTable
;
newMsg
->
maxRetry
=
5
;
newMsg
->
maxRetry
=
10
;
SRpcMsg
rpcMsg
=
{
.
handle
=
newMsg
,
.
pCont
=
pMDCreate
,
...
...
src/mnode/src/mgmtUser.c
浏览文件 @
aac2d1c4
...
...
@@ -117,7 +117,7 @@ int32_t mgmtInitUsers() {
SSdbTableDesc
tableDesc
=
{
.
tableId
=
SDB_TABLE_USER
,
.
tableName
=
"users"
,
.
hashSessions
=
TSDB_
MAX_USERS
,
.
hashSessions
=
TSDB_
DEFAULT_USERS_HASH_SIZE
,
.
maxRowSize
=
tsUserUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_STRING
,
...
...
src/mnode/src/mgmtVgroup.c
浏览文件 @
aac2d1c4
...
...
@@ -121,6 +121,20 @@ static int32_t mgmtVgroupActionDelete(SSdbOper *pOper) {
return
TSDB_CODE_SUCCESS
;
}
static
void
mgmtVgroupUpdateIdPool
(
SVgObj
*
pVgroup
)
{
int32_t
oldTables
=
taosIdPoolMaxSize
(
pVgroup
->
idPool
);
SDbObj
*
pDb
=
pVgroup
->
pDb
;
if
(
pDb
!=
NULL
)
{
if
(
pDb
->
cfg
.
maxTables
!=
oldTables
)
{
mPrint
(
"vgId:%d tables change from %d to %d"
,
pVgroup
->
vgId
,
oldTables
,
pDb
->
cfg
.
maxTables
);
taosUpdateIdPool
(
pVgroup
->
idPool
,
pDb
->
cfg
.
maxTables
);
int32_t
size
=
sizeof
(
SChildTableObj
*
)
*
pDb
->
cfg
.
maxTables
;
pVgroup
->
tableList
=
(
SChildTableObj
**
)
realloc
(
pVgroup
->
tableList
,
size
);
memset
(
pVgroup
->
tableList
+
oldTables
,
0
,
(
pDb
->
cfg
.
maxTables
-
oldTables
)
*
sizeof
(
SChildTableObj
**
));
}
}
}
static
int32_t
mgmtVgroupActionUpdate
(
SSdbOper
*
pOper
)
{
SVgObj
*
pNew
=
pOper
->
pObj
;
SVgObj
*
pVgroup
=
mgmtGetVgroup
(
pNew
->
vgId
);
...
...
@@ -146,20 +160,11 @@ static int32_t mgmtVgroupActionUpdate(SSdbOper *pOper) {
}
}
int32_t
oldTables
=
taosIdPoolMaxSize
(
pVgroup
->
idPool
);
SDbObj
*
pDb
=
pVgroup
->
pDb
;
if
(
pDb
!=
NULL
)
{
if
(
pDb
->
cfg
.
maxTables
!=
oldTables
)
{
mPrint
(
"vgId:%d tables change from %d to %d"
,
pVgroup
->
vgId
,
oldTables
,
pDb
->
cfg
.
maxTables
);
taosUpdateIdPool
(
pVgroup
->
idPool
,
pDb
->
cfg
.
maxTables
);
int32_t
size
=
sizeof
(
SChildTableObj
*
)
*
pDb
->
cfg
.
maxTables
;
pVgroup
->
tableList
=
(
SChildTableObj
**
)
realloc
(
pVgroup
->
tableList
,
size
);
}
}
mgmtVgroupUpdateIdPool
(
pVgroup
);
mgmtDecVgroupRef
(
pVgroup
);
mTrace
(
"vgId:%d, is updated, numOfVnode:%d
tables:%d"
,
pVgroup
->
vgId
,
pVgroup
->
numOfVnodes
,
pDb
==
NULL
?
0
:
pDb
->
cfg
.
maxTabl
es
);
mTrace
(
"vgId:%d, is updated, numOfVnode:%d
"
,
pVgroup
->
vgId
,
pVgroup
->
numOfVnod
es
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -196,7 +201,7 @@ int32_t mgmtInitVgroups() {
SSdbTableDesc
tableDesc
=
{
.
tableId
=
SDB_TABLE_VGROUP
,
.
tableName
=
"vgroups"
,
.
hashSessions
=
TSDB_
MAX_VGROUPS
,
.
hashSessions
=
TSDB_
DEFAULT_VGROUPS_HASH_SIZE
,
.
maxRowSize
=
tsVgUpdateSize
,
.
refCountPos
=
(
int8_t
*
)(
&
tObj
.
refCount
)
-
(
int8_t
*
)
&
tObj
,
.
keyType
=
SDB_KEY_AUTO
,
...
...
@@ -762,6 +767,28 @@ void mgmtDropAllDnodeVgroups(SDnodeObj *pDropDnode) {
sdbFreeIter
(
pIter
);
}
void
mgmtUpdateAllDbVgroups
(
SDbObj
*
pAlterDb
)
{
void
*
pIter
=
NULL
;
SVgObj
*
pVgroup
=
NULL
;
mPrint
(
"db:%s, all vgroups will be update in sdb"
,
pAlterDb
->
name
);
while
(
1
)
{
pIter
=
mgmtGetNextVgroup
(
pIter
,
&
pVgroup
);
if
(
pVgroup
==
NULL
)
break
;
if
(
pVgroup
->
pDb
==
pAlterDb
)
{
mgmtVgroupUpdateIdPool
(
pVgroup
);
}
mgmtDecVgroupRef
(
pVgroup
);
}
sdbFreeIter
(
pIter
);
mPrint
(
"db:%s, all vgroups is updated in sdb"
,
pAlterDb
->
name
);
}
void
mgmtDropAllDbVgroups
(
SDbObj
*
pDropDb
,
bool
sendMsg
)
{
void
*
pIter
=
NULL
;
int32_t
numOfVgroups
=
0
;
...
...
src/query/src/qExecutor.c
浏览文件 @
aac2d1c4
...
...
@@ -4022,7 +4022,7 @@ void skipBlocks(SQueryRuntimeEnv *pRuntimeEnv) {
pTableQueryInfo
->
lastKey
=
(
QUERY_IS_ASC_QUERY
(
pQuery
))
?
blockInfo
.
window
.
ekey
:
blockInfo
.
window
.
skey
;
pTableQueryInfo
->
lastKey
+=
step
;
qTrace
(
"QInfo:%p skip rows:%d, offset:%"
PRId64
""
,
GET_QINFO_ADDR
(
pRuntimeEnv
),
blockInfo
.
rows
,
qTrace
(
"QInfo:%p skip rows:%d, offset:%"
PRId64
,
GET_QINFO_ADDR
(
pRuntimeEnv
),
blockInfo
.
rows
,
pQuery
->
limit
.
offset
);
}
else
{
// find the appropriated start position in current block
updateOffsetVal
(
pRuntimeEnv
,
&
blockInfo
);
...
...
@@ -5134,7 +5134,7 @@ bool validateExprColumnInfo(SQueryTableMsg *pQueryMsg, SSqlFuncMsg *pExprMsg, SC
static
bool
validateQueryMsg
(
SQueryTableMsg
*
pQueryMsg
)
{
if
(
pQueryMsg
->
intervalTime
<
0
)
{
qError
(
"qmsg:%p illegal value of interval time %"
PRId64
""
,
pQueryMsg
,
pQueryMsg
->
intervalTime
);
qError
(
"qmsg:%p illegal value of interval time %"
PRId64
,
pQueryMsg
,
pQueryMsg
->
intervalTime
);
return
false
;
}
...
...
src/tsdb/src/tsdbCache.c
浏览文件 @
aac2d1c4
...
...
@@ -162,6 +162,7 @@ int tsdbAlterCacheTotalBlocks(STsdbRepo *pRepo, int totalBlocks) {
pCache
->
totalCacheBlocks
=
totalBlocks
;
tsdbAdjustCacheBlocks
(
pCache
);
}
pRepo
->
config
.
totalBlocks
=
totalBlocks
;
tsdbUnLockRepo
((
TsdbRepoT
*
)
pRepo
);
tsdbTrace
(
"vgId:%d, tsdb total cache blocks changed from %d to %d"
,
pRepo
->
config
.
tsdbId
,
oldNumOfBlocks
,
totalBlocks
);
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
aac2d1c4
...
...
@@ -37,7 +37,8 @@ static TSKEY tsdbNextIterKey(SSkipListIterator *pIter);
static
int
tsdbHasDataToCommit
(
SSkipListIterator
**
iters
,
int
nIters
,
TSKEY
minKey
,
TSKEY
maxKey
);
static
void
tsdbAlterCompression
(
STsdbRepo
*
pRepo
,
int8_t
compression
);
static
void
tsdbAlterKeep
(
STsdbRepo
*
pRepo
,
int32_t
keep
);
static
void
tsdbAlterMaxTables
(
STsdbRepo
*
pRepo
,
int32_t
maxTables
);
static
void
tsdbAlterMaxTables
(
STsdbRepo
*
pRepo
,
int32_t
maxTables
);
static
int32_t
tsdbSaveConfig
(
STsdbRepo
*
pRepo
);
#define TSDB_GET_TABLE_BY_ID(pRepo, sid) (((STSDBRepo *)pRepo)->pTableList)[sid]
#define TSDB_GET_TABLE_BY_NAME(pRepo, name)
...
...
@@ -319,10 +320,25 @@ int32_t tsdbConfigRepo(TsdbRepoT *repo, STsdbCfg *pCfg) {
ASSERT
(
pRCfg
->
maxRowsPerFileBlock
==
pCfg
->
maxRowsPerFileBlock
);
ASSERT
(
pRCfg
->
precision
==
pCfg
->
precision
);
if
(
pRCfg
->
compression
!=
pCfg
->
compression
)
tsdbAlterCompression
(
pRepo
,
pCfg
->
compression
);
if
(
pRCfg
->
keep
!=
pCfg
->
keep
)
tsdbAlterKeep
(
pRepo
,
pCfg
->
keep
);
if
(
pRCfg
->
totalBlocks
!=
pCfg
->
totalBlocks
)
tsdbAlterCacheTotalBlocks
(
pRepo
,
pCfg
->
totalBlocks
);
if
(
pRCfg
->
maxTables
!=
pCfg
->
maxTables
)
tsdbAlterMaxTables
(
pRepo
,
pCfg
->
maxTables
);
bool
configChanged
=
false
;
if
(
pRCfg
->
compression
!=
pCfg
->
compression
)
{
configChanged
=
true
;
tsdbAlterCompression
(
pRepo
,
pCfg
->
compression
);
}
if
(
pRCfg
->
keep
!=
pCfg
->
keep
)
{
configChanged
=
true
;
tsdbAlterKeep
(
pRepo
,
pCfg
->
keep
);
}
if
(
pRCfg
->
totalBlocks
!=
pCfg
->
totalBlocks
)
{
configChanged
=
true
;
tsdbAlterCacheTotalBlocks
(
pRepo
,
pCfg
->
totalBlocks
);
}
if
(
pRCfg
->
maxTables
!=
pCfg
->
maxTables
)
{
configChanged
=
true
;
tsdbAlterMaxTables
(
pRepo
,
pCfg
->
maxTables
);
}
if
(
configChanged
)
tsdbSaveConfig
(
pRepo
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1134,8 +1150,10 @@ static void tsdbAlterKeep(STsdbRepo *pRepo, int32_t keep) {
int
maxFiles
=
keep
/
pCfg
->
maxTables
+
3
;
if
(
pRepo
->
config
.
keep
>
keep
)
{
pRepo
->
config
.
keep
=
keep
;
pRepo
->
tsdbFileH
->
maxFGroups
=
maxFiles
;
}
else
{
pRepo
->
config
.
keep
=
keep
;
pRepo
->
tsdbFileH
->
fGroup
=
realloc
(
pRepo
->
tsdbFileH
->
fGroup
,
sizeof
(
SFileGroup
));
if
(
pRepo
->
tsdbFileH
->
fGroup
==
NULL
)
{
// TODO: deal with the error
...
...
@@ -1155,6 +1173,8 @@ static void tsdbAlterMaxTables(STsdbRepo *pRepo, int32_t maxTables) {
pMeta
->
maxTables
=
maxTables
;
pMeta
->
tables
=
realloc
(
pMeta
->
tables
,
maxTables
*
sizeof
(
STable
*
));
memset
(
&
pMeta
->
tables
[
oldMaxTables
],
0
,
sizeof
(
STable
*
)
*
(
maxTables
-
oldMaxTables
));
pRepo
->
config
.
maxTables
=
maxTables
;
tsdbTrace
(
"vgId:%d, tsdb maxTables is changed from %d to %d!"
,
pRepo
->
config
.
tsdbId
,
oldMaxTables
,
maxTables
);
}
...
...
src/tsdb/src/tsdbMeta.c
浏览文件 @
aac2d1c4
...
...
@@ -127,7 +127,7 @@ int tsdbRestoreTable(void *pHandle, void *cont, int contLen) {
if
(
pTable
->
type
==
TSDB_SUPER_TABLE
)
{
STColumn
*
pColSchema
=
schemaColAt
(
pTable
->
tagSchema
,
0
);
pTable
->
pIndex
=
tSkipListCreate
(
TSDB_SUPER_TABLE_SL_LEVEL
,
pColSchema
->
type
,
pColSchema
->
bytes
,
1
,
0
,
0
,
getTagIndexKey
);
1
,
0
,
1
,
getTagIndexKey
);
}
tsdbAddTableToMeta
(
pMeta
,
pTable
,
false
);
...
...
@@ -316,7 +316,7 @@ int tsdbCreateTable(TsdbRepoT *repo, STableCfg *pCfg) {
// index the first tag column
STColumn
*
pColSchema
=
schemaColAt
(
super
->
tagSchema
,
0
);
super
->
pIndex
=
tSkipListCreate
(
TSDB_SUPER_TABLE_SL_LEVEL
,
pColSchema
->
type
,
pColSchema
->
bytes
,
1
,
0
,
0
,
getTagIndexKey
);
// Allow duplicate key, no lock
1
,
0
,
1
,
getTagIndexKey
);
// Allow duplicate key, no lock
if
(
super
->
pIndex
==
NULL
)
{
tdFreeSchema
(
super
->
schema
);
...
...
@@ -440,6 +440,7 @@ static int tsdbFreeTable(STable *pTable) {
// Free content
if
(
TSDB_TABLE_IS_SUPER_TABLE
(
pTable
))
{
tdFreeSchema
(
pTable
->
tagSchema
);
tSkipListDestroy
(
pTable
->
pIndex
);
}
...
...
src/tsdb/src/tsdbRWHelper.c
浏览文件 @
aac2d1c4
...
...
@@ -409,7 +409,7 @@ int tsdbWriteCompInfo(SRWHelper *pHelper) {
if
(
pIdx
->
offset
>
0
)
{
pIdx
->
offset
=
lseek
(
pHelper
->
files
.
nHeadF
.
fd
,
0
,
SEEK_END
);
if
(
pIdx
->
offset
<
0
)
return
-
1
;
ASSERT
(
pIdx
->
offset
>=
tsizeof
(
pHelper
->
pCompIdx
)
);
ASSERT
(
pIdx
->
offset
>=
TSDB_FILE_HEAD_SIZE
);
if
(
tsendfile
(
pHelper
->
files
.
nHeadF
.
fd
,
pHelper
->
files
.
headF
.
fd
,
NULL
,
pIdx
->
len
)
<
pIdx
->
len
)
return
-
1
;
}
...
...
@@ -489,6 +489,7 @@ int tsdbLoadCompIdx(SRWHelper *pHelper, void *target) {
}
ASSERT
(((
char
*
)
ptr
-
(
char
*
)
pHelper
->
pBuffer
)
==
(
pFile
->
info
.
len
-
sizeof
(
TSCKSUM
)));
if
(
lseek
(
fd
,
TSDB_FILE_HEAD_SIZE
,
SEEK_SET
)
<
0
)
return
-
1
;
}
}
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
aac2d1c4
...
...
@@ -73,13 +73,18 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) {
return
TSDB_CODE_SUCCESS
;
}
mkdir
(
tsVnodeDir
,
0755
);
char
rootDir
[
TSDB_FILENAME_LEN
]
=
{
0
};
sprintf
(
rootDir
,
"%s/vnode%d"
,
tsVnodeDir
,
pVnodeCfg
->
cfg
.
vgId
);
if
(
mkdir
(
rootDir
,
0755
)
!=
0
)
{
vPrint
(
"vgId:%d, failed to create vnode, reason:%s dir:%s"
,
pVnodeCfg
->
cfg
.
vgId
,
strerror
(
errno
),
rootDir
);
if
(
errno
==
EACCES
)
{
return
TSDB_CODE_NO_DISK_PERMISSIONS
;
}
else
if
(
errno
==
ENOSPC
)
{
return
TSDB_CODE_SERV_NO_DISKSPACE
;
}
else
if
(
errno
==
ENOENT
)
{
return
TSDB_CODE_NOT_SUCH_FILE_OR_DIR
;
}
else
if
(
errno
==
EEXIST
)
{
}
else
{
return
TSDB_CODE_VG_INIT_FAILED
;
...
...
@@ -239,6 +244,10 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
syncInfo
.
notifyFileSynced
=
vnodeNotifyFileSynced
;
pVnode
->
sync
=
syncStart
(
&
syncInfo
);
#ifndef _SYNC
pVnode
->
role
=
TAOS_SYNC_ROLE_MASTER
;
#endif
// start continuous query
if
(
pVnode
->
role
==
TAOS_SYNC_ROLE_MASTER
)
cqStart
(
pVnode
->
cq
);
...
...
@@ -429,7 +438,7 @@ static void vnodeNotifyRole(void *ahandle, int8_t role) {
static
void
vnodeNotifyFileSynced
(
void
*
ahandle
,
uint64_t
fversion
)
{
SVnodeObj
*
pVnode
=
ahandle
;
vTrace
(
"vgId:%d, data file is synced, fversion:%"
PRId64
""
,
pVnode
->
vgId
,
fversion
);
vTrace
(
"vgId:%d, data file is synced, fversion:%"
PRId64
,
pVnode
->
vgId
,
fversion
);
pVnode
->
fversion
=
fversion
;
pVnode
->
version
=
fversion
;
...
...
tests/script/general/db/alter_tables_d2.sim
0 → 100644
浏览文件 @
aac2d1c4
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 2
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 2
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sleep 3000
sql connect
sql create dnode $hostname2
sleep 1000
print ============================ step1
sql create database db maxTables 5
sql create table db.st (ts timestamp, i int) tags(t int)
sql create table db.t000 using db.st tags(0)
sql create table db.t001 using db.st tags(1)
sql create table db.t002 using db.st tags(2)
sql create table db.t003 using db.st tags(3)
sql create table db.t004 using db.st tags(4)
sql create table db.t005 using db.st tags(5)
sql create table db.t006 using db.st tags(6)
sql create table db.t007 using db.st tags(7)
sql create table db.t008 using db.st tags(8)
sql create table db.t009 using db.st tags(9)
sql create table db.t010 using db.st tags(0)
sql create table db.t011 using db.st tags(1)
sql create table db.t012 using db.st tags(2)
sql create table db.t013 using db.st tags(3)
sql create table db.t014 using db.st tags(4)
sql create table db.t015 using db.st tags(5)
sql create table db.t016 using db.st tags(6)
sql create table db.t017 using db.st tags(7)
sql create table db.t018 using db.st tags(8)
sql create table db.t019 using db.st tags(9)
sql show db.tables
if $rows != 20 then
return -1
endi
sql insert into db.t000 values(now, 1)
sql insert into db.t001 values(now, 1)
sql insert into db.t002 values(now, 1)
sql insert into db.t003 values(now, 1)
sql insert into db.t004 values(now, 1)
sql insert into db.t005 values(now, 1)
sql insert into db.t006 values(now, 1)
sql insert into db.t007 values(now, 1)
sql insert into db.t008 values(now, 1)
sql insert into db.t009 values(now, 1)
sql insert into db.t010 values(now, 1)
sql insert into db.t011 values(now, 1)
sql insert into db.t012 values(now, 1)
sql insert into db.t013 values(now, 1)
sql insert into db.t014 values(now, 1)
sql insert into db.t015 values(now, 1)
sql insert into db.t016 values(now, 1)
sql insert into db.t017 values(now, 1)
sql insert into db.t018 values(now, 1)
sql insert into db.t019 values(now, 1)
print ============================ step2
sql_error create table db.t100 using db.st tags(10)
sql show db.tables
if $rows != 20 then
return -1
endi
print ============================ step3
sql alter database db maxTables 10
sleep 1000
sql create table db.t100 using db.st tags(0)
sql create table db.t101 using db.st tags(1)
sql create table db.t102 using db.st tags(2)
sql create table db.t103 using db.st tags(3)
sql create table db.t104 using db.st tags(4)
sql create table db.t105 using db.st tags(5)
sql create table db.t106 using db.st tags(6)
sql create table db.t107 using db.st tags(7)
sql create table db.t108 using db.st tags(8)
sql create table db.t109 using db.st tags(9)
sql create table db.t110 using db.st tags(0)
sql create table db.t111 using db.st tags(1)
sql create table db.t112 using db.st tags(2)
sql create table db.t113 using db.st tags(3)
sql create table db.t114 using db.st tags(4)
sql create table db.t115 using db.st tags(5)
sql create table db.t116 using db.st tags(6)
sql create table db.t117 using db.st tags(7)
sql create table db.t118 using db.st tags(8)
sql create table db.t119 using db.st tags(9)
sql show db.tables
if $rows != 40 then
return -1
endi
sql insert into db.t100 values(now, 1)
sql insert into db.t101 values(now, 1)
sql insert into db.t102 values(now, 1)
sql insert into db.t103 values(now, 1)
sql insert into db.t104 values(now, 1)
sql insert into db.t105 values(now, 1)
sql insert into db.t106 values(now, 1)
sql insert into db.t107 values(now, 1)
sql insert into db.t108 values(now, 1)
sql insert into db.t109 values(now, 1)
sql insert into db.t110 values(now, 1)
sql insert into db.t111 values(now, 1)
sql insert into db.t112 values(now, 1)
sql insert into db.t113 values(now, 1)
sql insert into db.t114 values(now, 1)
sql insert into db.t115 values(now, 1)
sql insert into db.t116 values(now, 1)
sql insert into db.t117 values(now, 1)
sql insert into db.t118 values(now, 1)
sql insert into db.t119 values(now, 1)
print ============================ step4
sql_error create table db.t200 using db.st tags(10)
sql show db.tables
if $rows != 40 then
return -1
endi
print ============================ step5
sql alter database db maxTables 15
sleep 1000
sql create table db.t200 using db.st tags(0)
sql create table db.t201 using db.st tags(1)
sql create table db.t202 using db.st tags(2)
sql create table db.t203 using db.st tags(3)
sql create table db.t204 using db.st tags(4)
sql create table db.t205 using db.st tags(5)
sql create table db.t206 using db.st tags(6)
sql create table db.t207 using db.st tags(7)
sql create table db.t208 using db.st tags(8)
sql create table db.t209 using db.st tags(9)
sql create table db.t210 using db.st tags(0)
sql create table db.t211 using db.st tags(1)
sql create table db.t212 using db.st tags(2)
sql create table db.t213 using db.st tags(3)
sql create table db.t214 using db.st tags(4)
sql create table db.t215 using db.st tags(5)
sql create table db.t216 using db.st tags(6)
sql create table db.t217 using db.st tags(7)
sql create table db.t218 using db.st tags(8)
sql create table db.t219 using db.st tags(9)
sql show db.tables
if $rows != 60 then
return -1
endi
sql insert into db.t200 values(now, 1)
sql insert into db.t201 values(now, 1)
sql insert into db.t202 values(now, 1)
sql insert into db.t203 values(now, 1)
sql insert into db.t204 values(now, 1)
sql insert into db.t205 values(now, 1)
sql insert into db.t206 values(now, 1)
sql insert into db.t207 values(now, 1)
sql insert into db.t208 values(now, 1)
sql insert into db.t209 values(now, 1)
sql insert into db.t210 values(now, 1)
sql insert into db.t211 values(now, 1)
sql insert into db.t212 values(now, 1)
sql insert into db.t213 values(now, 1)
sql insert into db.t214 values(now, 1)
sql insert into db.t215 values(now, 1)
sql insert into db.t216 values(now, 1)
sql insert into db.t217 values(now, 1)
sql insert into db.t218 values(now, 1)
sql insert into db.t219 values(now, 1)
print ============================ step6
sql reset query cache
sleep 1000
sql select * from db.t000
if $rows != 1 then
return -1
endi
sql select * from db.t100
if $rows != 1 then
return -1
endi
sql select * from db.t200
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 60 then
return -1
endi
print ============================ step7
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 1000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sleep 3000
sql reset query cache
sleep 1000
sql show db.tables
if $rows != 60 then
return -1
endi
sql select * from db.t000
if $rows != 1 then
return -1
endi
sql select * from db.t100
if $rows != 1 then
return -1
endi
sql select * from db.t200
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 60 then
return -1
endi
print ============================ step8
sql_error create table db.t300 using db.st tags(10)
sql show db.tables
if $rows != 60 then
return -1
endi
print ============================ step9
sql alter database db maxTables 20
sleep 1000
sql create table db.t300 using db.st tags(0)
sql create table db.t301 using db.st tags(1)
sql create table db.t302 using db.st tags(2)
sql create table db.t303 using db.st tags(3)
sql create table db.t304 using db.st tags(4)
sql create table db.t305 using db.st tags(5)
sql create table db.t306 using db.st tags(6)
sql create table db.t307 using db.st tags(7)
sql create table db.t308 using db.st tags(8)
sql create table db.t309 using db.st tags(9)
sql create table db.t310 using db.st tags(0)
sql create table db.t311 using db.st tags(1)
sql create table db.t312 using db.st tags(2)
sql create table db.t313 using db.st tags(3)
sql create table db.t314 using db.st tags(4)
sql create table db.t315 using db.st tags(5)
sql create table db.t316 using db.st tags(6)
sql create table db.t317 using db.st tags(7)
sql create table db.t318 using db.st tags(8)
sql create table db.t319 using db.st tags(9)
sql insert into db.t300 values(now, 1)
sql insert into db.t301 values(now, 1)
sql insert into db.t302 values(now, 1)
sql insert into db.t303 values(now, 1)
sql insert into db.t304 values(now, 1)
sql insert into db.t305 values(now, 1)
sql insert into db.t306 values(now, 1)
sql insert into db.t307 values(now, 1)
sql insert into db.t308 values(now, 1)
sql insert into db.t309 values(now, 1)
sql insert into db.t310 values(now, 1)
sql insert into db.t311 values(now, 1)
sql insert into db.t312 values(now, 1)
sql insert into db.t313 values(now, 1)
sql insert into db.t314 values(now, 1)
sql insert into db.t315 values(now, 1)
sql insert into db.t316 values(now, 1)
sql insert into db.t317 values(now, 1)
sql insert into db.t318 values(now, 1)
sql insert into db.t319 values(now, 1)
sql show db.tables
if $rows != 80 then
return -1
endi
sql reset query cache
sleep 1000
sql select * from db.t000
if $rows != 1 then
return -1
endi
sql select * from db.t100
if $rows != 1 then
return -1
endi
sql select * from db.t200
if $rows != 1 then
return -1
endi
sql select * from db.t300
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 80 then
return -1
endi
print ============================ step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 1000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sleep 3000
sql reset query cache
sleep 1000
sql show db.tables
if $rows != 80 then
return -1
endi
sql select * from db.t000
if $rows != 1 then
return -1
endi
sql select * from db.t100
if $rows != 1 then
return -1
endi
sql select * from db.t200
if $rows != 1 then
return -1
endi
sql select * from db.t300
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 80 then
return -1
endi
print ============================ step11
sql_error create table db.t400 using db.st tags(10)
sql show db.tables
if $rows != 50 then
return -1
endi
print ============================ step9
sql alter database db maxTables 25
sleep 1000
sql create table db.t400 using db.st tags(0)
sql create table db.t401 using db.st tags(1)
sql create table db.t402 using db.st tags(2)
sql create table db.t403 using db.st tags(3)
sql create table db.t404 using db.st tags(4)
sql create table db.t405 using db.st tags(5)
sql create table db.t406 using db.st tags(6)
sql create table db.t407 using db.st tags(7)
sql create table db.t408 using db.st tags(8)
sql create table db.t409 using db.st tags(9)
sql create table db.t410 using db.st tags(0)
sql create table db.t411 using db.st tags(1)
sql create table db.t412 using db.st tags(2)
sql create table db.t413 using db.st tags(3)
sql create table db.t414 using db.st tags(4)
sql create table db.t415 using db.st tags(5)
sql create table db.t416 using db.st tags(6)
sql create table db.t417 using db.st tags(7)
sql create table db.t418 using db.st tags(8)
sql create table db.t419 using db.st tags(9)
sql insert into db.t400 values(now, 1)
sql insert into db.t401 values(now, 1)
sql insert into db.t402 values(now, 1)
sql insert into db.t403 values(now, 1)
sql insert into db.t404 values(now, 1)
sql insert into db.t405 values(now, 1)
sql insert into db.t406 values(now, 1)
sql insert into db.t407 values(now, 1)
sql insert into db.t408 values(now, 1)
sql insert into db.t409 values(now, 1)
sql insert into db.t410 values(now, 1)
sql insert into db.t411 values(now, 1)
sql insert into db.t412 values(now, 1)
sql insert into db.t413 values(now, 1)
sql insert into db.t414 values(now, 1)
sql insert into db.t415 values(now, 1)
sql insert into db.t416 values(now, 1)
sql insert into db.t417 values(now, 1)
sql insert into db.t418 values(now, 1)
sql insert into db.t419 values(now, 1)
sql show db.tables
if $rows != 50 then
return -1
endi
sql reset query cache
sleep 1000
sql select * from db.t000
if $rows != 1 then
return -1
endi
sql select * from db.t100
if $rows != 1 then
return -1
endi
sql select * from db.t200
if $rows != 1 then
return -1
endi
sql select * from db.t300
if $rows != 1 then
return -1
endi
sql select * from db.t400
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 100 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
\ No newline at end of file
tests/script/general/db/alter_tables_v1.sim
0 → 100644
浏览文件 @
aac2d1c4
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ step1
sql create database db maxTables 10
sql create table db.st (ts timestamp, i int) tags(t int)
sql create table db.t0 using db.st tags(0)
sql create table db.t1 using db.st tags(1)
sql create table db.t2 using db.st tags(2)
sql create table db.t3 using db.st tags(3)
sql create table db.t4 using db.st tags(4)
sql create table db.t5 using db.st tags(5)
sql create table db.t6 using db.st tags(6)
sql create table db.t7 using db.st tags(7)
sql create table db.t8 using db.st tags(8)
sql create table db.t9 using db.st tags(9)
sql show db.tables
if $rows != 10 then
return -1
endi
sql insert into db.t0 values(now, 1)
sql insert into db.t1 values(now, 1)
sql insert into db.t2 values(now, 1)
sql insert into db.t3 values(now, 1)
sql insert into db.t4 values(now, 1)
sql insert into db.t5 values(now, 1)
sql insert into db.t6 values(now, 1)
sql insert into db.t7 values(now, 1)
sql insert into db.t8 values(now, 1)
sql insert into db.t9 values(now, 1)
print ============================ step2
sql_error create table db.t10 using db.st tags(10)
sql show db.tables
if $rows != 10 then
return -1
endi
print ============================ step3
sql alter database db maxTables 20
sleep 1000
sql create table db.t10 using db.st tags(0)
sql create table db.t11 using db.st tags(1)
sql create table db.t12 using db.st tags(2)
sql create table db.t13 using db.st tags(3)
sql create table db.t14 using db.st tags(4)
sql create table db.t15 using db.st tags(5)
sql create table db.t16 using db.st tags(6)
sql create table db.t17 using db.st tags(7)
sql create table db.t18 using db.st tags(8)
sql create table db.t19 using db.st tags(9)
sql show db.tables
if $rows != 20 then
return -1
endi
sql insert into db.t10 values(now, 1)
sql insert into db.t11 values(now, 1)
sql insert into db.t12 values(now, 1)
sql insert into db.t13 values(now, 1)
sql insert into db.t14 values(now, 1)
sql insert into db.t15 values(now, 1)
sql insert into db.t16 values(now, 1)
sql insert into db.t17 values(now, 1)
sql insert into db.t18 values(now, 1)
sql insert into db.t19 values(now, 1)
print ============================ step4
sql_error create table db.t20 using db.st tags(10)
sql show db.tables
if $rows != 20 then
return -1
endi
print ============================ step5
sql alter database db maxTables 30
sleep 1000
sql create table db.t20 using db.st tags(0)
sql create table db.t21 using db.st tags(1)
sql create table db.t22 using db.st tags(2)
sql create table db.t23 using db.st tags(3)
sql create table db.t24 using db.st tags(4)
sql create table db.t25 using db.st tags(5)
sql create table db.t26 using db.st tags(6)
sql create table db.t27 using db.st tags(7)
sql create table db.t28 using db.st tags(8)
sql create table db.t29 using db.st tags(9)
sql show db.tables
if $rows != 30 then
return -1
endi
sql insert into db.t20 values(now, 1)
sql insert into db.t21 values(now, 1)
sql insert into db.t22 values(now, 1)
sql insert into db.t23 values(now, 1)
sql insert into db.t24 values(now, 1)
sql insert into db.t25 values(now, 1)
sql insert into db.t26 values(now, 1)
sql insert into db.t27 values(now, 1)
sql insert into db.t28 values(now, 1)
sql insert into db.t29 values(now, 1)
print ============================ step6
sql reset query cache
sleep 1000
sql select * from db.t0
if $rows != 1 then
return -1
endi
sql select * from db.t10
if $rows != 1 then
return -1
endi
sql select * from db.t20
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 30 then
return -1
endi
print ============================ step7
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 1000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql reset query cache
sleep 1000
sql show db.tables
if $rows != 30 then
return -1
endi
sql select * from db.t0
if $rows != 1 then
return -1
endi
sql select * from db.t10
if $rows != 1 then
return -1
endi
sql select * from db.t20
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 30 then
return -1
endi
print ============================ step8
sql_error create table db.t30 using db.st tags(10)
sql show db.tables
if $rows != 30 then
return -1
endi
print ============================ step9
sql alter database db maxTables 40
sleep 1000
sql create table db.t30 using db.st tags(0)
sql create table db.t31 using db.st tags(1)
sql create table db.t32 using db.st tags(2)
sql create table db.t33 using db.st tags(3)
sql create table db.t34 using db.st tags(4)
sql create table db.t35 using db.st tags(5)
sql create table db.t36 using db.st tags(6)
sql create table db.t37 using db.st tags(7)
sql create table db.t38 using db.st tags(8)
sql create table db.t39 using db.st tags(9)
sql insert into db.t30 values(now, 1)
sql insert into db.t31 values(now, 1)
sql insert into db.t32 values(now, 1)
sql insert into db.t33 values(now, 1)
sql insert into db.t34 values(now, 1)
sql insert into db.t35 values(now, 1)
sql insert into db.t36 values(now, 1)
sql insert into db.t37 values(now, 1)
sql insert into db.t38 values(now, 1)
sql insert into db.t39 values(now, 1)
sql show db.tables
if $rows != 40 then
return -1
endi
sql reset query cache
sleep 1000
sql select * from db.t0
if $rows != 1 then
return -1
endi
sql select * from db.t10
if $rows != 1 then
return -1
endi
sql select * from db.t20
if $rows != 1 then
return -1
endi
sql select * from db.t30
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 40 then
return -1
endi
print ============================ step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 1000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql reset query cache
sleep 1000
sql show db.tables
if $rows != 40 then
return -1
endi
sql select * from db.t0
if $rows != 1 then
return -1
endi
sql select * from db.t10
if $rows != 1 then
return -1
endi
sql select * from db.t20
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 40 then
return -1
endi
print ============================ step11
sql_error create table db.t40 using db.st tags(10)
sql show db.tables
if $rows != 40 then
return -1
endi
print ============================ step12
sql alter database db maxTables 50
sleep 1000
sql create table db.t40 using db.st tags(0)
sql create table db.t41 using db.st tags(1)
sql create table db.t42 using db.st tags(2)
sql create table db.t43 using db.st tags(3)
sql create table db.t44 using db.st tags(4)
sql create table db.t45 using db.st tags(5)
sql create table db.t46 using db.st tags(6)
sql create table db.t47 using db.st tags(7)
sql create table db.t48 using db.st tags(8)
sql create table db.t49 using db.st tags(9)
sql insert into db.t40 values(now, 1)
sql insert into db.t41 values(now, 1)
sql insert into db.t42 values(now, 1)
sql insert into db.t43 values(now, 1)
sql insert into db.t44 values(now, 1)
sql insert into db.t45 values(now, 1)
sql insert into db.t46 values(now, 1)
sql insert into db.t47 values(now, 1)
sql insert into db.t48 values(now, 1)
sql insert into db.t49 values(now, 1)
sql show db.tables
if $rows != 50 then
return -1
endi
sql reset query cache
sleep 1000
sql select * from db.t0
if $rows != 1 then
return -1
endi
sql select * from db.t10
if $rows != 1 then
return -1
endi
sql select * from db.t20
if $rows != 1 then
return -1
endi
sql select * from db.t30
if $rows != 1 then
return -1
endi
sql select * from db.t40
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 50 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/general/db/alter_tables_v4.sim
0 → 100644
浏览文件 @
aac2d1c4
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ step1
sql create database db maxTables 5
sql create table db.st (ts timestamp, i int) tags(t int)
sql create table db.t000 using db.st tags(0)
sql create table db.t001 using db.st tags(1)
sql create table db.t002 using db.st tags(2)
sql create table db.t003 using db.st tags(3)
sql create table db.t004 using db.st tags(4)
sql create table db.t005 using db.st tags(5)
sql create table db.t006 using db.st tags(6)
sql create table db.t007 using db.st tags(7)
sql create table db.t008 using db.st tags(8)
sql create table db.t009 using db.st tags(9)
sql create table db.t010 using db.st tags(0)
sql create table db.t011 using db.st tags(1)
sql create table db.t012 using db.st tags(2)
sql create table db.t013 using db.st tags(3)
sql create table db.t014 using db.st tags(4)
sql create table db.t015 using db.st tags(5)
sql create table db.t016 using db.st tags(6)
sql create table db.t017 using db.st tags(7)
sql create table db.t018 using db.st tags(8)
sql create table db.t019 using db.st tags(9)
sql show db.tables
if $rows != 20 then
return -1
endi
sql insert into db.t000 values(now, 1)
sql insert into db.t001 values(now, 1)
sql insert into db.t002 values(now, 1)
sql insert into db.t003 values(now, 1)
sql insert into db.t004 values(now, 1)
sql insert into db.t005 values(now, 1)
sql insert into db.t006 values(now, 1)
sql insert into db.t007 values(now, 1)
sql insert into db.t008 values(now, 1)
sql insert into db.t009 values(now, 1)
sql insert into db.t010 values(now, 1)
sql insert into db.t011 values(now, 1)
sql insert into db.t012 values(now, 1)
sql insert into db.t013 values(now, 1)
sql insert into db.t014 values(now, 1)
sql insert into db.t015 values(now, 1)
sql insert into db.t016 values(now, 1)
sql insert into db.t017 values(now, 1)
sql insert into db.t018 values(now, 1)
sql insert into db.t019 values(now, 1)
print ============================ step2
sql_error create table db.t100 using db.st tags(10)
sql show db.tables
if $rows != 20 then
return -1
endi
print ============================ step3
sql alter database db maxTables 10
sleep 1000
sql create table db.t100 using db.st tags(0)
sql create table db.t101 using db.st tags(1)
sql create table db.t102 using db.st tags(2)
sql create table db.t103 using db.st tags(3)
sql create table db.t104 using db.st tags(4)
sql create table db.t105 using db.st tags(5)
sql create table db.t106 using db.st tags(6)
sql create table db.t107 using db.st tags(7)
sql create table db.t108 using db.st tags(8)
sql create table db.t109 using db.st tags(9)
sql create table db.t110 using db.st tags(0)
sql create table db.t111 using db.st tags(1)
sql create table db.t112 using db.st tags(2)
sql create table db.t113 using db.st tags(3)
sql create table db.t114 using db.st tags(4)
sql create table db.t115 using db.st tags(5)
sql create table db.t116 using db.st tags(6)
sql create table db.t117 using db.st tags(7)
sql create table db.t118 using db.st tags(8)
sql create table db.t119 using db.st tags(9)
sql show db.tables
if $rows != 40 then
return -1
endi
sql insert into db.t100 values(now, 1)
sql insert into db.t101 values(now, 1)
sql insert into db.t102 values(now, 1)
sql insert into db.t103 values(now, 1)
sql insert into db.t104 values(now, 1)
sql insert into db.t105 values(now, 1)
sql insert into db.t106 values(now, 1)
sql insert into db.t107 values(now, 1)
sql insert into db.t108 values(now, 1)
sql insert into db.t109 values(now, 1)
sql insert into db.t110 values(now, 1)
sql insert into db.t111 values(now, 1)
sql insert into db.t112 values(now, 1)
sql insert into db.t113 values(now, 1)
sql insert into db.t114 values(now, 1)
sql insert into db.t115 values(now, 1)
sql insert into db.t116 values(now, 1)
sql insert into db.t117 values(now, 1)
sql insert into db.t118 values(now, 1)
sql insert into db.t119 values(now, 1)
print ============================ step4
sql_error create table db.t200 using db.st tags(10)
sql show db.tables
if $rows != 40 then
return -1
endi
print ============================ step5
sql alter database db maxTables 15
sleep 1000
sql create table db.t200 using db.st tags(0)
sql create table db.t201 using db.st tags(1)
sql create table db.t202 using db.st tags(2)
sql create table db.t203 using db.st tags(3)
sql create table db.t204 using db.st tags(4)
sql create table db.t205 using db.st tags(5)
sql create table db.t206 using db.st tags(6)
sql create table db.t207 using db.st tags(7)
sql create table db.t208 using db.st tags(8)
sql create table db.t209 using db.st tags(9)
sql create table db.t210 using db.st tags(0)
sql create table db.t211 using db.st tags(1)
sql create table db.t212 using db.st tags(2)
sql create table db.t213 using db.st tags(3)
sql create table db.t214 using db.st tags(4)
sql create table db.t215 using db.st tags(5)
sql create table db.t216 using db.st tags(6)
sql create table db.t217 using db.st tags(7)
sql create table db.t218 using db.st tags(8)
sql create table db.t219 using db.st tags(9)
sql show db.tables
if $rows != 60 then
return -1
endi
sql insert into db.t200 values(now, 1)
sql insert into db.t201 values(now, 1)
sql insert into db.t202 values(now, 1)
sql insert into db.t203 values(now, 1)
sql insert into db.t204 values(now, 1)
sql insert into db.t205 values(now, 1)
sql insert into db.t206 values(now, 1)
sql insert into db.t207 values(now, 1)
sql insert into db.t208 values(now, 1)
sql insert into db.t209 values(now, 1)
sql insert into db.t210 values(now, 1)
sql insert into db.t211 values(now, 1)
sql insert into db.t212 values(now, 1)
sql insert into db.t213 values(now, 1)
sql insert into db.t214 values(now, 1)
sql insert into db.t215 values(now, 1)
sql insert into db.t216 values(now, 1)
sql insert into db.t217 values(now, 1)
sql insert into db.t218 values(now, 1)
sql insert into db.t219 values(now, 1)
print ============================ step6
sql reset query cache
sleep 1000
sql select * from db.t000
if $rows != 1 then
return -1
endi
sql select * from db.t100
if $rows != 1 then
return -1
endi
sql select * from db.t200
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 60 then
return -1
endi
print ============================ step7
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 1000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql reset query cache
sleep 1000
sql show db.tables
if $rows != 60 then
return -1
endi
sql select * from db.t000
if $rows != 1 then
return -1
endi
sql select * from db.t100
if $rows != 1 then
return -1
endi
sql select * from db.t200
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 60 then
return -1
endi
print ============================ step8
sql_error create table db.t300 using db.st tags(10)
sql show db.tables
if $rows != 60 then
return -1
endi
print ============================ step9
sql alter database db maxTables 20
sleep 1000
sql create table db.t300 using db.st tags(0)
sql create table db.t301 using db.st tags(1)
sql create table db.t302 using db.st tags(2)
sql create table db.t303 using db.st tags(3)
sql create table db.t304 using db.st tags(4)
sql create table db.t305 using db.st tags(5)
sql create table db.t306 using db.st tags(6)
sql create table db.t307 using db.st tags(7)
sql create table db.t308 using db.st tags(8)
sql create table db.t309 using db.st tags(9)
sql create table db.t310 using db.st tags(0)
sql create table db.t311 using db.st tags(1)
sql create table db.t312 using db.st tags(2)
sql create table db.t313 using db.st tags(3)
sql create table db.t314 using db.st tags(4)
sql create table db.t315 using db.st tags(5)
sql create table db.t316 using db.st tags(6)
sql create table db.t317 using db.st tags(7)
sql create table db.t318 using db.st tags(8)
sql create table db.t319 using db.st tags(9)
sql insert into db.t300 values(now, 1)
sql insert into db.t301 values(now, 1)
sql insert into db.t302 values(now, 1)
sql insert into db.t303 values(now, 1)
sql insert into db.t304 values(now, 1)
sql insert into db.t305 values(now, 1)
sql insert into db.t306 values(now, 1)
sql insert into db.t307 values(now, 1)
sql insert into db.t308 values(now, 1)
sql insert into db.t309 values(now, 1)
sql insert into db.t310 values(now, 1)
sql insert into db.t311 values(now, 1)
sql insert into db.t312 values(now, 1)
sql insert into db.t313 values(now, 1)
sql insert into db.t314 values(now, 1)
sql insert into db.t315 values(now, 1)
sql insert into db.t316 values(now, 1)
sql insert into db.t317 values(now, 1)
sql insert into db.t318 values(now, 1)
sql insert into db.t319 values(now, 1)
sql show db.tables
if $rows != 80 then
return -1
endi
sql reset query cache
sleep 1000
sql select * from db.t000
if $rows != 1 then
return -1
endi
sql select * from db.t100
if $rows != 1 then
return -1
endi
sql select * from db.t200
if $rows != 1 then
return -1
endi
sql select * from db.t300
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 80 then
return -1
endi
print ============================ step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 1000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql reset query cache
sleep 1000
sql show db.tables
if $rows != 80 then
return -1
endi
sql select * from db.t000
if $rows != 1 then
return -1
endi
sql select * from db.t100
if $rows != 1 then
return -1
endi
sql select * from db.t200
if $rows != 1 then
return -1
endi
sql select * from db.t300
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 80 then
return -1
endi
print ============================ step11
sql_error create table db.t400 using db.st tags(10)
sql show db.tables
if $rows != 80 then
return -1
endi
print ============================ step12
sql alter database db maxTables 25
sleep 1000
sql create table db.t400 using db.st tags(0)
sql create table db.t401 using db.st tags(1)
sql create table db.t402 using db.st tags(2)
sql create table db.t403 using db.st tags(3)
sql create table db.t404 using db.st tags(4)
sql create table db.t405 using db.st tags(5)
sql create table db.t406 using db.st tags(6)
sql create table db.t407 using db.st tags(7)
sql create table db.t408 using db.st tags(8)
sql create table db.t409 using db.st tags(9)
sql create table db.t410 using db.st tags(0)
sql create table db.t411 using db.st tags(1)
sql create table db.t412 using db.st tags(2)
sql create table db.t413 using db.st tags(3)
sql create table db.t414 using db.st tags(4)
sql create table db.t415 using db.st tags(5)
sql create table db.t416 using db.st tags(6)
sql create table db.t417 using db.st tags(7)
sql create table db.t418 using db.st tags(8)
sql create table db.t419 using db.st tags(9)
sql insert into db.t400 values(now, 1)
sql insert into db.t401 values(now, 1)
sql insert into db.t402 values(now, 1)
sql insert into db.t403 values(now, 1)
sql insert into db.t404 values(now, 1)
sql insert into db.t405 values(now, 1)
sql insert into db.t406 values(now, 1)
sql insert into db.t407 values(now, 1)
sql insert into db.t408 values(now, 1)
sql insert into db.t409 values(now, 1)
sql insert into db.t410 values(now, 1)
sql insert into db.t411 values(now, 1)
sql insert into db.t412 values(now, 1)
sql insert into db.t413 values(now, 1)
sql insert into db.t414 values(now, 1)
sql insert into db.t415 values(now, 1)
sql insert into db.t416 values(now, 1)
sql insert into db.t417 values(now, 1)
sql insert into db.t418 values(now, 1)
sql insert into db.t419 values(now, 1)
sql show db.tables
if $rows != 100 then
return -1
endi
sql reset query cache
sleep 1000
sql select * from db.t000
if $rows != 1 then
return -1
endi
sql select * from db.t100
if $rows != 1 then
return -1
endi
sql select * from db.t200
if $rows != 1 then
return -1
endi
sql select * from db.t300
if $rows != 1 then
return -1
endi
sql select * from db.t400
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 100 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/general/db/alter_vgroups.sim
0 → 100644
浏览文件 @
aac2d1c4
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 1000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ step1
sql create database db maxTables 20
sql create table db.st (ts timestamp, i int) tags(t int)
sql create table db.t000 using db.st tags(0)
sql create table db.t001 using db.st tags(1)
sql create table db.t002 using db.st tags(2)
sql create table db.t003 using db.st tags(3)
sql create table db.t004 using db.st tags(4)
sql create table db.t005 using db.st tags(5)
sql create table db.t006 using db.st tags(6)
sql create table db.t007 using db.st tags(7)
sql create table db.t008 using db.st tags(8)
sql create table db.t009 using db.st tags(9)
sql create table db.t010 using db.st tags(0)
sql create table db.t011 using db.st tags(1)
sql create table db.t012 using db.st tags(2)
sql create table db.t013 using db.st tags(3)
sql create table db.t014 using db.st tags(4)
sql create table db.t015 using db.st tags(5)
sql create table db.t016 using db.st tags(6)
sql create table db.t017 using db.st tags(7)
sql create table db.t018 using db.st tags(8)
sql create table db.t019 using db.st tags(9)
sql show db.tables
if $rows != 20 then
return -1
endi
sql insert into db.t000 values(now, 1)
sql insert into db.t001 values(now, 1)
sql insert into db.t002 values(now, 1)
sql insert into db.t003 values(now, 1)
sql insert into db.t004 values(now, 1)
sql insert into db.t005 values(now, 1)
sql insert into db.t006 values(now, 1)
sql insert into db.t007 values(now, 1)
sql insert into db.t008 values(now, 1)
sql insert into db.t009 values(now, 1)
sql insert into db.t010 values(now, 1)
sql insert into db.t011 values(now, 1)
sql insert into db.t012 values(now, 1)
sql insert into db.t013 values(now, 1)
sql insert into db.t014 values(now, 1)
sql insert into db.t015 values(now, 1)
sql insert into db.t016 values(now, 1)
sql insert into db.t017 values(now, 1)
sql insert into db.t018 values(now, 1)
sql insert into db.t019 values(now, 1)
print ============================ step2
sql_error create table db.t100 using db.st tags(10)
sql show db.tables
if $rows != 20 then
return -1
endi
print ============================ step3
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 2
sleep 1000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql create table db.t100 using db.st tags(0)
sql create table db.t101 using db.st tags(1)
sql create table db.t102 using db.st tags(2)
sql create table db.t103 using db.st tags(3)
sql create table db.t104 using db.st tags(4)
sql create table db.t105 using db.st tags(5)
sql create table db.t106 using db.st tags(6)
sql create table db.t107 using db.st tags(7)
sql create table db.t108 using db.st tags(8)
sql create table db.t109 using db.st tags(9)
sql create table db.t110 using db.st tags(0)
sql create table db.t111 using db.st tags(1)
sql create table db.t112 using db.st tags(2)
sql create table db.t113 using db.st tags(3)
sql create table db.t114 using db.st tags(4)
sql create table db.t115 using db.st tags(5)
sql create table db.t116 using db.st tags(6)
sql create table db.t117 using db.st tags(7)
sql create table db.t118 using db.st tags(8)
sql create table db.t119 using db.st tags(9)
sql show db.tables
if $rows != 40 then
return -1
endi
sql insert into db.t100 values(now, 1)
sql insert into db.t101 values(now, 1)
sql insert into db.t102 values(now, 1)
sql insert into db.t103 values(now, 1)
sql insert into db.t104 values(now, 1)
sql insert into db.t105 values(now, 1)
sql insert into db.t106 values(now, 1)
sql insert into db.t107 values(now, 1)
sql insert into db.t108 values(now, 1)
sql insert into db.t109 values(now, 1)
sql insert into db.t110 values(now, 1)
sql insert into db.t111 values(now, 1)
sql insert into db.t112 values(now, 1)
sql insert into db.t113 values(now, 1)
sql insert into db.t114 values(now, 1)
sql insert into db.t115 values(now, 1)
sql insert into db.t116 values(now, 1)
sql insert into db.t117 values(now, 1)
sql insert into db.t118 values(now, 1)
sql insert into db.t119 values(now, 1)
print ============================ step4
sql_error create table db.t200 using db.st tags(10)
sql show db.tables
if $rows != 40 then
return -1
endi
print ============================ step5
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 3
sleep 1000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql create table db.t200 using db.st tags(0)
sql create table db.t201 using db.st tags(1)
sql create table db.t202 using db.st tags(2)
sql create table db.t203 using db.st tags(3)
sql create table db.t204 using db.st tags(4)
sql create table db.t205 using db.st tags(5)
sql create table db.t206 using db.st tags(6)
sql create table db.t207 using db.st tags(7)
sql create table db.t208 using db.st tags(8)
sql create table db.t209 using db.st tags(9)
sql create table db.t210 using db.st tags(0)
sql create table db.t211 using db.st tags(1)
sql create table db.t212 using db.st tags(2)
sql create table db.t213 using db.st tags(3)
sql create table db.t214 using db.st tags(4)
sql create table db.t215 using db.st tags(5)
sql create table db.t216 using db.st tags(6)
sql create table db.t217 using db.st tags(7)
sql create table db.t218 using db.st tags(8)
sql create table db.t219 using db.st tags(9)
sql show db.tables
if $rows != 60 then
return -1
endi
sql insert into db.t200 values(now, 1)
sql insert into db.t201 values(now, 1)
sql insert into db.t202 values(now, 1)
sql insert into db.t203 values(now, 1)
sql insert into db.t204 values(now, 1)
sql insert into db.t205 values(now, 1)
sql insert into db.t206 values(now, 1)
sql insert into db.t207 values(now, 1)
sql insert into db.t208 values(now, 1)
sql insert into db.t209 values(now, 1)
sql insert into db.t210 values(now, 1)
sql insert into db.t211 values(now, 1)
sql insert into db.t212 values(now, 1)
sql insert into db.t213 values(now, 1)
sql insert into db.t214 values(now, 1)
sql insert into db.t215 values(now, 1)
sql insert into db.t216 values(now, 1)
sql insert into db.t217 values(now, 1)
sql insert into db.t218 values(now, 1)
sql insert into db.t219 values(now, 1)
print ============================ step6
sql reset query cache
sleep 1000
sql select * from db.t000
if $rows != 1 then
return -1
endi
sql select * from db.t100
if $rows != 1 then
return -1
endi
sql select * from db.t200
if $rows != 1 then
return -1
endi
sql select * from db.st
if $rows != 60 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/jenkins/basic.txt
浏览文件 @
aac2d1c4
...
...
@@ -44,6 +44,10 @@ cd ../../../debug; make
./test.sh -f general/compute/top.sim
./test.sh -f general/db/alter_option.sim
#./test.sh -f general/db/alter_tables_d2.sim
./test.sh -f general/db/alter_tables_v1.sim
./test.sh -f general/db/alter_tables_v4.sim
./test.sh -f general/db/alter_vgroups.sim
./test.sh -f general/db/basic.sim
./test.sh -f general/db/basic1.sim
./test.sh -f general/db/basic2.sim
...
...
@@ -103,18 +107,18 @@ cd ../../../debug; make
#unsupport ./test.sh -f general/parser/alter_stable.sim
./test.sh -f general/parser/auto_create_tb.sim
./test.sh -f general/parser/auto_create_tb_drop_tb.sim
#liao
./test.sh -f general/parser/col_arithmetic_operation.sim
.
/test.sh -f general/parser/columnValue.sim
#liao
./test.sh -f general/parser/commit.sim
./test.sh -f general/parser/col_arithmetic_operation.sim
#
/test.sh -f general/parser/columnValue.sim
./test.sh -f general/parser/commit.sim
# ./test.sh -f general/parser/create_db.sim
#
./test.sh -f general/parser/create_mt.sim
#
./test.sh -f general/parser/create_tb.sim
#
./test.sh -f general/parser/dbtbnameValidate.sim
./test.sh -f general/parser/create_mt.sim
./test.sh -f general/parser/create_tb.sim
./test.sh -f general/parser/dbtbnameValidate.sim
./test.sh -f general/parser/import_commit1.sim
./test.sh -f general/parser/import_commit2.sim
./test.sh -f general/parser/import_commit3.sim
#
./test.sh -f general/parser/insert_tb.sim
#
./test.sh -f general/parser/first_last.sim
./test.sh -f general/parser/insert_tb.sim
./test.sh -f general/parser/first_last.sim
# ./test.sh -f general/parser/import_file.sim
# ./test.sh -f general/parser/lastrow.sim
# ./test.sh -f general/parser/nchar.sim
...
...
@@ -271,7 +275,7 @@ cd ../../../debug; make
./test.sh -u -f unique/dnode/offline1.sim
#jeff ./test.sh -u -f unique/dnode/offline2.sim
./test.sh -u -f unique/dnode/remove1.sim
#
hongze
./test.sh -u -f unique/dnode/remove2.sim
#
jeff
./test.sh -u -f unique/dnode/remove2.sim
./test.sh -u -f unique/dnode/vnode_clean.sim
./test.sh -u -f unique/http/admin.sim
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录