未验证 提交 aa7cbf85 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #7777 from taosdata/hotfix/td-6511

[TD-6511]<fix>:reissue subquery with same buffersize of the original …
...@@ -58,6 +58,7 @@ typedef struct SRetrieveSupport { ...@@ -58,6 +58,7 @@ typedef struct SRetrieveSupport {
int32_t subqueryIndex; // index of current vnode in vnode list int32_t subqueryIndex; // index of current vnode in vnode list
struct SSqlObj *pParentSql; struct SSqlObj *pParentSql;
tFilePage * localBuffer; // temp buffer, there is a buffer for each vnode to tFilePage * localBuffer; // temp buffer, there is a buffer for each vnode to
uint32_t localBufferSize;
uint32_t numOfRetry; // record the number of retry times uint32_t numOfRetry; // record the number of retry times
} SRetrieveSupport; } SRetrieveSupport;
......
...@@ -2593,6 +2593,7 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) { ...@@ -2593,6 +2593,7 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) {
trs->pOrderDescriptor = pDesc; trs->pOrderDescriptor = pDesc;
trs->localBuffer = (tFilePage *)calloc(1, nBufferSize + sizeof(tFilePage)); trs->localBuffer = (tFilePage *)calloc(1, nBufferSize + sizeof(tFilePage));
trs->localBufferSize = nBufferSize + sizeof(tFilePage);
if (trs->localBuffer == NULL) { if (trs->localBuffer == NULL) {
tscError("0x%"PRIx64" failed to malloc buffer for local buffer, orderOfSub:%d, reason:%s", pSql->self, i, strerror(errno)); tscError("0x%"PRIx64" failed to malloc buffer for local buffer, orderOfSub:%d, reason:%s", pSql->self, i, strerror(errno));
tfree(trs); tfree(trs);
...@@ -2713,8 +2714,10 @@ static int32_t tscReissueSubquery(SRetrieveSupport *oriTrs, SSqlObj *pSql, int32 ...@@ -2713,8 +2714,10 @@ static int32_t tscReissueSubquery(SRetrieveSupport *oriTrs, SSqlObj *pSql, int32
memcpy(trsupport, oriTrs, sizeof(*trsupport)); memcpy(trsupport, oriTrs, sizeof(*trsupport));
const uint32_t nBufferSize = (1u << 16u); // 64KB // the buffer size should be the same as tscHandleMasterSTableQuery, which was used to initialize the SColumnModel
trsupport->localBuffer = (tFilePage *)calloc(1, nBufferSize + sizeof(tFilePage)); // the capacity member of SColumnModel will be used to save the trsupport->localBuffer in tscRetrieveFromDnodeCallBack
trsupport->localBuffer = (tFilePage *)calloc(1, oriTrs->localBufferSize);
if (trsupport->localBuffer == NULL) { if (trsupport->localBuffer == NULL) {
tscError("0x%"PRIx64" failed to malloc buffer for local buffer, reason:%s", pSql->self, strerror(errno)); tscError("0x%"PRIx64" failed to malloc buffer for local buffer, reason:%s", pSql->self, strerror(errno));
tfree(trsupport); tfree(trsupport);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册