Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Business Source License 1.1

Licensor: Materialize, Inc.

Licensed Work: Materialize Version 20260911
Licensed Work: Materialize Version 20260912
The Licensed Work is © 2026 Materialize, Inc.

Additional Use Grant: Within a single installation of the Licensed Work,
Expand All @@ -39,7 +39,7 @@ Additional Use Grant: Within a single installation of the Licensed Work,
whose definitions are controlled by such third
parties.

Change Date: September 11, 2030
Change Date: September 12, 2030

Change License: Apache License, Version 2.0

Expand Down
58 changes: 36 additions & 22 deletions ci/mkpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,33 +759,47 @@ def permit_rerunning_successful_steps(pipeline: Any) -> None:
)


# Failures that are the infrastructure's fault rather than the step's, so every
# step retries them regardless of what else it asks for.
SHARED_AUTOMATIC_RETRIES = [
{
"exit_status": -1,
"signal_reason": "none",
"limit": 2,
},
{
"signal_reason": "agent_stop", # Stopped by OS
"limit": 2,
},
{
"exit_status": 128, # Temporary Github/GHCR/DockerHub connection issue
"limit": 2,
},
{
"exit_status": 199, # Rust ICE https://github.com/rust-lang/rust/issues/148581
"limit": 2,
},
]


def set_retry_on_agent_lost(pipeline: Any) -> None:
for step in steps(pipeline):
if "trigger" in step or "wait" in step or "group" in step or "block" in step:
continue
retry = step.setdefault("retry", {})
if "automatic" in retry:
automatic = step.setdefault("retry", {}).setdefault("automatic", [])
# A step retrying on every exit status already covers these.
if any(rule.get("exit_status") == "*" for rule in automatic):
continue
retry.setdefault("automatic", []).extend(
[
{
"exit_status": -1,
"signal_reason": "none",
"limit": 2,
},
{
"signal_reason": "agent_stop", # Stopped by OS
"limit": 2,
},
{
"exit_status": 128, # Temporary Github/GHCR/DockerHub connection issue
"limit": 2,
},
{
"exit_status": 199, # Rust ICE https://github.com/rust-lang/rust/issues/148581
"limit": 2,
},
]
# Merge rather than skip a step that declares its own rules: skipping
# lets a narrow override such as `exit_status: 1` drop every shared rule
# and hard-fail the step on the infrastructure classes they exist for.
# Nothing surfaces that, and the mzcompose plugin goes out of its way to
# propagate 128 and 199 so these rules can match.
declared = {(r.get("exit_status"), r.get("signal_reason")) for r in automatic}
automatic.extend(
dict(rule)
for rule in SHARED_AUTOMATIC_RETRIES
if (rule.get("exit_status"), rule.get("signal_reason")) not in declared
)


Expand Down
4 changes: 4 additions & 0 deletions doc/user/content/sql/system-catalog/mz_internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ usage.
| `disk_bytes` | [`uint8`] | Approximate disk usage, in bytes.
| `heap_bytes` | [`uint8`] | Approximate heap (RAM + swap) usage, in bytes.
| `heap_limit` | [`uint8`] | Available heap (RAM + swap) space, in bytes.
| `swap_bytes` | [`uint8`] | Approximate swap usage, in bytes.

## `mz_cluster_replica_metrics_history`

Expand All @@ -252,6 +253,7 @@ history is retained across restarts.
| `occurred_at` | [`timestamp with time zone`] | Wall-clock timestamp at which the event occurred.
| `heap_bytes` | [`uint8`] | Approximate heap (RAM + swap) usage, in bytes.
| `heap_limit` | [`uint8`] | Available heap (RAM + swap) space, in bytes.
| `swap_bytes` | [`uint8`] | Approximate swap usage, in bytes.

## `mz_cluster_replica_statuses`

Expand Down Expand Up @@ -298,6 +300,7 @@ At this time, we do not make any guarantees about the exactness or freshness of
| `memory_percent` | [`double precision`] | Approximate RAM usage, in percent of the total allocation.
| `disk_percent` | [`double precision`] | Approximate disk usage, in percent of the total allocation.
| `heap_percent` | [`double precision`] | Approximate heap (RAM + swap) usage, in percent of the total allocation.
| `swap_percent` | [`double precision`] | Approximate swap usage, in percent of the total heap allocation.

## `mz_cluster_replica_utilization_history`

Expand All @@ -316,6 +319,7 @@ At this time, we do not make any guarantees about the exactness or freshness of
| `memory_percent` | [`double precision`] | Approximate RAM usage, in percent of the total allocation.
| `disk_percent` | [`double precision`] | Approximate disk usage, in percent of the total allocation.
| `heap_percent` | [`double precision`] | Approximate heap (RAM + swap) usage, in percent of the total allocation.
| `swap_percent` | [`double precision`] | Approximate swap usage, in percent of the total heap allocation.
| `occurred_at` | [`timestamp with time zone`] | Wall-clock timestamp at which the event occurred.

## `mz_cluster_replica_history`
Expand Down
10 changes: 10 additions & 0 deletions src/adapter/src/catalog/open/builtin_schema_migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,16 @@ static MIGRATIONS: LazyLock<Vec<MigrationStep>> = LazyLock::new(|| {
MZ_INTERNAL_SCHEMA,
"mz_object_dependencies",
),
// Adding the `swap_bytes` column to `mz_cluster_replica_metrics_history`
// is a backward-compatible append, so the shard schema can evolve in
// place. See the NOTE above: this version must stay at the workspace's
// current dev version until the change ships.
MigrationStep::evolution(
"26.43.0-dev.0",
CatalogItemType::Source,
MZ_INTERNAL_SCHEMA,
"mz_cluster_replica_metrics_history",
),
]
});

Expand Down
21 changes: 19 additions & 2 deletions src/catalog/src/builtin/mz_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2734,6 +2734,7 @@ pub static MZ_CLUSTER_REPLICA_METRICS_HISTORY: LazyLock<BuiltinSource> =
"Approximate heap (RAM + swap) usage, in bytes.",
),
("heap_limit", "Available heap (RAM + swap) space, in bytes."),
("swap_bytes", "Approximate swap usage, in bytes."),
]),
is_retained_metrics_object: false,
access: vec![PUBLIC_SELECT],
Expand All @@ -2752,6 +2753,7 @@ pub static MZ_CLUSTER_REPLICA_METRICS: LazyLock<BuiltinView> = LazyLock::new(||
.with_column("disk_bytes", SqlScalarType::UInt64.nullable(true))
.with_column("heap_bytes", SqlScalarType::UInt64.nullable(true))
.with_column("heap_limit", SqlScalarType::UInt64.nullable(true))
.with_column("swap_bytes", SqlScalarType::UInt64.nullable(true))
.with_key(vec![0, 1])
.finish(),
column_comments: BTreeMap::from_iter([
Expand All @@ -2768,6 +2770,7 @@ pub static MZ_CLUSTER_REPLICA_METRICS: LazyLock<BuiltinView> = LazyLock::new(||
"Approximate heap (RAM + swap) usage, in bytes.",
),
("heap_limit", "Available heap (RAM + swap) space, in bytes."),
("swap_bytes", "Approximate swap usage, in bytes."),
]),
sql: "
SELECT
Expand All @@ -2778,7 +2781,8 @@ SELECT
memory_bytes,
disk_bytes,
heap_bytes,
heap_limit
heap_limit,
swap_bytes
FROM mz_internal.mz_cluster_replica_metrics_history
JOIN mz_cluster_replicas r ON r.id = replica_id
ORDER BY replica_id, process_id, occurred_at DESC",
Expand All @@ -2805,6 +2809,7 @@ ORDER BY replica_id, process_id, occurred_at DESC",
("disk_bytes", SemanticType::ByteCount),
("heap_bytes", SemanticType::ByteCount),
("heap_limit", SemanticType::ByteCount),
("swap_bytes", SemanticType::ByteCount),
]
},
}),
Expand Down Expand Up @@ -5421,6 +5426,7 @@ pub static MZ_CLUSTER_REPLICA_UTILIZATION: LazyLock<BuiltinView> = LazyLock::new
.with_column("memory_percent", SqlScalarType::Float64.nullable(true))
.with_column("disk_percent", SqlScalarType::Float64.nullable(true))
.with_column("heap_percent", SqlScalarType::Float64.nullable(true))
.with_column("swap_percent", SqlScalarType::Float64.nullable(true))
.finish(),
column_comments: BTreeMap::from_iter([
("replica_id", "The ID of a cluster replica."),
Expand All @@ -5441,6 +5447,10 @@ pub static MZ_CLUSTER_REPLICA_UTILIZATION: LazyLock<BuiltinView> = LazyLock::new
"heap_percent",
"Approximate heap (RAM + swap) usage, in percent of the total allocation.",
),
(
"swap_percent",
"Approximate swap usage, in percent of the total heap allocation.",
),
]),
sql: "
SELECT
Expand All @@ -5449,7 +5459,8 @@ SELECT
m.cpu_nano_cores::float8 / NULLIF(s.cpu_nano_cores, 0) * 100 AS cpu_percent,
m.memory_bytes::float8 / NULLIF(s.memory_bytes, 0) * 100 AS memory_percent,
m.disk_bytes::float8 / NULLIF(s.disk_bytes, 0) * 100 AS disk_percent,
m.heap_bytes::float8 / NULLIF(m.heap_limit, 0) * 100 AS heap_percent
m.heap_bytes::float8 / NULLIF(m.heap_limit, 0) * 100 AS heap_percent,
m.swap_bytes::float8 / NULLIF(m.heap_limit, 0) * 100 AS swap_percent
FROM
mz_catalog.mz_cluster_replicas AS r
JOIN mz_catalog.mz_cluster_replica_sizes AS s ON r.size = s.size
Expand Down Expand Up @@ -5486,6 +5497,7 @@ pub static MZ_CLUSTER_REPLICA_UTILIZATION_HISTORY: LazyLock<BuiltinView> =
.with_column("memory_percent", SqlScalarType::Float64.nullable(true))
.with_column("disk_percent", SqlScalarType::Float64.nullable(true))
.with_column("heap_percent", SqlScalarType::Float64.nullable(true))
.with_column("swap_percent", SqlScalarType::Float64.nullable(true))
.with_column(
"occurred_at",
SqlScalarType::TimestampTz { precision: None }.nullable(false),
Expand All @@ -5510,6 +5522,10 @@ pub static MZ_CLUSTER_REPLICA_UTILIZATION_HISTORY: LazyLock<BuiltinView> =
"heap_percent",
"Approximate heap (RAM + swap) usage, in percent of the total allocation.",
),
(
"swap_percent",
"Approximate swap usage, in percent of the total heap allocation.",
),
(
"occurred_at",
"Wall-clock timestamp at which the event occurred.",
Expand All @@ -5523,6 +5539,7 @@ SELECT
m.memory_bytes::float8 / NULLIF(s.memory_bytes, 0) * 100 AS memory_percent,
m.disk_bytes::float8 / NULLIF(s.disk_bytes, 0) * 100 AS disk_percent,
m.heap_bytes::float8 / NULLIF(m.heap_limit, 0) * 100 AS heap_percent,
m.swap_bytes::float8 / NULLIF(m.heap_limit, 0) * 100 AS swap_percent,
m.occurred_at
FROM
mz_catalog.mz_cluster_replicas AS r
Expand Down
Loading
Loading