Skip to content

feat: simplified content digest for restart controller - #481

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

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

Conversation

@sweb

@sweb sweb commented Nov 25, 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.

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 2 times, most recently from bf49a84 to 9efe76a Compare November 25, 2026 12:54

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.

@sbernauer sbernauer left a comment

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.

Basically LGTM, I only recommend to remove the UID prefix


To detect changes, the operator adds an annotation for every referenced ConfigMap and Secret to the Pod template of the StatefulSet.
Its key is `configmap.restarter.stackable.tech/\{name\}` or `secret.restarter.stackable.tech/\{name\}`, its value is the UID and resource version of the referenced object.
Its key is `configmap.restarter.stackable.tech/\{name\}` or `secret.restarter.stackable.tech/\{name\}`, its value is the UID of the referenced object, followed by a hash of its content (or by its resource version, as described above for upgrades).

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.

needs to be updated when we remove the UID

@sweb
sweb force-pushed the feat/keyed-hash-for-restart-v2 branch from 9efe76a to f2db3a4 Compare November 30, 2026 09:21
sweb and others added 4 commits November 30, 2026 10:23
@sweb
sweb marked this pull request as ready for review November 30, 2026 12:48
@sweb sweb moved this to Development: In Review in Stackable Engineering Nov 30, 2026
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 Review

Development

Successfully merging this pull request may close these issues.

2 participants