Skip to content

feat: simplified content digest for restart controller - #481

Draft
sweb wants to merge 3 commits into
mainfrom
feat/keyed-hash-for-restart-v2
Draft

sweb wants to merge 3 commits into
mainfrom
feat/keyed-hash-for-restart-v2

Conversation

@sweb

@sweb sweb commented Nov 25, 2026

Copy link
Copy Markdown
Member

Description

Please add a description here. This will become the commit message of the merge request later.

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 feat/keyed-hash-for-restart-v2 branch from b4b7448 to bf49a84 Compare November 25, 2026 12:41
@sweb
sweb force-pushed the feat/keyed-hash-for-restart-v2 branch from bf49a84 to 9efe76a Compare November 25, 2026 12:54
Deleting that Secret, or the namespace, makes the operator create a new key on its next start, which changes every hash and therefore rolling-restarts every StatefulSet managed by the restarter once.

Earlier releases counted every write to a referenced object as a change, and stored its resource version instead of a hash of its content.
Upgrading from such a release does not restart any Pods by itself: the operator keeps the value of every referenced object that has not been written since the Pods were last rolled.

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.

Suggested change
Upgrading from such a release does not restart any Pods by itself: the operator keeps the value of every referenced object that has not been written since the Pods were last rolled.
Upgrading from such an commons-operator release does not restart any Pods by itself: the operator keeps the value of every referenced object that has not been written since the Pods were last rolled.

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 gave this a try locally and got the annotation secret.restarter.stackable.tech/trino-spooling-secret: 9bde3f80-3d82-460b-860d-33883b7788b9/d00e1cb9a57b70d22ab8f3408c128d17.
I'm wonder why we are "still" including the UID in here? I would have expected secret.restarter.stackable.tech/trino-spooling-secret: d00e1cb9a57b70d22ab8f3408c128d17.
That has the benefit, that re-creating the Secret with the same content doesn't cause a restart

@sbernauer

Copy link
Copy Markdown
Member

A small feature idea:
The restarter could also write the uid/resourceVersion it last checked for each referenced ConfigMap/Secret into an observed.{configmap,secret}.restarter.stackable.tech/<name> annotation on the StatefulSet itself (not its Pod template). That would make "is my Pod up to date?" checkable again: If the observed annotation matches the object's current uid/resourceVersion and the Pod's annotation matches the template's, the Pod has the latest content. Yes, one can also shell into the Pod to check, but it's nice to get this info from k8s alone.

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.

2 participants