Skip to content

Conversation

@wilkermichael
Copy link
Contributor

@wilkermichael wilkermichael commented Sep 9, 2025

Summary

This PR adds support for configuring Zookeeper compression through the ClickHouseInstallation CRD by introducing the use_compression field in the zookeeper configuration section as defined in the ClickHouse server config settings

Changes

  • Added use_compression boolean field to the Zookeeper configuration spec in the CRD
  • Updated the operator to properly generate <use_compression> XML configuration when specified
  • Field is optional and defaults to false to maintain backward compatibility

Configuration Example

  apiVersion: "clickhouse.altinity.com/v1"
  kind: ClickHouseInstallation
  metadata:
    name: example
  spec:
    configuration:
      zookeeper:
        nodes:
          - host: keeper.example.com
            port: 2181
        session_timeout_ms: 30000
        operation_timeout_ms: 10000
        root: /clickhouse
        identity: user:password
        use_compression: "true"  # <-- New field

Testing

In a local KinD environment, confirmed the operator correctly generates the Zookeeper configuration:

<yandex>
    <zookeeper>
        <node>
            <host>keeper-local.clickhouse-kind.svc.cluster.local</host>
            <port>2181</port>
        </node>
        <session_timeout_ms>30000</session_timeout_ms>
        <operation_timeout_ms>10000</operation_timeout_ms>
        <root>/local</root>
        <identity>user:password</identity>
        <use_compression>true</use_compression>
    </zookeeper>
</yandex>

Network Traffic Comparison

Measured network traffic for identical operations (creating ReplicatedMergeTree table + inserting 10,000 rows):

Configuration Bytes Received Bytes Transmitted Total Reduction
With compression 2,008 2,894 4,902 -
Without compression (removed field) 14,013 16,695 30,708 -

Backward Compatibility

  • The field is optional and omitting it maintains current behavior (no compression)
  • Existing ClickHouseInstallation resources will continue to work without modification
  • No changes required for users who don't need compression

Thanks for taking the time to contribute to clickhouse-operator!

Please, read carefully instructions on how to make a Pull Request.

This will help a lot for maintainers to adopt your Pull Request.

Important items to consider before making a Pull Request

Please check items PR complies to:

  • All commits in the PR are squashed. More info
  • The PR is made into dedicated next-release branch, not into master branch1. More info
  • The PR is signed. More info

--

1 If you feel your PR does not affect any Go-code or any testable functionality (for example, PR contains docs only or supplementary materials), PR can be made into master branch, but it has to be confirmed by project's maintainer.

@wilkermichael wilkermichael force-pushed the mw/add-use-compression-zookeeper-config branch 3 times, most recently from ba51034 to 579256d Compare September 9, 2025 22:04
@wilkermichael wilkermichael force-pushed the mw/add-use-compression-zookeeper-config branch from 579256d to c598b60 Compare September 9, 2025 22:05
@sunsingerus sunsingerus merged commit 6af6b5f into Altinity:0.25.4 Sep 11, 2025
2 checks passed
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