Skip to content

Conversation

@timothyklemm
Copy link
Contributor

@timothyklemm timothyklemm commented Oct 17, 2025

Update the index event model configuration:

  • storage is an optional element; and
  • storage/plane is an optional element; and
  • storage/file, already optional, is allowed only when storage/plane is defined.

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:

Update the index event model configuration:
- `storage` is an optional element; and
- `storage/plane` is an optional element; and
- `storage/file`, already optional, is allowed only when `storage/plane`
  is defined.
Copilot AI review requested due to automatic review settings October 17, 2025 13:25
Copy link
Contributor

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 makes the storage configuration optional in the index event model, allowing the model to work without storage plane definitions. When storage configuration is absent, read times can be provided directly in events via the ReadTime attribute.

Key changes:

  • Storage configuration becomes optional at multiple levels (storage element, plane element, and their interdependencies)
  • When no storage planes are configured, the model extracts read times directly from event attributes
  • Added validation to prevent invalid configurations (e.g., file configurations without plane definitions)

Reviewed Changes

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

File Description
eventindexmodelstorage.cpp Implements optional storage modeling by checking for empty planes, extracting read times from events when no planes exist, and adding validation to prevent file configs without planes
eventindexmodel.hpp Updates method signature to pass full event object instead of individual attributes, removes outdated configuration documentation
eventindexmodel.cpp Makes storage configuration optional, updates method calls to pass event objects, adds three test cases for no-storage scenarios
README.md Updates documentation to reflect optional storage and plane elements with proper constraints


void Storage::observeFile(__uint64 fileId, const char* path)
{
// don't observe files when no modeling is configured
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

The comment is misleading. The check planes.empty() only verifies that no storage planes are configured, not that modeling is entirely disabled. Memory modeling could still be active. Consider: 'don't observe files when no storage planes are configured'.

Suggested change
// don't observe files when no modeling is configured
// don't observe files when no storage planes are configured

Copilot uses AI. Check for mistakes.
{
bool haveDefault = false;
Owned<IPropertyTreeIterator> it = config.getElements("file");
if (it->first() && planes.empty())
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

The call to it->first() consumes the iterator position. This means the subsequent ForEach(*it) at line 158 will skip the first file element. The check should use it->isValid() after calling first() and then reset the iterator, or restructure to avoid consuming the iterator.

Suggested change
if (it->first() && planes.empty())
if (it->isValid() && planes.empty())

Copilot uses AI. Check for mistakes.
if (!node)
throw makeStringException(-1, "index event model configuration missing required <storage> element");
storage.configure(*node);
if (node)
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

[nitpick] The change makes storage optional, but there's no corresponding update to handle the case where storage is present but empty (e.g., <storage/>). While the code may handle this through planes.empty() checks in Storage, it would be clearer to explicitly document this behavior or add a validation that an empty storage element is equivalent to omission.

Suggested change
if (node)
// Treat an empty <storage/> element as equivalent to omission.
if (node && (node->hasChildren() || node->getNumProps() > 0))

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

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

Jirabot Action Result:
Workflow Transition To: Merge Pending
Updated PR

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.

1 participant