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

Add new replication parameter 'mode' to storage class #341

Merged
merged 4 commits into from
Sep 3, 2024

Conversation

santhoshatdell
Copy link
Contributor

@santhoshatdell santhoshatdell commented Aug 30, 2024

Description

Added new replication parameter 'mode' to storage class. The replication mode values can be sync/async/metro.
Default is 'Async' to support backwards compatibility.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#1443

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works (More tests will be added when create metro volume is implemented)
  • Backward compatibility is not broken

How Has This Been Tested?

Performed volume creations with just the driver and made sure that the new code works as expected and backward compatibility is not broken.
PV without any replication parameters created successfully.

Driver log:

when invalid mode is specified in the Storage Class

Warning ProvisioningFailed 14s (x7 over 77s) csi-powerstore.dellemc.com_powerstore-controller-567bc8ff4c-8qxmf_3b81a379-e9ec-4831-b6c0-370f1ae08627 failed to provision volume with StorageClass "powerstore-replication-invalid": rpc error: code = InvalidArgument desc = replication enabled but invalid replication mode specified in storage class

when Metro mode is specified in the Storage Class

{"level":"info","msg":"Preparing volume replication","time":"2024-09-03T16:33:42.866888418Z"}
{"level":"info","msg":"Metro replication mode requested","time":"2024-09-03T16:33:42.866908807Z"}

when no mode or Async is specified in the Storage Class

{"level":"info","msg":"Preparing volume replication","time":"2024-09-03T16:43:02.25396221Z"}
{"level":"info","msg":"ASYNC replication mode requested","time":"2024-09-03T16:43:02.253974847Z"}

pkg/controller/controller.go Show resolved Hide resolved
case "SYNC", "ASYNC":
// handle Sync and Async modes
log.Infof("%s replication mode requested", repMode)
vgPrefix, ok := params[s.WithRP(KeyReplicationVGPrefix)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we always using volume groups?

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. I made a comment in the Metro section to optimize the volume group calls as we add the metro calls in later PRs.

@santhoshatdell santhoshatdell merged commit 841b0b7 into main Sep 3, 2024
5 checks passed
@santhoshatdell santhoshatdell deleted the storageclass-metro-mode branch September 3, 2024 19:57
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