提交 8dcbafb7 编写于 作者: H Haojun Liao

enh(query): avoiding unnecessary remove operation.

上级 ae816331
...@@ -507,7 +507,9 @@ void destroyDiskbasedBuf(SDiskbasedBuf* pBuf) { ...@@ -507,7 +507,9 @@ void destroyDiskbasedBuf(SDiskbasedBuf* pBuf) {
dBufPrintStatis(pBuf); dBufPrintStatis(pBuf);
bool needRemoveFile = false;
if (pBuf->pFile != NULL) { if (pBuf->pFile != NULL) {
needRemoveFile = true;
uDebug( uDebug(
"Paged buffer closed, total:%.2f Kb (%d Pages), inmem size:%.2f Kb (%d Pages), file size:%.2f Kb, page " "Paged buffer closed, total:%.2f Kb (%d Pages), inmem size:%.2f Kb (%d Pages), file size:%.2f Kb, page "
"size:%.2f Kb, %s\n", "size:%.2f Kb, %s\n",
...@@ -534,9 +536,14 @@ void destroyDiskbasedBuf(SDiskbasedBuf* pBuf) { ...@@ -534,9 +536,14 @@ void destroyDiskbasedBuf(SDiskbasedBuf* pBuf) {
} }
} }
if (taosRemoveFile(pBuf->path) < 0) { if (needRemoveFile) {
uDebug("WARNING tPage remove file failed. path=%s", pBuf->path); int32_t ret = taosRemoveFile(pBuf->path);
if (ret != 0) { // print the error and discard this error info
int32_t code = TAOS_SYSTEM_ERROR(errno);
uDebug("WARNING tPage remove file failed. path=%s, code:%s", pBuf->path, strerror(code));
}
} }
taosMemoryFreeClear(pBuf->path); taosMemoryFreeClear(pBuf->path);
size_t n = taosArrayGetSize(pBuf->pIdList); size_t n = taosArrayGetSize(pBuf->pIdList);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册