Skip to content
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

HPCC-31648 New StSizePeakEphemeralDisk and StSizePeakTempDisk for sort #18573

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

shamser
Copy link
Contributor

@shamser shamser commented Apr 23, 2024

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

Copy link

Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-31648

Jirabot Action Result:
Workflow Transition: Merge Pending
Updated PR

@shamser shamser force-pushed the issue31648 branch 2 times, most recently from 4c59da4 to 59a2343 Compare April 25, 2024 11:20
@shamser shamser requested a review from jakesmith April 25, 2024 11:21
@shamser shamser marked this pull request as ready for review April 25, 2024 12:38
jakesmith
jakesmith previously approved these changes Apr 25, 2024
Copy link
Member

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

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

@shamser - approving, but see comment re. offset_t.

Copy link
Member

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

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

@shamser - commenting to take of my review list. Please rebase once #18482 is merged.

@shamser shamser changed the title HPCC-31648 New StSizePeakEphemeralStorage and StSizePeakSubgraphTemp for sort HPCC-31648 New StSizePeakEphemeralDisk and StSizePeakTempDisk for sort May 30, 2024
@shamser shamser requested a review from jakesmith May 30, 2024 10:40
Copy link
Member

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

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

@shamser - I think looks good, but it covers Local sort, but only partially covers global sort.

Global sort also spills in tsorts.cpp - CWriteIntercept::write.

I think it would be worth covering that case too, otherwise results are going to be misleading when there's a global sort involved.

rows.kill(); // no longer needed, readers will pull from spillFile. NB: ok to kill array as rows is never written to or expanded
spillFile->noteSize(iFile->size());
Copy link
Member

Choose a reason for hiding this comment

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

When faster updates are revisited, may want to move this into save with a lower granularity (e.g. update ever second or every 1k records, within save).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shamser shamser force-pushed the issue31648 branch 6 times, most recently from 4949830 to 9479eb4 Compare June 11, 2024 15:03
@shamser shamser requested a review from jakesmith June 11, 2024 15:12
Copy link
Member

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

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

@shamser - 1 issue.

@@ -91,6 +91,7 @@ class CWriteIntercept : public CSimpleInterface
if (idxFileStream.get())
{
idxFileStream->write(sizeof(o),&o);
idxFile->noteSize(idxFileIO->getStatistic(StSizeDiskWrite));
Copy link
Member

Choose a reason for hiding this comment

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

writeidxofs is going to be called per row, this should be moved to after the idxFileStream->flush() (~ line 268)

@shamser shamser requested a review from jakesmith June 12, 2024 08:54
Copy link
Member

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

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

@shamser - looks good, please squash.

Copy link
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

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

@shamser looks good. One question about noteSize(). A couple of style comments, but no expectation for change - especially not this PR.

fileSize = size;
if (fileSizeTracker)
fileSizeTracker->growSize(fileSize);
if (fileSizeTracker && fileSize!=size)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this still be setting fileSize if fileSizeTracker is null?

@@ -1619,6 +1619,7 @@ class CThorRowCollectorBase : public CSpillable
protected:
CThorSpillableRowArray spillableRows;
IPointerArrayOf<CFileOwner> spillFiles;
Linked<CFileSizeTracker> tempFileSizeTracker;
Copy link
Member

Choose a reason for hiding this comment

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

minor: Don't really need to save because it can be accessed via activity member.

idxFile.setown(createIFile(tempname.str()));
idxFileIO.setown(idxFile->open(IFOcreaterw));
Owned<IFile> tmpFile = createIFile(tempname.str());
idxFile.setown(new CFileOwner(tmpFile, activity.queryTempFileSizeTracker()));
Copy link
Member

Choose a reason for hiding this comment

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

I would be tempted to add a helper function so this could be

idxFile.setown(activity.createOwnedTempFile(tmpFile))

or even

idxFile.setown(activity.createOwnedTempFile(tempname))

To clarify the code, reduce duplication and improve encapsulation.

Not for this PR though.

Copy link
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

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

@shamser please squash and I will merge into the next rc

Signed-off-by: Shamser Ahmed <[email protected]>

HPCC-31648 Changes following review

Signed-off-by: Shamser Ahmed <[email protected]>
@ghalliday ghalliday merged commit 9421449 into hpcc-systems:candidate-9.6.x Jun 14, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants