Skip to content

HPCC-33988 Allow containerized XRef to delete found file parts #19822

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

Merged
merged 1 commit into from
May 22, 2025

Conversation

jackdelv
Copy link
Contributor

@jackdelv jackdelv commented May 2, 2025

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:

@jackdelv jackdelv requested a review from Copilot May 2, 2025 12:52
Copy link

github-actions bot commented May 2, 2025

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

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

Copy link

@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 pull request addresses HPCC-33988 by enhancing the deletion process for found file parts in a containerized XRef environment. Key changes include:

  • Adding new properties “NumStripedDevices” and “IsDirPerPart” in the XRef manager.
  • Incorporating stripe-aware path building in the DFU XRef file removal logic.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
dali/sasha/saxref.cpp Sets new properties for striped devices and dir parts
dali/dfuXRefLib/XRefFilesNode.cpp Updates file expansion logic to handle stripe numbers and directory-per-part option
Comments suppressed due to low confidence (1)

dali/dfuXRefLib/XRefFilesNode.cpp:195

  • The condition 'if (stripeNum)' will fail to execute if stripeNum equals 0. Verify that a stripe number of 0 is intended to be skipped, or adjust the condition if 0 is a valid stripe value.
if (stripeNum)

@jackdelv jackdelv requested a review from jakesmith May 2, 2025 12:53
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.

@jackdelv - look ok, 1 question

if (isDirPerPart)
addPathSepChar(remoteFile.append(partNum));

expandMask(remoteFile, fileMask, partNum-1, numparts);
Copy link
Member

Choose a reason for hiding this comment

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

not directly related, but the code below is for replicas, which containerized doesn't support.
Can you make it conditional in a separate PR? (and check for similar code that doesn't apply if containerized)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -1411,6 +1411,8 @@ class CNewXRefManager: public CNewXRefManagerBase
branch[drv]->setPropInt64("Size",totsize[drv]);
branch[drv]->setProp("Modified",mostrecent[drv].getString(tmp.clear()));
branch[drv]->setPropInt("Numparts",f->N);
branch[drv]->setPropInt("NumStripedDevices",numStripedDevices);
Copy link
Member

Choose a reason for hiding this comment

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

rather than add this to every entry, for potential use by CXRefFilesNode::AttachPhysical, can CXRefFilesNode::AttachPhysical lookup numdevices since it knows which 'cluster' it is dealing with?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, added a function for looking up the numDevices from the storage plane.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, this PR is just fixing CXRefFilesNode::RemovePhysical, but this issue does exist in AttachPhysical as well. Should that fix be added in this PR, or in the existing issue open for it?

Copy link
Member

Choose a reason for hiding this comment

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

I think best to keep this PR focus on remove physical, the similar attach physical issues can be fixed in HPCC-33976

Copy link
Contributor Author

@jackdelv jackdelv left a comment

Choose a reason for hiding this comment

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

@jakesmith I left some responses to your question. Back to you.

if (isDirPerPart)
addPathSepChar(remoteFile.append(partNum));

expandMask(remoteFile, fileMask, partNum-1, numparts);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -1411,6 +1411,8 @@ class CNewXRefManager: public CNewXRefManagerBase
branch[drv]->setPropInt64("Size",totsize[drv]);
branch[drv]->setProp("Modified",mostrecent[drv].getString(tmp.clear()));
branch[drv]->setPropInt("Numparts",f->N);
branch[drv]->setPropInt("NumStripedDevices",numStripedDevices);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, added a function for looking up the numDevices from the storage plane.

@@ -1411,6 +1411,8 @@ class CNewXRefManager: public CNewXRefManagerBase
branch[drv]->setPropInt64("Size",totsize[drv]);
branch[drv]->setProp("Modified",mostrecent[drv].getString(tmp.clear()));
branch[drv]->setPropInt("Numparts",f->N);
branch[drv]->setPropInt("NumStripedDevices",numStripedDevices);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, this PR is just fixing CXRefFilesNode::RemovePhysical, but this issue does exist in AttachPhysical as well. Should that fix be added in this PR, or in the existing issue open for it?

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.

@jackdelv - looks good, 1 suggestion.

@@ -24,6 +24,23 @@
#include "jlzw.hpp"
#include "dautils.hpp"


static unsigned lookupNumStripedDevices(const char *clusterName)
Copy link
Member

Choose a reason for hiding this comment

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

looks good as a function, I think probably of general use, and should move into dautils.* along with similar functions - perhaps call it "getNumPlaneStripes"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to dautils and renamed to getNumPlaneStripes.

@jackdelv jackdelv requested a review from jakesmith May 16, 2025 14:49
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.

@jackdelv - looks good. Please squash.

@jackdelv
Copy link
Contributor Author

@jakesmith Squashed.

@ghalliday ghalliday merged commit 11a03cf into hpcc-systems:candidate-9.12.x May 22, 2025
26 of 32 checks passed
Copy link

Jirabot Action Result:
Added fix version: 9.12.6
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.

3 participants