Skip to content

Enhance CHK reconciliation and normalization features#1885

Closed
perosb wants to merge 1 commit intoAltinity:0.26.0from
perosb:checkhealth
Closed

Enhance CHK reconciliation and normalization features#1885
perosb wants to merge 1 commit intoAltinity:0.26.0from
perosb:checkhealth

Conversation

@perosb
Copy link
Copy Markdown

@perosb perosb commented Dec 10, 2025

This pull request introduces enhancements to the ClickHouse Keeper (CHK) controller logic, focusing on better inheritance and normalization of reconcile settings, improved handling of StatefulSet reconciliation, and extended macro/namer support for CHK clusters. The changes improve the maintainability and configurability of cluster reconciliation, ensuring CHK clusters inherit correct settings and are properly identified throughout the codebase.

Reconcile settings inheritance and normalization:

  • Added Cluster.InheritClusterReconcileFrom to allow CHK clusters to inherit reconcile settings from the parent CR, ensuring consistent runtime and host reconciliation behavior. [1] [2]
  • Updated the normalizer to apply normalization to the host reconcile section (normalizeReconcileHost), improving the reliability of host-specific settings.

StatefulSet reconciliation improvements:

  • Introduced prepareStsReconcileOptsWaitSection, enabling conditional setting of WaitUntilStarted and WaitUntilReady options for StatefulSet reconciliation based on probe readiness, with appropriate logging.
  • Ensured that readiness marks are deleted on pods and services when waiting for StatefulSet readiness, increasing robustness of readiness checks.

Macro and namer support for CHK clusters:

  • Extended macro engine and short namer to recognize and generate names for *apiChk.Cluster objects, supporting namespace, CR name, and cluster name resolution for CHK clusters. [1] [2] [3] [4] [5] [6] [7]

Fixes #1796

@perosb perosb changed the base branch from master to 0.25.6 December 10, 2025 20:48
@sunsingerus sunsingerus added the planned for review This feature is planned for review label Dec 11, 2025
- Implement InheritClusterReconcileFrom method to inherit reconcile settings from ClickHouseKeeperInstallation.
- Add prepareStsReconcileOptsWaitSection to set StatefulSet reconcile options based on readiness and startup probes.
- Normalize reconcile host settings in the normalizer.
- Update HostObjectsPoller to safely delete ready marks only if readyMarkDeleter is initialized.
- Introduce new replacer for CHK clusters in the engine.
- Extend namer functionality to handle CHK clusters.

Fixes Altinity#1796

Signed-off-by: Per Osbäck <per@osbeck.com>
@perosb perosb changed the base branch from 0.25.6 to master December 11, 2025 14:01
@alex-zaitsev
Copy link
Copy Markdown
Member

Thank you, @perosb. The next operator release (0.26) will be focused almost solely on improving Keeper support.

@sunsingerus sunsingerus changed the base branch from master to 0.26.0 December 12, 2025 11:35
return false
}
_ = p.readyMarkDeleter.DeleteReadyMarkOnPodAndService(_ctx, host)
if p.readyMarkDeleter != nil {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please check default deleter behavior

return e.newReplacerCR(t)
case api.ICluster:
return e.newReplacerCluster(t)
case *apiChk.Cluster:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is ICluster interface that covers this functionality. No need to duplicate code. If there are doubts on applicability with CHK - ensure ICluster compatibility

})
}

// newReplacerCHKCluster
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code duplication?

case api.ICluster:
cluster := obj.(api.ICluster)
return n.namePartCRName(cluster.GetRuntime().GetAddress().GetNamespace())
case *apiChk.Cluster:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The same - interface is for a reason

case api.ICluster:
cluster := obj.(api.ICluster)
return n.namePartCRName(cluster.GetRuntime().GetAddress().GetCRName())
case *apiChk.Cluster:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The same - interface use

case api.ICluster:
cluster := obj.(api.ICluster)
return n.namePartClusterName(cluster.GetRuntime().GetAddress().GetClusterName())
case *apiChk.Cluster:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The same - interface

@sunsingerus
Copy link
Copy Markdown
Collaborator

Labeler behavior is unclear, it is expected to be implemented via interface abstractions.
Reconcile functionality is already implemented.
Please try to split PR and address interface in labeler

@sunsingerus sunsingerus added waiting reply Altinity is waiting for a reply ongoing discussion Issue is under discussion, no decision made so far and removed planned for review This feature is planned for review labels Feb 9, 2026
@perosb
Copy link
Copy Markdown
Author

perosb commented Feb 9, 2026

this was created for 0.25 2 months ago. I will close this.

@perosb perosb closed this Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ongoing discussion Issue is under discussion, no decision made so far waiting reply Altinity is waiting for a reply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CHK pods restart all at once when a modification to ClickhouseKeeperInstalattion is made

3 participants