提交 b8e60b79 编写于 作者: S Shengliang Guan

TD-1894

上级 a1f2ad0d
...@@ -50,6 +50,7 @@ typedef struct { ...@@ -50,6 +50,7 @@ typedef struct {
int32_t fsyncPeriod; int32_t fsyncPeriod;
int32_t fsyncSeq; int32_t fsyncSeq;
int8_t stop; int8_t stop;
int8_t reserved[3];
char path[WAL_PATH_LEN]; char path[WAL_PATH_LEN];
char name[WAL_FILE_LEN]; char name[WAL_FILE_LEN];
pthread_mutex_t mutex; pthread_mutex_t mutex;
......
...@@ -133,9 +133,7 @@ void walClose(void *handle) { ...@@ -133,9 +133,7 @@ void walClose(void *handle) {
while (walGetNextFile(pWal, &fileId) >= 0) { while (walGetNextFile(pWal, &fileId) >= 0) {
snprintf(pWal->name, sizeof(pWal->name), "%s/%s%" PRId64, pWal->path, WAL_PREFIX, fileId); snprintf(pWal->name, sizeof(pWal->name), "%s/%s%" PRId64, pWal->path, WAL_PREFIX, fileId);
if (fileId == pWal->fileId) { if (remove(pWal->name) < 0) {
wDebug("vgId:%d, wal:%p file:%s, it is closed and kept", pWal->vgId, pWal, pWal->name);
} else if (remove(pWal->name) < 0) {
wError("vgId:%d, wal:%p file:%s, failed to remove", pWal->vgId, pWal, pWal->name); wError("vgId:%d, wal:%p file:%s, failed to remove", pWal->vgId, pWal, pWal->name);
} else { } else {
wDebug("vgId:%d, wal:%p file:%s, it is removed", pWal->vgId, pWal, pWal->name); wDebug("vgId:%d, wal:%p file:%s, it is removed", pWal->vgId, pWal, pWal->name);
......
...@@ -8,8 +8,8 @@ sleep 3000 ...@@ -8,8 +8,8 @@ sleep 3000
sql connect sql connect
$i = 0 $i = 0
$dbPrefix = tb_in_db $dbPrefix = d
$tbPrefix = tb_in_tb $tbPrefix = t
$db = $dbPrefix . $i $db = $dbPrefix . $i
$tb = $tbPrefix . $i $tb = $tbPrefix . $i
...@@ -22,28 +22,27 @@ sql create table $tb (ts timestamp, speed int) ...@@ -22,28 +22,27 @@ sql create table $tb (ts timestamp, speed int)
$x = 0 $x = 0
while $x < 10 while $x < 10
$ms = $x . m $cc = $x * 60000
sql insert into $tb values (now + $ms , $x ) $ms = 1601481600000 + $cc
sql insert into $tb values ($ms , $x )
$x = $x + 1 $x = $x + 1
endw endw
print =============== step 2 print =============== step 2
sql insert into $tb values (now - 5m , 10) $x = 0
sql insert into $tb values (now - 6m , 10) while $x < 5
sql insert into $tb values (now - 7m , 10) $cc = $x * 60000
sql insert into $tb values (now - 8m , 10) $ms = 1551481600000 + $cc
sql insert into $tb values ($ms , $x )
$x = $x + 1
endw
sql select * from $tb sql select * from $tb
print $rows points data are retrieved print $rows points data are retrieved
if $rows != 14 then if $rows != 15 then
return -1
endi
sql drop database $db
sleep 1000
sql show databases
if $rows != 0 then
return -1 return -1
endi endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册