Skip to content

Commit

Permalink
HPCC-33436 Fix issues caused by HPCC 33279 changes
Browse files Browse the repository at this point in the history
Address regression introduce by HPCC 33279 and improve the changes:
- Fix incorrect change to update to offset branches (regression)
- Use DuplicateKeys instead of DuplicateKeyCount
- Reword comment relating to StSizeBranchMemory and StSizeLeafMemory

Signed-off-by: Shamser Ahmed <[email protected]>
  • Loading branch information
shamser committed Feb 14, 2025
1 parent 1bf6354 commit 6f0984b
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ecl/hthor/hthor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ void CHThorIndexWriteActivity::execute()
reccount++;
}
builder->finish(metadata, &fileCrc, maxRecordSizeSeen);
duplicateKeyCount = builder->getStatistic(StNumDuplicateKeyCount);
duplicateKeyCount = builder->getStatistic(StNumDuplicateKeys);
cummulativeDuplicateKeyCount += duplicateKeyCount;
numLeafNodes = builder->getStatistic(StNumLeafCacheAdds);
numBranchNodes = builder->getStatistic(StNumNodeCacheAdds);
Expand Down
2 changes: 1 addition & 1 deletion roxie/ccd/ccdserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12839,7 +12839,7 @@ class CRoxieServerIndexWriteActivity : public CRoxieServerInternalSinkActivity,
}
reccount++;
}
duplicateKeyCount = builder->getStatistic(StNumDuplicateKeyCount);
duplicateKeyCount = builder->getStatistic(StNumDuplicateKeys);
cummulativeDuplicateKeyCount += duplicateKeyCount;
builder->finish(metadata, &fileCrc, maxRecordSizeSeen);
numLeafNodes = builder->getStatistic(StNumLeafCacheAdds);
Expand Down
2 changes: 1 addition & 1 deletion system/jhtree/keybuild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ class CKeyBuilder : public CInterfaceOf<IKeyBuilder>
{
switch (kind)
{
case StNumDuplicateKeyCount:
case StNumDuplicateKeys:
return duplicateCount;
case StSizeOffsetBranches:
return offsetBranches;
Expand Down
1 change: 0 additions & 1 deletion system/jlib/jstatcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ enum StatisticKind
StNumPeakCacheObjects, // Peak number of objects in a generic cache
StNumCacheDuplicates,
StNumCacheEvictions,
StNumDuplicateKeyCount,
StSizeOffsetBranches,
StSizeBranchMemory,
StSizeLeafMemory,
Expand Down
5 changes: 2 additions & 3 deletions system/jlib/jstats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,10 +999,9 @@ static const constexpr StatisticMeta statsMetaData[StMax] = {
{ PEAKNUMSTAT(PeakCacheObjects), "High water mark for number of objects in a cache"},
{ NUMSTAT(CacheDuplicates), "The number of times an item was added to a cache by two threads at the same time" },
{ NUMSTAT(CacheEvictions), "The number of times an item was evicted from a cache" },
{ NUMSTAT(DuplicateKeyCount), "The number of duplicate keys" },
{ SIZESTAT(OffsetBranches), "The 1st branch node offset position in the index" },
{ SIZESTAT(BranchMemory), "The size of branch memory" },
{ SIZESTAT(LeafMemory), "The size of leaf memory"},
{ SIZESTAT(BranchMemory), "The estimated size of the branch nodes when stored in memory" },
{ SIZESTAT(LeafMemory), "The estimated size of the leaf nodes when stored in memory"},

};

Expand Down
2 changes: 1 addition & 1 deletion thorlcr/activities/indexwrite/thindexwriteslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ class IndexWriteSlaveActivity : public ProcessSlaveActivity, public ILookAheadSt
return;
rowcount_t _processed = processed & THORDATALINK_COUNT_MASK;
mb.append(_processed);
mb.append(inactiveStats.getStatisticValue(StNumDuplicateKeyCount));
mb.append(inactiveStats.getStatisticValue(StNumDuplicateKeys));
if (!singlePartKey || firstNode())
{
StringBuffer partFname;
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/thorutil/thormisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const StatisticsMapping basicActivityStatistics({StNumParallelExecute, StTimeLoo
const StatisticsMapping groupActivityStatistics({StNumGroups, StNumGroupMax}, basicActivityStatistics);
const StatisticsMapping indexReadFileStatistics({}, diskReadRemoteStatistics, jhtreeCacheStatistics);
const StatisticsMapping indexReadActivityStatistics({StNumRowsProcessed}, indexReadFileStatistics, basicActivityStatistics);
const StatisticsMapping indexWriteActivityStatistics({StPerReplicated, StNumLeafCacheAdds, StNumNodeCacheAdds, StNumBlobCacheAdds, StNumDuplicateKeyCount, StSizeOffsetBranches, StSizeBranchMemory, StSizeLeafMemory}, basicActivityStatistics, diskWriteRemoteStatistics);
const StatisticsMapping indexWriteActivityStatistics({StPerReplicated, StNumLeafCacheAdds, StNumNodeCacheAdds, StNumBlobCacheAdds, StNumDuplicateKeys, StSizeOffsetBranches, StSizeBranchMemory, StSizeLeafMemory}, basicActivityStatistics, diskWriteRemoteStatistics);
const StatisticsMapping keyedJoinActivityStatistics({ StNumIndexAccepted, StNumPreFiltered, StNumDiskSeeks, StNumDiskAccepted, StNumDiskRejected}, basicActivityStatistics, indexReadFileStatistics);
const StatisticsMapping commonJoinActivityStatistics({StNumMatchLeftRowsMax, StNumMatchRightRowsMax, StNumMatchCandidates, StNumMatchCandidatesMax}, basicActivityStatistics);
const StatisticsMapping hashJoinActivityStatistics({StNumLeftRows, StNumRightRows}, commonJoinActivityStatistics);
Expand Down
2 changes: 1 addition & 1 deletion tools/dumpkey/dumpkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ int main(int argc, const char **argv)
if (keyBuilder)
{
keyBuilder->finish(metadata, nullptr, maxSizeSeen);
printf("New key has %" I64F "u leaves, %" I64F "u branches, %" I64F "u duplicates\n", keyBuilder->getStatistic(StNumLeafCacheAdds), keyBuilder->getStatistic(StNumNodeCacheAdds), keyBuilder->getStatistic(StNumDuplicateKeyCount));
printf("New key has %" I64F "u leaves, %" I64F "u branches, %" I64F "u duplicates\n", keyBuilder->getStatistic(StNumLeafCacheAdds), keyBuilder->getStatistic(StNumNodeCacheAdds), keyBuilder->getStatistic(StNumDuplicateKeys));
printf("Original key size: %" I64F "u bytes\n", const_cast<IFileIO *>(index->queryFileIO())->size());
printf("New key size: %" I64F "u bytes (%" I64F "u bytes written in %" I64F "u writes)\n", outFileStream->size(), outFileStream->getStatistic(StSizeDiskWrite), outFileStream->getStatistic(StNumDiskWrites));
keyBuilder.clear();
Expand Down

0 comments on commit 6f0984b

Please sign in to comment.