Skip to content

Commit

Permalink
HPCC-30606 Changes following review
Browse files Browse the repository at this point in the history
Signed-off-by: Shamser Ahmed <shamser.ahmed@lexisnexis.com>
  • Loading branch information
shamser committed Oct 31, 2023
1 parent edcce6d commit 20ea0dc
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions common/wuanalysis/anarule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ class IoSkewRule : public AActivityRule
{
stat_type ioAvg = activity.getStatRaw(stat, StAvgX);
stat_type ioMaxSkew = activity.getStatRaw(stat, StSkewMax);
unsigned actkind = activity.getAttr(WaKind);
if (ioMaxSkew > options.queryOption(watOptSkewThreshold))
{
stat_type timeMaxLocalExecute = activity.getStatRaw(StTimeLocalExecute, StMaxX);
stat_type timeAvgLocalExecute = activity.getStatRaw(StTimeLocalExecute, StAvgX);

stat_type cost;
unsigned actkind = activity.getAttr(WaKind);
if ((actkind==TAKspillread||actkind==TAKspillwrite) && (activity.getStatRaw(stat, StMinX) == 0))
{
//If one node didn't spill then it is possible the skew caused all the lost time
Expand All @@ -144,34 +144,33 @@ class IoSkewRule : public AActivityRule
}
else
{
bool fileSkew = false;
if (stat == StTimeDiskWriteIO)
bool sizeSkew = false;
bool numRowsSkew = false;
IWuEdge *wuEdge = nullptr;
if ((stat==StTimeDiskWriteIO) || (actkind==TAKspillwrite))
{
IWuEdge *inputEdge;
unsigned i=0;
while (!fileSkew && (inputEdge=activity.queryInput(i++)))
{
//output IO is likely to be skewed because # rows written by the workers are skewed
if (inputEdge->getStatRaw(StNumRowsProcessed, StSkewMax)>options.queryOption(watOptSkewThreshold))
fileSkew = true;
}
if (activity.getStatRaw(StSizeDiskWrite)>options.queryOption(watOptSkewThreshold))
sizeSkew = true;
IWuEdge *wuEdge = activity.queryInput(0);
}
if (stat == StTimeDiskReadIO)
else if ((stat == StTimeDiskReadIO) || (actkind==TAKspillread))
{
IWuEdge *outputEdge;
unsigned i=0;
while (!fileSkew && (outputEdge=activity.queryOutput(i++)))
{
//input IO is likely to be skewed because # rows read by the workers are skewed
if (outputEdge->getStatRaw(StNumRowsProcessed, StSkewMax)>options.queryOption(watOptSkewThreshold))
fileSkew = true;
}
if (activity.getStatRaw(StSizeDiskRead)>options.queryOption(watOptSkewThreshold))
sizeSkew = true;
IWuEdge *wuEdge = activity.queryOutput(0);
}
if (wuEdge && wuEdge->getStatRaw(StNumRowsProcessed, StSkewMax)>options.queryOption(watOptSkewThreshold))
numRowsSkew = true;
cost = (timeMaxLocalExecute - timeAvgLocalExecute);
if (fileSkew)
result.set(ANA_IOSKEW_RECORDS_ID, cost, "Significant skew in datafile partitioning is causing uneven %s time", category);
if (sizeSkew)
{
if (numRowsSkew)
result.set(ANA_IOSKEW_RECORDS_ID, cost, "Significant skew in number of records is causing uneven %s time", category);
else
result.set(ANA_IOSKEW_RECORDS_ID, cost, "Significant skew in record sizes is causing uneven %s time", category);
}
else
result.set(ANA_IOSKEW_RECORDS_ID, cost, "Significant skew in IO performance may be causing uneven %s time", category);
result.set(ANA_IOSKEW_RECORDS_ID, cost, "Significant skew in IO performance is causing uneven %s time", category);
}
updateInformation(result, activity);
return true;
Expand Down

0 comments on commit 20ea0dc

Please sign in to comment.