Skip to content
Permalink
Browse files
HAWQ-585. Fix bug that invalid execution statistics received stats no…
…de-count mismatch
  • Loading branch information
ztao1987 committed Mar 25, 2016
1 parent 53fef54 commit 7c2bce6266f776283f9c007d3351d17f7fc2991a
Showing 1 changed file with 5 additions and 2 deletions.
@@ -503,6 +503,7 @@ cdbexplain_recvExecStats(struct PlanState *planstate,
int iDispatch;
int nDispatch;
int imsgptr;
bool isFirstValidateStat = true;

if (!planstate ||
!planstate->instrument ||
@@ -597,7 +598,7 @@ cdbexplain_recvExecStats(struct PlanState *planstate,
}

/* Slice should have same number of plan nodes on every qExec. */
if (iDispatch == 0)
if (isFirstValidateStat)
ctx.nStatInst = hdr->nInst;
else
{
@@ -614,13 +615,15 @@ cdbexplain_recvExecStats(struct PlanState *planstate,
}

/* Save lowest and highest segment id for which we have stats. */
if (iDispatch == 0)
if (isFirstValidateStat)
ctx.segindexMin = ctx.segindexMax = hdr->segindex;
else if (ctx.segindexMax < hdr->segindex)
ctx.segindexMax = hdr->segindex;
else if (ctx.segindexMin > hdr->segindex)
ctx.segindexMin = hdr->segindex;

if (isFirstValidateStat) isFirstValidateStat = false;

/* Save message ptr for easy reference. */
ctx.msgptrs[ctx.nmsgptr] = hdr;
ctx.nmsgptr++;

0 comments on commit 7c2bce6

Please sign in to comment.