[td-225] update the error code info

This commit is contained in:
Haojun Liao 2020-06-19 11:32:42 +08:00
parent 9c737612d5
commit 4674475509
2 changed files with 10 additions and 11 deletions

View File

@ -413,13 +413,13 @@ static int32_t tscFlushTmpBufferImpl(tExtMemBuffer *pMemoryBuf, tOrderDescriptor
} }
int32_t tscFlushTmpBuffer(tExtMemBuffer *pMemoryBuf, tOrderDescriptor *pDesc, tFilePage *pPage, int32_t orderType) { int32_t tscFlushTmpBuffer(tExtMemBuffer *pMemoryBuf, tOrderDescriptor *pDesc, tFilePage *pPage, int32_t orderType) {
int32_t ret = tscFlushTmpBufferImpl(pMemoryBuf, pDesc, pPage, orderType); int32_t ret = 0;
if (ret != 0) { if ((ret = tscFlushTmpBufferImpl(pMemoryBuf, pDesc, pPage, orderType)) != 0) {
return -1; return ret;
} }
if (!tExtMemBufferFlush(pMemoryBuf)) { if ((ret = tExtMemBufferFlush(pMemoryBuf)) != 0) {
return -1; return ret;
} }
return 0; return 0;

View File

@ -1492,7 +1492,7 @@ static void tscAbortFurtherRetryRetrieval(SRetrieveSupport *trsupport, TAOS_RES
tscError("sub:%p failed to flush data to disk:reason:%s", tres, lpMsgBuf); tscError("sub:%p failed to flush data to disk:reason:%s", tres, lpMsgBuf);
LocalFree(lpMsgBuf); LocalFree(lpMsgBuf);
#else #else
tscError("sub:%p failed to flush data to disk:reason:%s", tres, strerror(errno)); tscError("sub:%p failed to flush data to disk, reason:%s", tres, tstrerror(code));
#endif #endif
SSqlObj* pParentSql = trsupport->pParentSqlObj; SSqlObj* pParentSql = trsupport->pParentSqlObj;
@ -1630,10 +1630,9 @@ static void tscAllDataRetrievedFromDnode(SRetrieveSupport *trsupport, SSqlObj* p
// each result for a vnode is ordered as an independant list, // each result for a vnode is ordered as an independant list,
// then used as an input of loser tree for disk-based merge routine // then used as an input of loser tree for disk-based merge routine
int32_t ret = tscFlushTmpBuffer(trsupport->pExtMemBuffer[idx], pDesc, trsupport->localBuffer, int32_t ret = tscFlushTmpBuffer(trsupport->pExtMemBuffer[idx], pDesc, trsupport->localBuffer, pQueryInfo->groupbyExpr.orderType);
pQueryInfo->groupbyExpr.orderType);
if (ret != 0) { // set no disk space error info, and abort retry if (ret != 0) { // set no disk space error info, and abort retry
return tscAbortFurtherRetryRetrieval(trsupport, pSql, TSDB_CODE_TSC_NO_DISKSPACE); return tscAbortFurtherRetryRetrieval(trsupport, pSql, ret);
} }
int32_t remain = -1; int32_t remain = -1;
@ -1729,7 +1728,7 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR
int32_t ret = saveToBuffer(trsupport->pExtMemBuffer[idx], pDesc, trsupport->localBuffer, pRes->data, int32_t ret = saveToBuffer(trsupport->pExtMemBuffer[idx], pDesc, trsupport->localBuffer, pRes->data,
pRes->numOfRows, pQueryInfo->groupbyExpr.orderType); pRes->numOfRows, pQueryInfo->groupbyExpr.orderType);
if (ret < 0) { // set no disk space error info, and abort retry if (ret != 0) { // set no disk space error info, and abort retry
tscAbortFurtherRetryRetrieval(trsupport, tres, TSDB_CODE_TSC_NO_DISKSPACE); tscAbortFurtherRetryRetrieval(trsupport, tres, TSDB_CODE_TSC_NO_DISKSPACE);
pthread_mutex_unlock(&trsupport->queryMutex); pthread_mutex_unlock(&trsupport->queryMutex);