other: add debug logs

This commit is contained in:
Cary Xu 2022-07-27 20:56:33 +08:00
parent b5c6d56323
commit 3e2c24d987
2 changed files with 11 additions and 4 deletions

View File

@ -250,11 +250,13 @@ int32_t walBeginSnapshot(SWal *pWal, int64_t ver) {
} }
int32_t walEndSnapshot(SWal *pWal) { int32_t walEndSnapshot(SWal *pWal) {
uInfo("%s:%d rsma: WAL walEndSnapshot entry for %s", __func__, __LINE__, pWal->path);
int32_t code = 0; int32_t code = 0;
taosThreadMutexLock(&pWal->mutex); taosThreadMutexLock(&pWal->mutex);
int64_t ver = pWal->vers.verInSnapshotting; int64_t ver = pWal->vers.verInSnapshotting;
if (ver == -1) { if (ver == -1) {
code = -1; code = -1;
uInfo("%s:%d rsma: WAL walEndSnapshot code = -1 for %s", __func__, __LINE__, pWal->path);
goto END; goto END;
}; };
@ -291,12 +293,15 @@ int32_t walEndSnapshot(SWal *pWal) {
} }
char fnameStr[WAL_FILE_LEN]; char fnameStr[WAL_FILE_LEN];
// remove file // remove file
uInfo("%s:%d rsma: WAL walEndSnapshot deleteCnt=%d %s", __func__, __LINE__, (int32_t)deleteCnt, pWal->path);
for (int i = 0; i < deleteCnt; i++) { for (int i = 0; i < deleteCnt; i++) {
pInfo = taosArrayGet(pWal->fileInfoSet, i); pInfo = taosArrayGet(pWal->fileInfoSet, i);
walBuildLogName(pWal, pInfo->firstVer, fnameStr); walBuildLogName(pWal, pInfo->firstVer, fnameStr);
taosRemoveFile(fnameStr); taosRemoveFile(fnameStr);
uInfo("rsma: removed WAL log file %s", fnameStr);
walBuildIdxName(pWal, pInfo->firstVer, fnameStr); walBuildIdxName(pWal, pInfo->firstVer, fnameStr);
taosRemoveFile(fnameStr); taosRemoveFile(fnameStr);
uInfo("rsma: removed WAL idx file %s", fnameStr);
} }
// make new array, remove files // make new array, remove files
@ -307,6 +312,8 @@ int32_t walEndSnapshot(SWal *pWal) {
} else { } else {
pWal->vers.firstVer = ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, 0))->firstVer; pWal->vers.firstVer = ((SWalFileInfo *)taosArrayGet(pWal->fileInfoSet, 0))->firstVer;
} }
} else {
uInfo("%s:%d rsma: WAL walEndSnapshot %s", __func__, __LINE__, pWal->path);
} }
pWal->writeCur = taosArrayGetSize(pWal->fileInfoSet) - 1; pWal->writeCur = taosArrayGetSize(pWal->fileInfoSet) - 1;
pWal->totSize = newTotSize; pWal->totSize = newTotSize;

View File

@ -49,7 +49,7 @@ $replica = 3
$vgroups = 1 $vgroups = 1
print ============= create database print ============= create database
sql create database db replica $replica vgroups $vgroups sql create database db replica $replica vgroups $vgroups retentions 3s:7d,5s:21d,15s:365d
$loop_cnt = 0 $loop_cnt = 0
check_db_ready: check_db_ready:
@ -113,7 +113,7 @@ endi
vg_ready: vg_ready:
print ====> create stable/child table print ====> create stable/child table
sql create table stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int) sql create table stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int) rollup(max)
sql show stables sql show stables
if $rows != 1 then if $rows != 1 then
@ -132,7 +132,7 @@ print ===> write 100 records
$N = 100 $N = 100
$count = 0 $count = 0
while $count < $N while $count < $N
$ms = 1591200000000 + $count $ms = 1658924000000 + $count
sql insert into ct1 values( $ms , $count , 2.1, 3.1) sql insert into ct1 values( $ms , $count , 2.1, 3.1)
$count = $count + 1 $count = $count + 1
endw endw
@ -149,7 +149,7 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT system sh/exec.sh -n dnode3 -s stop -x SIGINT
sleep 10000
######################################################## ########################################################
print ===> start dnode1 dnode2 dnode3 dnode4 print ===> start dnode1 dnode2 dnode3 dnode4