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

Backup repo config #8093

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

Lyndon-Li
Copy link
Contributor

Fix issue #7620, add backup repository configuration implementation and support cacheLimit configuration for Kopia repo

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 94.23077% with 3 lines in your changes missing coverage. Please review.

Project coverage is 58.83%. Comparing base (7b26673) to head (82d9fe4).
Report is 23 commits behind head on main.

Files Patch % Lines
pkg/controller/backup_repository_controller.go 93.10% 1 Missing and 1 partial ⚠️
pkg/cmd/server/server.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8093      +/-   ##
==========================================
- Coverage   58.93%   58.83%   -0.10%     
==========================================
  Files         353      358       +5     
  Lines       29643    30123     +480     
==========================================
+ Hits        17470    17723     +253     
- Misses      10733    10951     +218     
- Partials     1440     1449       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Lyndon-Li <[email protected]>
@@ -253,6 +254,8 @@ func NewCommand(f client.Factory) *cobra.Command {
command.Flags().StringVar(&config.maintenanceCfg.CPULimit, "maintenance-job-cpu-limit", config.maintenanceCfg.CPULimit, "CPU limit for maintenance job. Default is no limit.")
command.Flags().StringVar(&config.maintenanceCfg.MemLimit, "maintenance-job-mem-limit", config.maintenanceCfg.MemLimit, "Memory limit for maintenance job. Default is no limit.")

command.Flags().StringVar(&config.backukpRepoConfig, "backup-repository-config", config.backukpRepoConfig, "The name of configMap containing backup repository configurations.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we also specify the repo configurations currently supported and the default values if not set ?

Copy link
Contributor Author

@Lyndon-Li Lyndon-Li Aug 8, 2024

Choose a reason for hiding this comment

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

As you can see in the sample, the configuration is a structured data so it is self-explained. And also we will have a doc for backup repo config where all the supported values will be listed.
This backup repo config is not a enumeration/boolean value, we may have many and even complex-type values in future, so it is hard to explain all the supported values in this CLI helper.

@@ -33,8 +33,7 @@ import (
)

const (
maxDataCacheMB = 2000
maxMetadataCacheMB = 2000
defaultCacheLimitMB = 5000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Curious about how we ended up with this default value ?

Copy link
Contributor Author

@Lyndon-Li Lyndon-Li Aug 8, 2024

Choose a reason for hiding this comment

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

No special reason, it is impossible to find a universal value which works for most of the cases, so this value doesn't have practical meanings.

result[udmrepo.StoreOptionCacheLimit] = v
}
}

Copy link
Collaborator

@shubham-pampattiwar shubham-pampattiwar Aug 7, 2024

Choose a reason for hiding this comment

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

Shouldn't we check for enableCompression config as well ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As our previous discussion, compression is not supported by Kopia repo in 1.15.
From the design whether/when/how a configuration is picked is decided by the specific repo, so here it is fine for the repo not touching the configuration if it doesn't support it.

We just want to support compression as a user case in the design.
However, for implementation, we may need some more values, e.g., what is the escape size in the case that it is a waste of time/resource to do compression for small files.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe it makes sense to enable/disable compression at a backup level rather than at the backup repository level, but yeah I get your point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Generally speaking, compression could be at backup level, but most often, it is at repository level.
Compression is eventually done by the repository, either client part or server part. Therefore, even if we have it on backup level, we need to pass the configuration all the way down to the repository. Otherwise, server side dedup & compression will be disabled.

While for Unified Repo concepts, repository with server side dedup & compression is supported, so we will probably have it at repository level only.

Anyway, this is out of the scope of the current PR, but a consideration point when we implement compression. Let see if we have other ideas then.

@Lyndon-Li Lyndon-Li changed the title Backkup repo config Backup repo config Aug 8, 2024
@shubham-pampattiwar shubham-pampattiwar merged commit b62b38f into vmware-tanzu:main Aug 12, 2024
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants