Skip to content

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

Merged
santhoshatdell merged 4 commits into
mainfrom
storageclass-metro-mode
Sep 3, 2024
Merged

Add new replication parameter 'mode' to storage class#341
santhoshatdell merged 4 commits into
mainfrom
storageclass-metro-mode

Conversation

@santhoshatdell

@santhoshatdell santhoshatdell commented Aug 30, 2024

Copy link
Copy Markdown
Contributor

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 #
https://github.com/dell/csm/issues/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"}

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

Copy link
Copy Markdown
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
Copy Markdown
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
@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