Skip to content

HPCC-33929 Fix the publication of duplicate stats in thor index write #19798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: candidate-9.10.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions thorlcr/activities/indexwrite/thindexwrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class IndexWriteActivityMaster : public CMasterActivity
{
rowcount_t recordsProcessed = 0;
unsigned __int64 duplicateKeyCount = 0;
unsigned __int64 cummulativeDuplicateKeyCount = 0;
offset_t compressedFileSize = 0;
offset_t uncompressedSize = 0;
offset_t originalBlobSize = 0;
Expand Down Expand Up @@ -244,7 +243,6 @@ class IndexWriteActivityMaster : public CMasterActivity
IHThorIndexWriteArg *helper = (IHThorIndexWriteArg *)queryHelper();
updateActivityResult(container.queryJob().queryWorkUnit(), 0, helper->getSequence(), fileName, recordsProcessed);

cummulativeDuplicateKeyCount += duplicateKeyCount;
// MORE - add in the extra entry somehow
if (fileName.get())
{
Expand Down Expand Up @@ -326,6 +324,7 @@ class IndexWriteActivityMaster : public CMasterActivity
mb.read(r);
mb.read(slaveDuplicateKeyCount);

statsCollection.setStatistic(slaveIdx, StNumDuplicateKeys, slaveDuplicateKeyCount);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this line is necessary. I believe statsCollection should already have StNumDuplicateKeys. On the slaves, mb.read(slaveDuplicateKeyCount) is serialized from CRuntimeStatisticCollection inactiveStats/activeStats.

recordsProcessed += r;
duplicateKeyCount += slaveDuplicateKeyCount;

Expand Down Expand Up @@ -403,7 +402,6 @@ class IndexWriteActivityMaster : public CMasterActivity
virtual void getActivityStats(IStatisticGatherer & stats) override
{
CMasterActivity::getActivityStats(stats);
stats.addStatistic(StNumDuplicateKeys, cummulativeDuplicateKeyCount);
diskAccessCost = calcDiskWriteCost(clusters, statsCollection.getStatisticSum(StNumDiskWrites));
if (diskAccessCost)
stats.addStatistic(StCostFileAccess, diskAccessCost);
Expand Down
Loading