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-31463 Roxie should use plane setting for read block size #18429

Closed

Conversation

richardkchapman
Copy link
Member

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:

@richardkchapman
Copy link
Member Author

I struggled to find a way to test this - plane configuration is a bit of a black art.

@@ -1059,9 +1065,12 @@ class CRoxieFileCache : implements IRoxieFileCache, implements ICopyFileProgress
const char *kind = fdesc.queryKind();
if (kind && streq(kind, "key"))
isKey = true;
StringBuffer planeName;
fdesc.getClusterLabel(pdesc->copyClusterNum(0), planeName);
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if this is the right call to get the plane name that this file lives on?

Copy link
Member

Choose a reason for hiding this comment

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

Should be good to do this way.

current.setown(f->open(IFOread));
if (current && blockedIOsize)
Copy link
Member

@jakesmith jakesmith Mar 22, 2024

Choose a reason for hiding this comment

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

future: we should probably also use blockedIOsize for compressed files (if significantly above the compressed block size)

jakesmith
jakesmith previously approved these changes Mar 22, 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.

@richardkchapman - looks good. Should this target 9.6?

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.

One comment.

Also, I don't think this provides any way to configure a bare-metal system. One solution would be to have a roxie configuration default. That would provide a simple way of experimenting with different values to explore the effects.

@@ -1059,9 +1065,12 @@ class CRoxieFileCache : implements IRoxieFileCache, implements ICopyFileProgress
const char *kind = fdesc.queryKind();
if (kind && streq(kind, "key"))
isKey = true;
StringBuffer planeName;
fdesc.getClusterLabel(pdesc->copyClusterNum(0), planeName);
blockedSize = getBlockedFileIOSize(planeName);
Copy link
Member

Choose a reason for hiding this comment

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

This needs to use a different variable/property of the storage plane. It is likely that we want to use 1MB when reading an index sequentially, but only 32/64K when reading it randomly.

Copy link
Member

Choose a reason for hiding this comment

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

hm, ok, perhaps pass a accessmode type flag to getBlockedFileIOSize, with it determining (via new prop. if available)

current.setown(f->open(IFOread));
if (current && blockedIOsize)
current.setown(createBlockedIO(current.getClear(), blockedIOsize));
Copy link
Member

Choose a reason for hiding this comment

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

I've just realised... this class is not thread-safe, so can't be used for index shared-random access.

I'm not sure what we do about that because we want to allow concurrent access - so a critical section would not be a good idea.

Copy link
Member

Choose a reason for hiding this comment

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

the blocked io class isn't thread safe, but isn't jhtree when it uses this IO, guaranteeing that it only loads from it (from CDiskKeyIndex::loadNode), in a mutex protected thread?

@jakesmith jakesmith self-requested a review March 22, 2024 14:38
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.

ignore - can't delete this message

Copy link
Contributor

@mckellyln mckellyln left a comment

Choose a reason for hiding this comment

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

Looks ok to me, but I am not too familiar with possible subtle details.
Why does CBlockedFileIO->read() not read into data, but into a MemoryBuffer and then copies ?

@ghalliday ghalliday requested a review from jakesmith May 15, 2024 15:00
@jakesmith
Copy link
Member

Closing - functionality was merged with #18672

@jakesmith jakesmith closed this May 30, 2024
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.

4 participants