Skip to content

Conversation

jpmcmu
Copy link
Contributor

@jpmcmu jpmcmu commented Sep 24, 2025

  • Updated hybrid index compressor to use blockcompressed for leafs
  • Modified BlockCompressed nodes to make compression configurable
  • Removed uncompressed pathways from BlockCompressed

Signed-off-by: James McMullan James.McMullan@lexisnexis.com

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:

@Copilot Copilot AI review requested due to automatic review settings September 24, 2025 13:22
Copy link

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

Jirabot Action Result:
Assigning user: james.mcmullan@lexisnexisrisk.com
Workflow Transition To: Merge Pending
Updated PR

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements configurable compression for BlockCompressed index nodes, transitioning from legacy compression to a more flexible block-based approach. The changes enable the HybridIndexCompressor to use BlockCompressed nodes for leaf nodes while maintaining configurable compression methods.

Key changes:

  • Modified HybridIndexCompressor to use BlockCompressed nodes for leaf compression
  • Added configurable compression method support to BlockCompressed nodes with COMPRESS_METHOD_ZSTDS as default
  • Removed legacy uncompressed pathways and simplified compression logic

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
system/jlib/jlzw.hpp Added explicit byte type to CompressionMethod enum
system/jhtree/keybuild.cpp Updated HybridIndexCompressor to use BlockCompressedIndexCompressor for leaf nodes
system/jhtree/jhblockcompressed.hpp Added configurable compression support and new BlockCompressedIndexCompressor class
system/jhtree/jhblockcompressed.cpp Simplified compression logic and removed legacy uncompressed pathways

@jpmcmu jpmcmu force-pushed the HPCC-34656 branch 2 times, most recently from 56c2da5 to de9de84 Compare September 24, 2025 15:15
@jpmcmu jpmcmu requested a review from ghalliday September 24, 2025 15:16
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.

@jpmcmu looks good.
A few items that can be cleaned up.
I would be tempted to leave the compress options to a different PR, and at the same time add logic to reuse the compressor for multiple nodes. (See inplace compressor logic which does that.)
Deleteing the expandedPayload logic can be done as part of the clean up, or as a separate PR.

Other items to do in later PRs include potentially adding a compensating delay, and looking at other potential changes to the node format.


keyLen = _keyHdr->getMaxKeyLength();
keyCompareLen = _keyHdr->getNodeKeyLength();
if (hdr.nodeType == NodeBranch)
Copy link
Member

Choose a reason for hiding this comment

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

Can be deleted - always a leaf node.


protected:
//The following are used for faking payload events
mutable CriticalSection expandPayloadCS;
Copy link
Member

Choose a reason for hiding this comment

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

See the comment above the critical section where it was originally defined to see why it was not a member.

I think I would actually prefer to delete this and the expandedPayload member, and delete the logical associated with it. It doesn't really help to fake the events, and it increases the complication/memory size.

CompressionMethod method = translateToCompMethod(option, COMPRESS_METHOD_NONE);
if (method != COMPRESS_METHOD_NONE)
{
compressionMethod = method;
Copy link
Member

Choose a reason for hiding this comment

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

include some of the logic from the inplace compression to support compression options, both here in "value", and also name="compressopt"

hdr.keyBytes += sizeof(compressionMethod);

//Adjust the fixed key size to include the fileposition field which is written by writekey.
bool rowCompressed = false;
Copy link
Member

Choose a reason for hiding this comment

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

not used I think

size32_t fixedKeySize = isVariable ? 0 : keyLen + sizeof(offset_t);

ICompressHandler * handler = queryCompressHandler(compressionMethod);
compressor.open(keyPtr, maxBytes-hdr.keyBytes, handler, "", isVariable, fixedKeySize);
Copy link
Member

Choose a reason for hiding this comment

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

allow options to be passed -possibly in a follow on PR...

@jpmcmu
Copy link
Contributor Author

jpmcmu commented Oct 1, 2025

@ghalliday pushed up code review changes, I went ahead and added the compressorOptions to this PR but I haven't added in the option to reuse the compressor yet.

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.

@jpmcmu please fix the one issue, and squash.

if (hdr.nodeType == NodeBranch)
keyLen = keyHdr->getNodeKeyLength();

keyLen = keyHdr->getNodeKeyLength();
Copy link
Member

Choose a reason for hiding this comment

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

This is the wrong line - you should have kept .

keyLen = _keyHdr->getMaxKeyLength();

it is always a leaf

- Updated hybrid index compressor to use blockcompressed for leafs
- Modified BlockCompressed nodes to make compression configurable
- Removed uncompressed pathways from BlockCompressed

Signed-off-by: James McMullan James.McMullan@lexisnexis.com
@ghalliday ghalliday merged commit 2287e6f into hpcc-systems:candidate-9.14.x Oct 2, 2025
53 checks passed
Copy link

github-actions bot commented Oct 2, 2025

Jirabot Action Result:
Added fix version: 9.14.26
Workflow Transition: 'Resolve issue'

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.

2 participants