commit
dd05ad2f50
|
@ -9,7 +9,7 @@ pipeline {
|
||||||
stage('Parallel test stage') {
|
stage('Parallel test stage') {
|
||||||
parallel {
|
parallel {
|
||||||
stage('pytest') {
|
stage('pytest') {
|
||||||
agent{label 'master'}
|
agent{label '184'}
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
date
|
date
|
||||||
|
@ -34,7 +34,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('test_b1') {
|
stage('test_b1') {
|
||||||
agent{label '184'}
|
agent{label 'master'}
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
cd ${WKC}
|
cd ${WKC}
|
||||||
|
|
|
@ -61,7 +61,7 @@ The use of each configuration item is:
|
||||||
|
|
||||||
* **port**: This is the `http` service port which enables other application to manage rules by `restful API`.
|
* **port**: This is the `http` service port which enables other application to manage rules by `restful API`.
|
||||||
* **database**: rules are stored in a `sqlite` database, this is the path of the database file (if the file does not exist, the alert application creates it automatically).
|
* **database**: rules are stored in a `sqlite` database, this is the path of the database file (if the file does not exist, the alert application creates it automatically).
|
||||||
* **tdengine**: connection string of `TDEngine` server, note in most cases the database information should be put in a rule, thus it should NOT be included here.
|
* **tdengine**: connection string of `TDEngine` server, note the database name should be put in the `sql` field of a rule in most cases, thus it should NOT be included in the string.
|
||||||
* **log > level**: log level, could be `production` or `debug`.
|
* **log > level**: log level, could be `production` or `debug`.
|
||||||
* **log > path**: log output file path.
|
* **log > path**: log output file path.
|
||||||
* **receivers > alertManager**: the alert application pushes alerts to `AlertManager` at this URL.
|
* **receivers > alertManager**: the alert application pushes alerts to `AlertManager` at this URL.
|
||||||
|
|
|
@ -58,7 +58,7 @@ $ go build
|
||||||
|
|
||||||
* **port**:报警监测程序支持使用 `restful API` 对规则进行管理,这个参数用于配置 `http` 服务的侦听端口。
|
* **port**:报警监测程序支持使用 `restful API` 对规则进行管理,这个参数用于配置 `http` 服务的侦听端口。
|
||||||
* **database**:报警监测程序将规则保存到了一个 `sqlite` 数据库中,这个参数用于指定数据库文件的路径(不需要提前创建这个文件,如果它不存在,程序会自动创建它)。
|
* **database**:报警监测程序将规则保存到了一个 `sqlite` 数据库中,这个参数用于指定数据库文件的路径(不需要提前创建这个文件,如果它不存在,程序会自动创建它)。
|
||||||
* **tdengine**:`TDEngine` 的连接信息,一般来说,数据库信息应该在报警规则中指定,所以这里 **不** 应包含这一部分信息。
|
* **tdengine**:`TDEngine` 的连接字符串,一般来说,数据库名应该在报警规则的 `sql` 语句中指定,所以这个字符串中 **不** 应包含数据库名。
|
||||||
* **log > level**:日志的记录级别,可选 `production` 或 `debug`。
|
* **log > level**:日志的记录级别,可选 `production` 或 `debug`。
|
||||||
* **log > path**:日志文件的路径。
|
* **log > path**:日志文件的路径。
|
||||||
* **receivers > alertManager**:报警监测程序会将报警推送到 `AlertManager`,在这里指定 `AlertManager` 的接收地址。
|
* **receivers > alertManager**:报警监测程序会将报警推送到 `AlertManager`,在这里指定 `AlertManager` 的接收地址。
|
||||||
|
|
|
@ -228,7 +228,7 @@ TDengine采用数据驱动的方式让缓存中的数据写入硬盘进行持久
|
||||||
|
|
||||||
为充分利用时序数据特点,TDengine将一个vnode保存在持久化存储的数据切分成多个文件,每个文件只保存固定天数的数据,这个天数由系统配置参数days决定。切分成多个文件后,给定查询的起止日期,无需任何索引,就可以立即定位需要打开哪些数据文件,大大加快读取速度。
|
为充分利用时序数据特点,TDengine将一个vnode保存在持久化存储的数据切分成多个文件,每个文件只保存固定天数的数据,这个天数由系统配置参数days决定。切分成多个文件后,给定查询的起止日期,无需任何索引,就可以立即定位需要打开哪些数据文件,大大加快读取速度。
|
||||||
|
|
||||||
对于采集的数据,一般有保留时长,这个时长由系统配置参数keep决定。超过这个设置天数的数据文件,将被系统将自动删除,释放存储空间。
|
对于采集的数据,一般有保留时长,这个时长由系统配置参数keep决定。超过这个设置天数的数据文件,将被系统自动删除,释放存储空间。
|
||||||
|
|
||||||
给定days与keep两个参数,一个vnode总的数据文件数为:keep/days。总的数据文件个数不宜过大,也不宜过小。10到100以内合适。基于这个原则,可以设置合理的days。 目前的版本,参数keep可以修改,但对于参数days,一但设置后,不可修改。
|
给定days与keep两个参数,一个vnode总的数据文件数为:keep/days。总的数据文件个数不宜过大,也不宜过小。10到100以内合适。基于这个原则,可以设置合理的days。 目前的版本,参数keep可以修改,但对于参数days,一但设置后,不可修改。
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then
|
||||||
cp -r ${examples_dir}/R ${install_dir}/examples
|
cp -r ${examples_dir}/R ${install_dir}/examples
|
||||||
sed -i '/password/ {s/taosdata/powerdb/g}' ${install_dir}/examples/R/command.txt
|
sed -i '/password/ {s/taosdata/powerdb/g}' ${install_dir}/examples/R/command.txt
|
||||||
cp -r ${examples_dir}/go ${install_dir}/examples
|
cp -r ${examples_dir}/go ${install_dir}/examples
|
||||||
sed -i '/root/ {s/taosdata/powerdb/g}' ${install_dir}/examples/go/src/taosapp/taosapp.go
|
sed -i '/root/ {s/taosdata/powerdb/g}' ${install_dir}/examples/go/taosdemo.go
|
||||||
fi
|
fi
|
||||||
# Copy driver
|
# Copy driver
|
||||||
mkdir -p ${install_dir}/driver
|
mkdir -p ${install_dir}/driver
|
||||||
|
|
|
@ -146,7 +146,7 @@ if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then
|
||||||
cp -r ${examples_dir}/R ${install_dir}/examples
|
cp -r ${examples_dir}/R ${install_dir}/examples
|
||||||
sed -i '/password/ {s/taosdata/powerdb/g}' ${install_dir}/examples/R/command.txt
|
sed -i '/password/ {s/taosdata/powerdb/g}' ${install_dir}/examples/R/command.txt
|
||||||
cp -r ${examples_dir}/go ${install_dir}/examples
|
cp -r ${examples_dir}/go ${install_dir}/examples
|
||||||
sed -i '/root/ {s/taosdata/powerdb/g}' ${install_dir}/examples/go/src/taosapp/taosapp.go
|
sed -i '/root/ {s/taosdata/powerdb/g}' ${install_dir}/examples/go/taosdemo.go
|
||||||
fi
|
fi
|
||||||
# Copy driver
|
# Copy driver
|
||||||
mkdir -p ${install_dir}/driver
|
mkdir -p ${install_dir}/driver
|
||||||
|
|
|
@ -10,6 +10,7 @@ data_dir="/var/lib/taos"
|
||||||
log_dir="/var/log/taos"
|
log_dir="/var/log/taos"
|
||||||
data_link_dir="/usr/local/taos/data"
|
data_link_dir="/usr/local/taos/data"
|
||||||
log_link_dir="/usr/local/taos/log"
|
log_link_dir="/usr/local/taos/log"
|
||||||
|
install_main_dir="/usr/local/taos"
|
||||||
|
|
||||||
# static directory
|
# static directory
|
||||||
cfg_dir="/usr/local/taos/cfg"
|
cfg_dir="/usr/local/taos/cfg"
|
||||||
|
@ -134,6 +135,29 @@ function install_config() {
|
||||||
else
|
else
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# user email
|
||||||
|
#EMAIL_PATTERN='^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$'
|
||||||
|
#EMAIL_PATTERN='^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$'
|
||||||
|
#EMAIL_PATTERN="^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$"
|
||||||
|
echo
|
||||||
|
echo -e -n "${GREEN}Enter your email address for priority support or enter empty to skip${NC}: "
|
||||||
|
read emailAddr
|
||||||
|
while true; do
|
||||||
|
if [ ! -z "$emailAddr" ]; then
|
||||||
|
# check the format of the emailAddr
|
||||||
|
#if [[ "$emailAddr" =~ $EMAIL_PATTERN ]]; then
|
||||||
|
# Write the email address to temp file
|
||||||
|
email_file="${install_main_dir}/email"
|
||||||
|
${csudo} bash -c "echo $emailAddr > ${email_file}"
|
||||||
|
break
|
||||||
|
#else
|
||||||
|
# read -p "Please enter the correct email address: " emailAddr
|
||||||
|
#fi
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: tdengine
|
name: tdengine
|
||||||
base: core18
|
base: core18
|
||||||
version: '2.0.5.1'
|
version: '2.0.6.0'
|
||||||
icon: snap/gui/t-dengine.svg
|
icon: snap/gui/t-dengine.svg
|
||||||
summary: an open-source big data platform designed and optimized for IoT.
|
summary: an open-source big data platform designed and optimized for IoT.
|
||||||
description: |
|
description: |
|
||||||
|
@ -72,7 +72,7 @@ parts:
|
||||||
- usr/bin/taosd
|
- usr/bin/taosd
|
||||||
- usr/bin/taos
|
- usr/bin/taos
|
||||||
- usr/bin/taosdemo
|
- usr/bin/taosdemo
|
||||||
- usr/lib/libtaos.so.2.0.5.1
|
- usr/lib/libtaos.so.2.0.6.0
|
||||||
- usr/lib/libtaos.so.1
|
- usr/lib/libtaos.so.1
|
||||||
- usr/lib/libtaos.so
|
- usr/lib/libtaos.so
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ void dnodeCleanupModules() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tsModule[TSDB_MOD_MNODE].enable && tsModule[TSDB_MOD_MNODE].cleanUpFp) {
|
if (tsModule[TSDB_MOD_MNODE].cleanUpFp) {
|
||||||
(*tsModule[TSDB_MOD_MNODE].cleanUpFp)();
|
(*tsModule[TSDB_MOD_MNODE].cleanUpFp)();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,6 +190,7 @@ void dnodeFreeVnodeWqueue(void *wqueue) {
|
||||||
|
|
||||||
void dnodeSendRpcVnodeWriteRsp(void *pVnode, void *param, int32_t code) {
|
void dnodeSendRpcVnodeWriteRsp(void *pVnode, void *param, int32_t code) {
|
||||||
SWriteMsg *pWrite = (SWriteMsg *)param;
|
SWriteMsg *pWrite = (SWriteMsg *)param;
|
||||||
|
if (pWrite == NULL) return;
|
||||||
|
|
||||||
if (code < 0) pWrite->code = code;
|
if (code < 0) pWrite->code = code;
|
||||||
int32_t count = atomic_add_fetch_32(&pWrite->processedCount, 1);
|
int32_t count = atomic_add_fetch_32(&pWrite->processedCount, 1);
|
||||||
|
|
|
@ -123,16 +123,18 @@ int32_t mnodeInitSystem() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void mnodeCleanupSystem() {
|
void mnodeCleanupSystem() {
|
||||||
mInfo("starting to clean up mnode");
|
if (tsMgmtIsRunning) {
|
||||||
tsMgmtIsRunning = false;
|
mInfo("starting to clean up mnode");
|
||||||
|
tsMgmtIsRunning = false;
|
||||||
|
|
||||||
dnodeFreeMnodeWqueue();
|
dnodeFreeMnodeWqueue();
|
||||||
dnodeFreeMnodeRqueue();
|
dnodeFreeMnodeRqueue();
|
||||||
dnodeFreeMnodePqueue();
|
dnodeFreeMnodePqueue();
|
||||||
mnodeCleanupTimer();
|
mnodeCleanupTimer();
|
||||||
mnodeCleanupComponents(sizeof(tsMnodeComponents) / sizeof(tsMnodeComponents[0]) - 1);
|
mnodeCleanupComponents(sizeof(tsMnodeComponents) / sizeof(tsMnodeComponents[0]) - 1);
|
||||||
|
|
||||||
mInfo("mnode is cleaned up");
|
mInfo("mnode is cleaned up");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mnodeStopSystem() {
|
void mnodeStopSystem() {
|
||||||
|
|
|
@ -6771,7 +6771,7 @@ int32_t qRetrieveQueryResultInfo(qinfo_t qinfo, bool* buildRes, void* pRspContex
|
||||||
|
|
||||||
*buildRes = false;
|
*buildRes = false;
|
||||||
if (IS_QUERY_KILLED(pQInfo)) {
|
if (IS_QUERY_KILLED(pQInfo)) {
|
||||||
qDebug("QInfo:%p query is killed, code:%d", pQInfo, pQInfo->code);
|
qDebug("QInfo:%p query is killed, code:0x%08x", pQInfo, pQInfo->code);
|
||||||
return pQInfo->code;
|
return pQInfo->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7149,13 +7149,20 @@ void** qRegisterQInfo(void* pMgmt, uint64_t qInfo) {
|
||||||
void** qAcquireQInfo(void* pMgmt, uint64_t _key) {
|
void** qAcquireQInfo(void* pMgmt, uint64_t _key) {
|
||||||
SQueryMgmt *pQueryMgmt = pMgmt;
|
SQueryMgmt *pQueryMgmt = pMgmt;
|
||||||
|
|
||||||
if (pQueryMgmt->qinfoPool == NULL || pQueryMgmt->closed) {
|
if (pQueryMgmt->closed) {
|
||||||
|
terrno = TSDB_CODE_VND_INVALID_VGROUP_ID;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pQueryMgmt->qinfoPool == NULL) {
|
||||||
|
terrno = TSDB_CODE_QRY_INVALID_QHANDLE;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
TSDB_CACHE_PTR_TYPE key = (TSDB_CACHE_PTR_TYPE)_key;
|
TSDB_CACHE_PTR_TYPE key = (TSDB_CACHE_PTR_TYPE)_key;
|
||||||
void** handle = taosCacheAcquireByKey(pQueryMgmt->qinfoPool, &key, sizeof(TSDB_CACHE_PTR_TYPE));
|
void** handle = taosCacheAcquireByKey(pQueryMgmt->qinfoPool, &key, sizeof(TSDB_CACHE_PTR_TYPE));
|
||||||
if (handle == NULL || *handle == NULL) {
|
if (handle == NULL || *handle == NULL) {
|
||||||
|
terrno = TSDB_CODE_QRY_INVALID_QHANDLE;
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
return handle;
|
return handle;
|
||||||
|
|
|
@ -174,12 +174,15 @@ static void taosStopTcpThread(SThreadObj* pThreadObj) {
|
||||||
pThreadObj->stop = true;
|
pThreadObj->stop = true;
|
||||||
eventfd_t fd = -1;
|
eventfd_t fd = -1;
|
||||||
|
|
||||||
|
// save thread into local variable since pThreadObj is freed when thread exits
|
||||||
|
pthread_t thread = pThreadObj->thread;
|
||||||
|
|
||||||
if (taosComparePthread(pThreadObj->thread, pthread_self())) {
|
if (taosComparePthread(pThreadObj->thread, pthread_self())) {
|
||||||
pthread_detach(pthread_self());
|
pthread_detach(pthread_self());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosCheckPthreadValid(pThreadObj->thread) && pThreadObj->pollFd >= 0) {
|
if (taosCheckPthreadValid(pThreadObj->thread)) {
|
||||||
// signal the thread to stop, try graceful method first,
|
// signal the thread to stop, try graceful method first,
|
||||||
// and use pthread_cancel when failed
|
// and use pthread_cancel when failed
|
||||||
struct epoll_event event = { .events = EPOLLIN };
|
struct epoll_event event = { .events = EPOLLIN };
|
||||||
|
@ -196,8 +199,9 @@ static void taosStopTcpThread(SThreadObj* pThreadObj) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosCheckPthreadValid(pThreadObj->thread) && pThreadObj->pollFd >= 0) {
|
// at this step, pThreadObj has already been released
|
||||||
pthread_join(pThreadObj->thread, NULL);
|
if (taosCheckPthreadValid(thread)) {
|
||||||
|
pthread_join(thread, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fd != -1) taosCloseSocket(fd);
|
if (fd != -1) taosCloseSocket(fd);
|
||||||
|
|
|
@ -287,16 +287,22 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
|
||||||
|
|
||||||
memset(pRet, 0, sizeof(SRspRet));
|
memset(pRet, 0, sizeof(SRspRet));
|
||||||
|
|
||||||
|
terrno = TSDB_CODE_SUCCESS;
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
void ** handle = qAcquireQInfo(pVnode->qMgmt, pRetrieve->qhandle);
|
void ** handle = qAcquireQInfo(pVnode->qMgmt, pRetrieve->qhandle);
|
||||||
if (handle == NULL || (*handle) != (void *)pRetrieve->qhandle) {
|
if (handle == NULL) {
|
||||||
|
code = terrno;
|
||||||
|
terrno = TSDB_CODE_SUCCESS;
|
||||||
|
} else if ((*handle) != (void *)pRetrieve->qhandle) {
|
||||||
code = TSDB_CODE_QRY_INVALID_QHANDLE;
|
code = TSDB_CODE_QRY_INVALID_QHANDLE;
|
||||||
vDebug("vgId:%d, invalid qhandle in retrieving result, QInfo:%p", pVnode->vgId, (void *)pRetrieve->qhandle);
|
}
|
||||||
|
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
vDebug("vgId:%d, invalid handle in retrieving result, code:0x%08x, QInfo:%p", pVnode->vgId, code, (void *)pRetrieve->qhandle);
|
||||||
vnodeBuildNoResultQueryRsp(pRet);
|
vnodeBuildNoResultQueryRsp(pRet);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pRetrieve->free == 1) {
|
if (pRetrieve->free == 1) {
|
||||||
vWarn("vgId:%d, QInfo:%p, retrieve msg received to kill query and free qhandle", pVnode->vgId, *handle);
|
vWarn("vgId:%d, QInfo:%p, retrieve msg received to kill query and free qhandle", pVnode->vgId, *handle);
|
||||||
qKillQuery(*handle);
|
qKillQuery(*handle);
|
||||||
|
|
|
@ -60,6 +60,7 @@ static int walRestoreWalFile(SWal *pWal, void *pVnode, FWalWrite writeFp);
|
||||||
static int walRemoveWalFiles(const char *path);
|
static int walRemoveWalFiles(const char *path);
|
||||||
static void walProcessFsyncTimer(void *param, void *tmrId);
|
static void walProcessFsyncTimer(void *param, void *tmrId);
|
||||||
static void walRelease(SWal *pWal);
|
static void walRelease(SWal *pWal);
|
||||||
|
static int walGetMaxOldFileId(char *odir);
|
||||||
|
|
||||||
static void walModuleInitFunc() {
|
static void walModuleInitFunc() {
|
||||||
walTmrCtrl = taosTmrInit(1000, 100, 300000, "WAL");
|
walTmrCtrl = taosTmrInit(1000, 100, 300000, "WAL");
|
||||||
|
@ -312,7 +313,7 @@ int walRestore(void *handle, void *pVnode, int (*writeFp)(void *, void *, int))
|
||||||
for (index = minId; index <= maxId; ++index) {
|
for (index = minId; index <= maxId; ++index) {
|
||||||
snprintf(pWal->name, sizeof(pWal->name), "%s/%s%d", opath, walPrefix, index);
|
snprintf(pWal->name, sizeof(pWal->name), "%s/%s%d", opath, walPrefix, index);
|
||||||
terrno = walRestoreWalFile(pWal, pVnode, writeFp);
|
terrno = walRestoreWalFile(pWal, pVnode, writeFp);
|
||||||
if (terrno < 0) break;
|
if (terrno < 0) continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,31 +477,26 @@ int walHandleExistingFiles(const char *path) {
|
||||||
int plen = strlen(walPrefix);
|
int plen = strlen(walPrefix);
|
||||||
terrno = 0;
|
terrno = 0;
|
||||||
|
|
||||||
if (access(opath, F_OK) == 0) {
|
int midx = walGetMaxOldFileId(opath);
|
||||||
// old directory is there, it means restore process is not finished
|
int count = 0;
|
||||||
walRemoveWalFiles(path);
|
while ((ent = readdir(dir)) != NULL) {
|
||||||
|
if (strncmp(ent->d_name, walPrefix, plen) == 0) {
|
||||||
} else {
|
midx++;
|
||||||
// move all files to old directory
|
snprintf(oname, sizeof(oname), "%s/%s", path, ent->d_name);
|
||||||
int count = 0;
|
snprintf(nname, sizeof(nname), "%s/old/wal%d", path, midx);
|
||||||
while ((ent = readdir(dir)) != NULL) {
|
if (taosMkDir(opath, 0755) != 0) {
|
||||||
if (strncmp(ent->d_name, walPrefix, plen) == 0) {
|
wError("wal:%s, failed to create directory:%s(%s)", oname, opath, strerror(errno));
|
||||||
snprintf(oname, sizeof(oname), "%s/%s", path, ent->d_name);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
snprintf(nname, sizeof(nname), "%s/old/%s", path, ent->d_name);
|
break;
|
||||||
if (taosMkDir(opath, 0755) != 0) {
|
|
||||||
wError("wal:%s, failed to create directory:%s(%s)", oname, opath, strerror(errno));
|
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rename(oname, nname) < 0) {
|
|
||||||
wError("wal:%s, failed to move to new:%s", oname, nname);
|
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rename(oname, nname) < 0) {
|
||||||
|
wError("wal:%s, failed to move to new:%s", oname, nname);
|
||||||
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
wDebug("wal:%s, %d files are moved for restoration", path, count);
|
wDebug("wal:%s, %d files are moved for restoration", path, count);
|
||||||
|
@ -563,4 +559,30 @@ int64_t walGetVersion(twalh param) {
|
||||||
if (pWal == 0) return 0;
|
if (pWal == 0) return 0;
|
||||||
|
|
||||||
return pWal->version;
|
return pWal->version;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int walGetMaxOldFileId(char *odir) {
|
||||||
|
int midx = 0;
|
||||||
|
DIR * dir = NULL;
|
||||||
|
struct dirent *dp = NULL;
|
||||||
|
int plen = strlen(walPrefix);
|
||||||
|
|
||||||
|
if (access(odir, F_OK) != 0) return midx;
|
||||||
|
|
||||||
|
dir = opendir(odir);
|
||||||
|
if (dir == NULL) {
|
||||||
|
wError("failed to open directory %s since %s", odir, strerror(errno));
|
||||||
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
while ((dp = readdir(dir)) != NULL) {
|
||||||
|
if (strncmp(dp->d_name, walPrefix, plen) == 0) {
|
||||||
|
int idx = atol(dp->d_name + plen);
|
||||||
|
if (midx < idx) midx = idx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
closedir(dir);
|
||||||
|
return midx;
|
||||||
}
|
}
|
|
@ -20,6 +20,7 @@ python3 insert/retentionpolicy.py
|
||||||
python3 ./test.py -f insert/alterTableAndInsert.py
|
python3 ./test.py -f insert/alterTableAndInsert.py
|
||||||
python3 ./test.py -f insert/insertIntoTwoTables.py
|
python3 ./test.py -f insert/insertIntoTwoTables.py
|
||||||
|
|
||||||
|
python3 ./test.py -f table/alter_wal0.py
|
||||||
python3 ./test.py -f table/column_name.py
|
python3 ./test.py -f table/column_name.py
|
||||||
python3 ./test.py -f table/column_num.py
|
python3 ./test.py -f table/column_num.py
|
||||||
python3 ./test.py -f table/db_table.py
|
python3 ./test.py -f table/db_table.py
|
||||||
|
|
|
@ -39,7 +39,7 @@ class TDTestCase:
|
||||||
|
|
||||||
tdSql.query("select * from t0")
|
tdSql.query("select * from t0")
|
||||||
tdSql.checkRows(1)
|
tdSql.checkRows(1)
|
||||||
tdSql.checkData(0, 0, 1)
|
tdSql.checkData(0, 1, 1)
|
||||||
|
|
||||||
tdSql.query("select * from t1")
|
tdSql.query("select * from t1")
|
||||||
tdSql.checkRows(5)
|
tdSql.checkRows(5)
|
||||||
|
|
|
@ -103,7 +103,7 @@ class TDTestCase:
|
||||||
tdSql.execute('alter table stb add tag tnc nchar(10)')
|
tdSql.execute('alter table stb add tag tnc nchar(10)')
|
||||||
for tid in range(1, self.ntables + 1):
|
for tid in range(1, self.ntables + 1):
|
||||||
tdSql.execute('alter table tb%d set tag tnc=\"%s\"' %
|
tdSql.execute('alter table tb%d set tag tnc=\"%s\"' %
|
||||||
(tid, str(tid * 1.2)))
|
(tid, str(tid + 1000000000)))
|
||||||
tdLog.info("insert %d data in to each %d tables" % (2, self.ntables))
|
tdLog.info("insert %d data in to each %d tables" % (2, self.ntables))
|
||||||
for rid in range(self.rowsPerTable + 1, self.rowsPerTable + 3):
|
for rid in range(self.rowsPerTable + 1, self.rowsPerTable + 3):
|
||||||
sqlcmd = ['insert into']
|
sqlcmd = ['insert into']
|
||||||
|
|
|
@ -52,10 +52,10 @@ sleep 1000
|
||||||
|
|
||||||
sql use $db
|
sql use $db
|
||||||
sql drop table tb5
|
sql drop table tb5
|
||||||
|
$i = 0
|
||||||
while $i < 4
|
while $i < 4
|
||||||
$tbId = $i + $halfNum
|
|
||||||
$tb = $tbPrefix . $i
|
$tb = tb . $i
|
||||||
$x = 0
|
$x = 0
|
||||||
while $x < $rowNum
|
while $x < $rowNum
|
||||||
$xs = $x * $delta
|
$xs = $x * $delta
|
||||||
|
|
Loading…
Reference in New Issue