You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test/launchdarkly: cover per-cluster and per-replica scoped flags
Extend the LaunchDarkly integration test with cluster-coherent and
replica-local cases. Adds rule-based targeting (clauses on context-kind
attributes) and boolean flags, then demonstrates:
* a cluster-coherent optimizer feature served `true` to builtin clusters
(targeted by the `cluster` context's `is_builtin`) while user clusters
fall through to `false`, observed via `mz_cluster_system_parameters`;
* `enable_lgalloc` served `false` only to `legacy` size-family replicas
(targeted by the `replica` context's `replica_size_family`) while `cc`
replicas keep the env-wide value, observed via
`mz_replica_system_parameters`;
* durability of both across a restart with the sync loop disabled.
The LAUNCHDARKLY_KEY_MAP entries are `;`-separated (the CLI arg's value
delimiter). The LaunchDarkly project/environment keys are overridable via
LAUNCHDARKLY_PROJECT_KEY / LAUNCHDARKLY_ENVIRONMENT_KEY for running
against a non-CI project.
Verified end-to-end against a live LaunchDarkly test project.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Allow a few sync ticks to evaluate the new cluster/replica.
368
+
sleep(5)
369
+
370
+
# Cluster case: the catalog server gets the cluster-scoped `true`,
371
+
# while the user cluster falls through to `false`.
372
+
c.testdrive(
373
+
"\n".join(
374
+
[
375
+
f"> SELECT c.name, p.value FROM mz_internal.mz_cluster_system_parameters p JOIN mz_clusters c ON c.id = p.cluster_id WHERE p.name = '{OPTIMIZER_PARAM}' AND c.name IN ('mz_catalog_server', 'quickstart') ORDER BY c.name",
376
+
"mz_catalog_server true",
377
+
"quickstart false",
378
+
]
379
+
)
380
+
)
381
+
382
+
# Replica case: the legacy-family replica gets `false`, while the
383
+
# `cc`-family quickstart replica keeps the env-wide `true`.
384
+
c.testdrive(
385
+
"\n".join(
386
+
[
387
+
f"> SELECT cr.name, p.value FROM mz_internal.mz_replica_system_parameters p JOIN mz_cluster_replicas cr ON cr.id = p.replica_id JOIN mz_clusters c ON c.id = cr.cluster_id WHERE p.name = '{LGALLOC_PARAM}' AND c.name IN ('ld_legacy', 'quickstart') ORDER BY c.name",
388
+
"r1 false",
389
+
"r1 true",
390
+
]
391
+
)
392
+
)
393
+
c.stop("materialized")
394
+
395
+
# Durability: restart without the sync loop and assert the scoped
f"> SELECT c.name, p.value FROM mz_internal.mz_cluster_system_parameters p JOIN mz_clusters c ON c.id = p.cluster_id WHERE p.name = '{OPTIMIZER_PARAM}' AND c.name IN ('mz_catalog_server', 'quickstart') ORDER BY c.name",
403
+
"mz_catalog_server true",
404
+
"quickstart false",
405
+
f"> SELECT cr.name, p.value FROM mz_internal.mz_replica_system_parameters p JOIN mz_cluster_replicas cr ON cr.id = p.replica_id JOIN mz_clusters c ON c.id = cr.cluster_id WHERE p.name = '{LGALLOC_PARAM}' AND c.name IN ('ld_legacy', 'quickstart') ORDER BY c.name",
0 commit comments