Skip to main content

Module auto_scaling

Module auto_scaling 

Source
Expand description

Conversions between the AUTO SCALING STRATEGY cluster option and the structured AutoScalingStrategy policy.

Three representations meet here:

  • The SQL option in a CREATE CLUSTER / ALTER CLUSTER statement (ClusterAutoScalingStrategyOptionValue AST).
  • The structured policy (mz_sql::plan::AutoScalingStrategy), used for drift comparison.
  • The strategy jsonb column of mz_internal.mz_cluster_auto_scaling_strategies, whose serde shape matches the plan type.

Functionsยง

strategy_from_catalog_json ๐Ÿ”’
Parse the strategy jsonb column of mz_internal.mz_cluster_auto_scaling_strategies (fetched as text). The column is JSON null for a cluster whose policy was just removed while a burst still lingers, which maps to None like a missing row.
strategy_from_option_value ๐Ÿ”’
Convert the AST option value into a structured policy. An empty block AUTO SCALING STRATEGY = () maps to None (autoscaling disabled), the same normalization the server planner applies.
strategy_to_cluster_option ๐Ÿ”’
Render a structured policy back into a CREATE CLUSTER / ALTER CLUSTER ... SET option, e.g. AUTO SCALING STRATEGY = (ON HYDRATION (HYDRATION SIZE = '3200cc', LINGER DURATION = '00:10:00')).