Skip to content

Allow setting dictionary compression per cluster and replica#37700

Merged
antiguru merged 5 commits into
MaterializeInc:mainfrom
antiguru:moritz/clu-173-allow-setting-dictionary-compression-per-cluster-and-replica
Jul 22, 2026
Merged

Allow setting dictionary compression per cluster and replica#37700
antiguru merged 5 commits into
MaterializeInc:mainfrom
antiguru:moritz/clu-173-allow-setting-dictionary-compression-per-cluster-and-replica

Conversation

@antiguru

@antiguru antiguru commented Jul 16, 2026

Copy link
Copy Markdown
Member

Motivation

Closes CPU-173

Arrangement dictionary compression was a purely global feature flag captured at replica creation. This makes it configurable per cluster and per replica, modeled after the introspection options.

Description

Adds the EXPERIMENTAL ARRANGEMENT COMPRESSION option to CREATE CLUSTER, CREATE CLUSTER REPLICA, and ALTER CLUSTER SET/RESET, stored durably in the catalog (version bump to v90). The value is threaded through the cluster-controller shape model, so changing it reprovisions controller-owned replicas like a size or introspection change does.

enable_arrangement_dictionary_compression_alpha now only gates the feature: a replica honors its configured value only while the flag is enabled, and the gate is evaluated at replica-creation time. The configuration is always accepted and stored regardless of the flag, so a cluster can be pre-configured and start honoring it once the flag is enabled on new or restarted replicas.

@antiguru
antiguru marked this pull request as ready for review July 17, 2026 00:59
@antiguru
antiguru requested review from a team as code owners July 17, 2026 00:59
@antiguru
antiguru requested review from DAlperin and aljoscha July 17, 2026 00:59

@def- def- left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd like to see random dictionary compressions being set per cluster/replica in parallel-workload. Maybe in the existing FlipFlagsAction, which has to be extended a bit for that. Tell me if you want me to implement that instead

@DAlperin DAlperin 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.

Approve mod one question. Also, not localized to this PR but man, this is a lot of boilerplate to add one field

Comment on lines +4839 to +4842
EXPERIMENTAL => {
self.expect_keywords(&[ARRANGEMENT, COMPRESSION])?;
ReplicaOptionName::ExperimentalArrangementCompression
}

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.

Are we sticking with the EXPERIMENTAL prefix or are we just releasing?

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.

Yeah, we'll leave it as such for the moment and eventually accept it without EXPERIMENTAL, if we decide to go with it.

Copy link
Copy Markdown
Member Author

If you're up for it I'd appreciate your input to randomize the flag!

@antiguru
antiguru force-pushed the moritz/clu-173-allow-setting-dictionary-compression-per-cluster-and-replica branch from df5a143 to e62e5fa Compare July 22, 2026 09:01
@def-

def- commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

I don't have permission to push to your branch, so pushed to mine instead: https://github.com/def-/materialize/tree/pr-test7
Running now: https://buildkite.com/materialize/nightly/builds/17480
Edit: New run, now also pushed to your PR: https://buildkite.com/materialize/nightly/builds/17481
Edit2: green

antiguru and others added 4 commits July 22, 2026 15:50
Turn arrangement dictionary compression from a purely global feature flag
into a per-cluster and per-replica configuration modeled after the
introspection options. Add the `EXPERIMENTAL ARRANGEMENT COMPRESSION`
option to `CREATE CLUSTER`, `CREATE CLUSTER REPLICA`, and `ALTER CLUSTER`,
store it durably in the catalog (v90), and thread it through the cluster
controller shape model so a change reprovisions controller-owned replicas.

The `enable_arrangement_dictionary_compression_alpha` flag now only gates
the feature at replica-creation time: a replica honors its configured value
only while the flag is enabled, so the configuration can be set and stored
regardless of the flag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Add the objects_v90 proto serialization snapshot required by
  test_proto_serialization_stability.
* Regenerate the test_persist_open initial-snapshot insta golden for the
  new arrangement_compression field.
* Version-gate the SHOW CREATE CLUSTER platform-check goldens: the new
  EXPERIMENTAL ARRANGEMENT COMPRESSION option only appears at v2603400.
* Make the arrangement-dictionary-compression regression test request
  compression per cluster, since the gating flag alone no longer enables it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antiguru
antiguru force-pushed the moritz/clu-173-allow-setting-dictionary-compression-per-cluster-and-replica branch from 306ff05 to ea362c7 Compare July 22, 2026 13:53
ALTER CLUSTER SET SIZE on a cluster with replicas is not reflected in
SHOW CREATE CLUSTER without zero-downtime reconfiguration, which is
gated behind a private-preview flag. Match the golden to actual output.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antiguru
antiguru merged commit fca7417 into MaterializeInc:main Jul 22, 2026
122 checks passed
@antiguru

Copy link
Copy Markdown
Member Author

Thanks for the reviews!

@antiguru
antiguru deleted the moritz/clu-173-allow-setting-dictionary-compression-per-cluster-and-replica branch July 22, 2026 14:43
def- added a commit that referenced this pull request Jul 23, 2026
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.

3 participants