Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
07961464
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
07961464
编写于
9月 22, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/develop' into feature/crash
上级
f4605ba0
8691e2d8
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
118 addition
and
7 deletion
+118
-7
src/client/src/tscSql.c
src/client/src/tscSql.c
+3
-2
src/connector/go
src/connector/go
+1
-1
src/mnode/src/mnodeShow.c
src/mnode/src/mnodeShow.c
+4
-2
src/util/src/tcache.c
src/util/src/tcache.c
+1
-2
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+1
-0
tests/pytest/insert/retentionpolicy.py
tests/pytest/insert/retentionpolicy.py
+108
-0
未找到文件。
src/client/src/tscSql.c
浏览文件 @
07961464
...
...
@@ -264,12 +264,13 @@ void taos_close(TAOS *taos) {
}
SSqlObj
*
pHb
=
pObj
->
pHb
;
if
(
pHb
!=
NULL
)
{
if
(
pHb
!=
NULL
&&
atomic_val_compare_exchange_ptr
(
&
pObj
->
pHb
,
pHb
,
0
)
==
pHb
)
{
if
(
pHb
->
pRpcCtx
!=
NULL
)
{
// wait for rsp from dnode
rpcCancelRequest
(
pHb
->
pRpcCtx
);
pHb
->
pRpcCtx
=
NULL
;
}
pObj
->
pHb
=
NULL
;
tscDebug
(
"%p, HB is freed"
,
pHb
)
;
taos_free_result
(
pHb
);
}
...
...
go
@
06ec30a0
比较
8c58c512
...
06ec30a0
Subproject commit
8c58c512b6acda8bcdfa48fdc7140227b5221766
Subproject commit
06ec30a0f1762e8169bf6b9045c82bcaa52bcdf0
src/mnode/src/mnodeShow.c
浏览文件 @
07961464
...
...
@@ -65,7 +65,7 @@ int32_t mnodeInitShow() {
mnodeAddReadMsgHandle
(
TSDB_MSG_TYPE_CM_CONNECT
,
mnodeProcessConnectMsg
);
mnodeAddReadMsgHandle
(
TSDB_MSG_TYPE_CM_USE_DB
,
mnodeProcessUseMsg
);
tsMnodeShowCache
=
taosCacheInit
(
TSDB_DATA_TYPE_BIGINT
,
5
,
fals
e
,
mnodeFreeShowObj
,
"show"
);
tsMnodeShowCache
=
taosCacheInit
(
TSDB_DATA_TYPE_BIGINT
,
5
,
tru
e
,
mnodeFreeShowObj
,
"show"
);
return
0
;
}
...
...
@@ -389,10 +389,12 @@ static bool mnodeAccquireShowObj(SShowObj *pShow) {
}
static
void
*
mnodePutShowObj
(
SShowObj
*
pShow
)
{
const
int32_t
DEFAULT_SHOWHANDLE_LIFE_SPAN
=
tsShellActivityTimer
*
6
*
1000
;
if
(
tsMnodeShowCache
!=
NULL
)
{
pShow
->
index
=
atomic_add_fetch_32
(
&
tsShowObjIndex
,
1
);
uint64_t
handleVal
=
(
uint64_t
)
pShow
;
SShowObj
**
ppShow
=
taosCachePut
(
tsMnodeShowCache
,
&
handleVal
,
sizeof
(
int64_t
),
&
pShow
,
sizeof
(
int64_t
),
6000
);
SShowObj
**
ppShow
=
taosCachePut
(
tsMnodeShowCache
,
&
handleVal
,
sizeof
(
int64_t
),
&
pShow
,
sizeof
(
int64_t
),
DEFAULT_SHOWHANDLE_LIFE_SPAN
);
pShow
->
ppShow
=
(
void
**
)
ppShow
;
mDebug
(
"%p, show is put into cache, data:%p index:%d"
,
pShow
,
ppShow
,
pShow
->
index
);
return
pShow
;
...
...
src/util/src/tcache.c
浏览文件 @
07961464
...
...
@@ -266,7 +266,6 @@ void *taosCacheAcquireByKey(SCacheObj *pCacheObj, const void *key, size_t keyLen
if
(
taosHashGetSize
(
pCacheObj
->
pHashTable
)
==
0
)
{
atomic_add_fetch_32
(
&
pCacheObj
->
statistics
.
missCount
,
1
);
uError
(
"cache:%s, key:%p, not in cache, retrieved failed, reason: empty cache"
,
pCacheObj
->
name
,
key
);
return
NULL
;
}
...
...
@@ -280,7 +279,7 @@ void *taosCacheAcquireByKey(SCacheObj *pCacheObj, const void *key, size_t keyLen
uDebug
(
"cache:%s, key:%p, %p is retrieved from cache, refcnt:%d"
,
pCacheObj
->
name
,
key
,
pData
,
T_REF_VAL_GET
(
ptNode
));
}
else
{
atomic_add_fetch_32
(
&
pCacheObj
->
statistics
.
missCount
,
1
);
u
Error
(
"cache:%s, key:%p, not in cache, retrieved failed"
,
pCacheObj
->
name
,
key
);
u
Debug
(
"cache:%s, key:%p, not in cache, retrieved failed"
,
pCacheObj
->
name
,
key
);
}
atomic_add_fetch_32
(
&
pCacheObj
->
statistics
.
totalAccess
,
1
);
...
...
tests/pytest/fulltest.sh
浏览文件 @
07961464
...
...
@@ -16,6 +16,7 @@ python3 ./test.py -f insert/nchar.py
python3 ./test.py
-f
insert/nchar-unicode.py
python3 ./test.py
-f
insert/multi.py
python3 ./test.py
-f
insert/randomNullCommit.py
python3 insert/retentionpolicy.py
python3 ./test.py
-f
table/column_name.py
python3 ./test.py
-f
table/column_num.py
...
...
tests/pytest/insert/retentionpolicy.py
0 → 100644
浏览文件 @
07961464
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
import
os
import
datetime
sys
.
path
.
insert
(
0
,
os
.
getcwd
())
import
taos
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
class
TDTestRetetion
:
def
init
(
self
):
self
.
queryRows
=
0
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdLog
.
info
(
"prepare cluster"
)
tdDnodes
.
init
(
""
)
tdDnodes
.
setTestCluster
(
False
)
tdDnodes
.
setValgrind
(
False
)
tdDnodes
.
stopAll
()
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
print
(
tdDnodes
.
getDnodesRootDir
())
self
.
conn
=
taos
.
connect
(
config
=
tdDnodes
.
getSimCfgPath
())
tdSql
.
init
(
self
.
conn
.
cursor
())
tdSql
.
execute
(
'reset query cache'
)
def
checkRows
(
self
,
expectRows
,
sql
):
if
self
.
queryRows
==
expectRows
:
tdLog
.
info
(
"sql:%s, queryRows:%d == expect:%d"
%
(
sql
,
self
.
queryRows
,
expectRows
))
else
:
caller
=
inspect
.
getframeinfo
(
inspect
.
stack
()[
1
][
0
])
args
=
(
caller
.
filename
,
caller
.
lineno
,
sql
,
self
.
queryRows
,
expectRows
)
os
.
system
(
"timedatectl set-ntp true"
)
tdLog
.
exit
(
"%s(%d) failed: sql:%s, queryRows:%d != expect:%d"
%
args
)
def
run
(
self
):
tdLog
.
info
(
"=============== step1"
)
tdSql
.
execute
(
'create database test keep 3 days 1;'
)
tdSql
.
execute
(
'use test;'
)
tdSql
.
execute
(
'create table test(ts timestamp,i int);'
)
cmd
=
'insert into test values(now-2d,11)(now-1d,11)(now,11)(now+1d,11);'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from test'
)
tdSql
.
checkRows
(
4
)
tdLog
.
info
(
"=============== step2"
)
tdDnodes
.
stop
(
1
)
os
.
system
(
"timedatectl set-ntp false"
)
os
.
system
(
"date -s $(date -d
\"
${DATE} 2 days
\"
\"
+%Y%m%d
\"
)"
)
tdDnodes
.
start
(
1
)
cmd
=
'insert into test values(now,11);'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from test'
)
tdSql
.
checkRows
(
5
)
tdLog
.
info
(
"=============== step3"
)
tdDnodes
.
stop
(
1
)
os
.
system
(
"date -s $(date -d
\"
${DATE} 2 days
\"
\"
+%Y%m%d
\"
)"
)
tdDnodes
.
start
(
1
)
cmd
=
'insert into test values(now-1d,11);'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from test'
)
tdSql
.
checkRows
(
6
)
tdLog
.
info
(
"=============== step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
cmd
=
'insert into test values(now,11);'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from test'
)
tdSql
.
checkRows
(
7
)
tdLog
.
info
(
"=============== step5"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
cmd
=
'select * from test where ts > now-1d'
queryRows
=
tdSql
.
query
(
'select * from test where ts > now-1d'
)
self
.
checkRows
(
1
,
cmd
)
def
stop
(
self
):
os
.
system
(
"timedatectl set-ntp true"
)
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
clients
=
TDTestRetetion
()
clients
.
init
()
clients
.
run
()
clients
.
stop
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录