提交 b12e12f8 编写于 作者: H hjxilinx

add some logs for release resource at vnode side

上级 8833fc69
...@@ -221,20 +221,20 @@ enum _syncstatus { ...@@ -221,20 +221,20 @@ enum _syncstatus {
#define TSDB_MAX_RPC_THREADS 5 #define TSDB_MAX_RPC_THREADS 5
#define TSDB_QUERY_TYPE_QUERY 0 // normal query #define TSDB_QUERY_TYPE_QUERY 0 // normal query
#define TSDB_QUERY_TYPE_FREE_RESOURCE 0x1 // free qhandle at vnode #define TSDB_QUERY_TYPE_FREE_RESOURCE 0x01U // free qhandle at vnode
/* /*
* 1. ordinary sub query for select * from super_table * 1. ordinary sub query for select * from super_table
* 2. all sqlobj generated by createSubqueryObj with this flag * 2. all sqlobj generated by createSubqueryObj with this flag
*/ */
#define TSDB_QUERY_TYPE_SUBQUERY 0x2 #define TSDB_QUERY_TYPE_SUBQUERY 0x02U
#define TSDB_QUERY_TYPE_STABLE_SUBQUERY 0x4 // two-stage subquery for super table #define TSDB_QUERY_TYPE_STABLE_SUBQUERY 0x04U // two-stage subquery for super table
#define TSDB_QUERY_TYPE_TABLE_QUERY 0x8 // query ordinary table; below only apply to client side #define TSDB_QUERY_TYPE_TABLE_QUERY 0x08U // query ordinary table; below only apply to client side
#define TSDB_QUERY_TYPE_STABLE_QUERY 0x10 // query on super table #define TSDB_QUERY_TYPE_STABLE_QUERY 0x10U // query on super table
#define TSDB_QUERY_TYPE_JOIN_QUERY 0x20 // join query #define TSDB_QUERY_TYPE_JOIN_QUERY 0x20U // join query
#define TSDB_QUERY_TYPE_PROJECTION_QUERY 0x40 // select *,columns... query #define TSDB_QUERY_TYPE_PROJECTION_QUERY 0x40U // select *,columns... query
#define TSDB_QUERY_TYPE_JOIN_SEC_STAGE 0x80 // join sub query at the second stage #define TSDB_QUERY_TYPE_JOIN_SEC_STAGE 0x80U // join sub query at the second stage
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -385,14 +385,21 @@ void vnodeExecuteRetrieveReq(SSchedMsg *pSched) { ...@@ -385,14 +385,21 @@ void vnodeExecuteRetrieveReq(SSchedMsg *pSched) {
pRetrieve = (SRetrieveMeterMsg *)pMsg; pRetrieve = (SRetrieveMeterMsg *)pMsg;
pRetrieve->free = htons(pRetrieve->free); pRetrieve->free = htons(pRetrieve->free);
if ((pRetrieve->free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE) {
dTrace("retrieve msg, handle:%p, free:%d", pRetrieve->qhandle, pRetrieve->free);
} else {
dTrace("retrieve msg to free resource from client, handle:%p, free:%d", pRetrieve->qhandle, pRetrieve->free);
}
/* /*
* in case of server restart, apps may hold qhandle created by server before restart, * in case of server restart, apps may hold qhandle created by server before restart,
* which is actually invalid, therefore, signature check is required. * which is actually invalid, therefore, signature check is required.
*/ */
if (pRetrieve->qhandle == (uint64_t)pObj->qhandle) { if (pRetrieve->qhandle == (uint64_t)pObj->qhandle) {
// if free flag is set, client wants to clean the resources // if free flag is set, client wants to clean the resources
if ((pRetrieve->free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE) if ((pRetrieve->free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE) {
code = vnodeRetrieveQueryInfo((void *)(pRetrieve->qhandle), &numOfRows, &rowSize, &timePrec); code = vnodeRetrieveQueryInfo((void *)(pRetrieve->qhandle), &numOfRows, &rowSize, &timePrec);
}
} else { } else {
dError("QInfo:%p, qhandle:%p is not matched with saved:%p", pObj->qhandle, pRetrieve->qhandle, pObj->qhandle); dError("QInfo:%p, qhandle:%p is not matched with saved:%p", pObj->qhandle, pRetrieve->qhandle, pObj->qhandle);
code = TSDB_CODE_INVALID_QHANDLE; code = TSDB_CODE_INVALID_QHANDLE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册