Skip to content

feat: restart statefulsets based on configmap / secret content - #449

Open
sweb wants to merge 4 commits into
mainfrom
chore/reproduce-unnecessary-sts-restarts
Open

sweb wants to merge 4 commits into
mainfrom
chore/reproduce-unnecessary-sts-restarts

Conversation

@sweb

@sweb sweb commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Description

Adds a keyed digest of the configmap / secret's content to use for detecting required restarts instead of using resourceVersion which gets bumped by e.g. metadata changes. This new digest is not used as default - the intention is to allow switching over to it via changing the annotation restarter.stackable.tech/change-tracking-mechanism to data-hash on desired statefulsets after the next release and provide a deprecation notice for the old mechanic. The following release will then move over to the new mechanic and remove the old one.

The digest is computed using a key that is stored in a new secret. This is done by the operator. The approach was chosen to make sure low entropy secret values cannot be retrieved via brute force.

Switching from resource-version to data-hash does not restart the Pods: the previous value is kept until the object is next written. Switching back restarts them once.

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

@sweb
sweb force-pushed the chore/reproduce-unnecessary-sts-restarts branch 2 times, most recently from e3bc00a to 124d17c Compare August 13, 2026 19:14
@sweb sweb changed the title Don't merge - chore: reproduce unnecessary statefulset restarts feat: restart statefulsets based on configmap / secret content Aug 14, 2026
@sweb
sweb force-pushed the chore/reproduce-unnecessary-sts-restarts branch 2 times, most recently from 8be0274 to 0b0483c Compare August 14, 2026 13:53
@sweb
sweb marked this pull request as ready for review August 14, 2026 14:04
@sweb sweb moved this to Development: Waiting for Review in Stackable Engineering Aug 14, 2026
Comment on lines +109 to +110
cms: DelayedInit<Store<ContentDigest<ConfigMap>>>,
secrets: DelayedInit<Store<ContentDigest<Secret>>>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I didn't look at the code but I think we should check memory usage here. commons-op stores all CM/Secrets in memory, so that can be big for big k8s clusters. We now need to store more? We should not introduce a regression by raising it (thus OOM-ing existing Pods)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll take a look - my first thought on this is that it potentially reduces stored memory as this is more explicit about what to keep from the configmap / secret and the digest is small. I'll test it - also what this means for memory spikes as we need to read the whole content which is definitely more.

Comment thread CHANGELOG.md Resolved
@sbernauer

sbernauer commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

I like the general idea! Left some remarks but didn't have the time to look at the code 🙈

@sweb sweb moved this from Development: Waiting for Review to Development: In Progress in Stackable Engineering Sep 7, 2026
@sweb
sweb force-pushed the chore/reproduce-unnecessary-sts-restarts branch 10 times, most recently from 0367dfa to 6d85309 Compare November 24, 2026 16:29
@sweb
sweb force-pushed the chore/reproduce-unnecessary-sts-restarts branch from 6d85309 to dc33ab6 Compare November 24, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants