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

Specify individual backupRepo availability in SolrCloud Status #358

Merged

Conversation

HoustonPutman
Copy link
Contributor

@HoustonPutman HoustonPutman commented Oct 27, 2021

Resolves #326

This uses a map of the BackupRepositories names in the SolrCloud status, mapping the name of the repo to a boolean of whether that repo is available across all nodes.

TODO:

  • Add changelog entry
  • Manual testing

Copy link
Contributor

@gerlowskija gerlowskija left a comment

Choose a reason for hiding this comment

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

This looks great!

There were a few things I noticed in the crd spec that seemed like they might've been oversights (esp inconsistency around case-sensitivity and min-length). But otherwise it looks "ready to go" to me.

It's got my 👍 as long as you lmk whether those crd spec things were intended or not.

@@ -385,6 +385,8 @@ type SolrBackupRestoreOptions struct {
type SolrBackupRepository struct {
// A name used to identify this local storage profile. Values should follow RFC-1123. (See here for more details:
// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names)
//
// +kubebuilder:validation:Pattern:=[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?
Copy link
Contributor

Choose a reason for hiding this comment

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

[-1/?] This regex allows capitalized letters, but the validation on the 'solrCloud' string in solrbackup_types.go looks like it requires all lowercase.

Was that an oversight, or is there some rationale for that that I'm missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this is just a name for the backup repository, it is pretty independent from the name of the SolrCloud (which has limitations given by Kubernetes, which I linked below).
I used the same regex, but changed it to allow capital letters and underscores, since we don't need to be as strict with the names of the repositories (as far as I know).

Is there any limitation in Solr for the name of backup repositories? If so we should definitely change this to match.

config/crd/bases/solr.apache.org_solrbackups.yaml Outdated Show resolved Hide resolved
helm/solr-operator/crds/crds.yaml Outdated Show resolved Hide resolved
type: string
solrCloud:
description: A reference to the SolrCloud to create a backup for
minLength: 63
pattern: '[a-z0-9]([-a-z0-9]*[a-z0-9])?'
Copy link
Contributor

Choose a reason for hiding this comment

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

[-1/Q] Ditto to my reminder comment above, but this time regarding the lower-case requirement on this string field that you may or may not have intended.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So yeah, just to be very clear, I'm just following the guidelines for kubernetes resource names. This field is a reference to SolrCloud resources, so there is no way that giving a string that has a length > 63, or doesn't match that regex, is going to be successful (because we will never be able to find a SolrCloud in kubernetes with the given name).

@HoustonPutman
Copy link
Contributor Author

Will test (and fix if need be) and merge tomorrow.

@HoustonPutman HoustonPutman merged commit 9860911 into apache:main Nov 4, 2021
@HoustonPutman HoustonPutman deleted the individual-backup-repo-ready branch November 4, 2021 17:14
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.

Break up backupIsReady in SolrCloud status by backupRepository
2 participants