Repository navigation
Conversation
…a scale-up get the expanded size Generated-By: Claude Code
Generated-By: Claude Code
… with an error Generated-By: Claude Code
There was a problem hiding this comment.
🟡 Changes recommended
StatefulSet recreation can lose replica counts and operation locks, potentially triggering scale-down without replica evacuation, and can leave orphaned pods after SolrCloud deletion.
2 open issues
What changed in this PR
Addresses #927 by recreating StatefulSets after PVC expansion so later scale-ups use the expanded storage size.
Changes:
- Adds expansion detection and StatefulSet recreation with orphaned pods.
- Adds controller and end-to-end assertions for updated claim templates.
- Documents the behavior and upgrade implications.
| File | Description |
|---|---|
| tests/e2e/solrcloud_storage_test.go | Checks the expanded claim-template size. |
| helm/solr-operator/Chart.yaml | Adds a changelog entry. |
| docs/modules/upgrade-notes/pages/upgrade-notes.adoc | Explains recreation after upgrading. |
| docs/modules/solr-cloud/pages/solr-cloud-crd.adoc | Documents recreation during expansion. |
| controllers/util/solr_util.go | Adds the finalizer constant and expansion detection helper. |
| controllers/solrcloud_controller.go | Implements recreation and interrupted-deletion handling. |
| controllers/solrcloud_controller_storage_test.go | Tests recreation and preserved StatefulSet state. |
Review effort: Balanced
| controllerutil.RemoveFinalizer(statefulSet, util.SolrStatefulSetRecreateFinalizer) | ||
| if err = r.Update(ctx, statefulSet); err != nil { |
There was a problem hiding this comment.
🤖 Fixed in fc9dfe0. The replacement StatefulSet (replicas, annotations, owner refs) is saved in a ConfigMap before the finalizer is removed, and restored if the operator is interrupted.
| if err := r.finishStatefulSetRecreation(ctx, statefulSet, logger); err != nil { | ||
| return reconcile.Result{}, err | ||
| } |
There was a problem hiding this comment.
🤖 Fixed in fc9dfe0. When the SolrCloud is deleted mid-recreation, the StatefulSet is released, its orphaned pods are deleted and the saved ConfigMap is removed.
… orphaned pods when the SolrCloud is deleted meanwhile Generated-By: Claude Code


🤖 AI Assisted
Fixes #927
volumeClaimTemplateskept the original size, so a pod added by a later scale-up got a small data PVC.storageMinimumSizeannotation exceeds the template size: delete withpropagationPolicy: Orphan, then create a copy with the expanded size. Pods are not touched.solr.apache.org/recreate-statefulsetfinalizer keeps the deleted StatefulSet until the copy is made, so the clusterOp lock/queue, replicas and other annotations survive.solr-cloud-crd.adoc, av0.11.0upgrade note, and a changelog entry inhelm/solr-operator/Chart.yaml.Tests:
make test→ok github.com/apache/solr-operator/controllers 127.853s(new spec "Persistent Data - Scale up after PVC expansion")make prepare,make build,make lint DOCS_LINT=,operator-check-docs,make check-git→ pass