Skip to content

Conversation

@imeoer
Copy link
Collaborator

@imeoer imeoer commented Jan 13, 2026

If the model PVC is already in a bound state but the node hosting it has been taken offline, the previous delete volume process would trust the node IP marked on the PV, but since the node no longer exists, gRPC request sent via that node IP would fail, and then preventing the PV from being deleted.

This fix ensures that during each delete volume operation, we check the node status, if the node no longer exists, we return success directly, allowing the orphaned PV to be cleaned up properly.

If the model PVC is already in a bound state but the node hosting it
has been taken offline, the previous delete volume process would trust
the node IP marked on the PV, but since the node no longer exists,
gRPC request sent via that node IP would fail, and then preventing the
PV from being deleted.

This fix ensures that during each delete volume operation, we check the
node status, if the node no longer exists, we return success directly,
allowing the orphaned PV to be cleaned up properly.

Signed-off-by: imeoer <yansong.ys@antgroup.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello @imeoer, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical reliability issue in the CSI driver's volume deletion mechanism. It ensures that Persistent Volumes can be successfully deprovisioned even when their associated Kubernetes nodes are no longer active or have been removed from the cluster. By introducing a robust check for node existence and handling 'node not found' errors gracefully, the change prevents the accumulation of orphaned PVs, thereby improving the overall stability and resource management within the storage system.

Highlights

  • Improved Volume Deletion Robustness: The pull request enhances the volume deletion process to correctly handle scenarios where the node associated with a Persistent Volume Claim (PVC) is no longer available or has been taken offline.
  • Prevention of Orphaned Persistent Volumes: Previously, if a node hosting a PVC was offline, the deletion process would fail due to gRPC request failures, leading to orphaned PVs. This fix ensures that if the node is not found, the delete operation returns success, allowing the PV to be cleaned up.
  • Node Status Check During Deletion: A new check has been introduced in the remoteDeleteVolume function to verify the existence of the node. If the node is identified as 'not found' via Kubernetes API errors, the system gracefully proceeds with the volume deletion.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@imeoer imeoer marked this pull request as ready for review January 13, 2026 10:57
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses an issue where volume deletion fails if the associated node is offline. The fix correctly handles cases where a node is not found by considering the deletion successful, which is crucial for cleaning up orphaned Persistent Volumes. Additionally, the change improves robustness by always resolving the node name to get the latest IP address, rather than relying on a potentially stale IP stored in the volume's context. The changes look good and effectively solve the described problem. I have one suggestion to improve code maintainability regarding span handling.

Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

@aftersnow aftersnow left a comment

Choose a reason for hiding this comment

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

lgtm

@aftersnow aftersnow merged commit 86fee16 into modelpack:main Jan 13, 2026
9 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