Skip to content
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

[csi] Add NodeStageVolume and NodeUnstageVolume #24

Merged
merged 19 commits into from
Apr 25, 2024
Merged

Conversation

AleksZimin
Copy link
Member

@AleksZimin AleksZimin commented Mar 31, 2024

Description

This PR introduces the NodeStageVolume and NodeUnstageVolume methods to our CSI driver. These methods enhance the handling of multi-attach scenarios for the same volume across multiple containers. Specifically, NodeStageVolume is responsible for preparing the volume, including filesystem creation (if needed) and performing the initial mount. Subsequently, the NodePublishVolume step performs a bind mount to make the volume available to the container. To ensure thread safety and prevent concurrent processing issues, we have also implemented a map that tracks volumes currently being processed.

Why do we need it, and what problem does it solve?

Adding NodeStageVolume and NodeUnstageVolume addresses the challenge of correctly managing volumes that are attached to multiple containers simultaneously, particularly in filesystem mode. Previously, handling simultaneous attachments could lead to errors or race conditions, especially when operations like filesystem creation were involved. By separating the mount and bind mount stages and introducing a tracking mechanism for volume processing, we enhance the robustness and reliability of our volume management.

What is the expected result?

  • Enhanced support for multi-attach volume scenarios, ensuring that volumes attached to multiple containers are managed safely and efficiently.
  • Prevention of race conditions and errors during volume setup, especially when performing filesystem operations.
  • Improved overall reliability and performance of the CSI driver in complex deployment environments.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

@AleksZimin AleksZimin added the bug Something isn't working label Mar 31, 2024
@AleksZimin AleksZimin self-assigned this Mar 31, 2024
@AleksZimin AleksZimin changed the title [csi] Fix NodePublishVolume [csi] Add stage/unstage Apr 15, 2024
@ViktorKram ViktorKram self-requested a review April 15, 2024 13:13
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
@AleksZimin AleksZimin changed the title [csi] Add stage/unstage [csi] Add NodeStageVolume and NodeUnstageVolume Apr 25, 2024
@AleksZimin AleksZimin marked this pull request as ready for review April 25, 2024 06:33
@AleksZimin AleksZimin merged commit 43e2e36 into main Apr 25, 2024
3 checks passed
@AleksZimin AleksZimin deleted the fix-publish-volume branch April 25, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants