-
Notifications
You must be signed in to change notification settings - Fork 9
controller: fix handling for invalid node name #20
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
Conversation
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>
Summary of ChangesHello @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
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this 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.
chlins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
aftersnow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
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.