Skip to content

Commit

Permalink
fixup! ct: add ::ContinualTask various adapter enums
Browse files Browse the repository at this point in the history
  • Loading branch information
danhhz committed Sep 20, 2024
1 parent ac32de8 commit 1f83c28
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/adapter/src/catalog/builtin_table_updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1395,9 +1395,7 @@ impl CatalogState {
_ => unreachable!(),
};

let mut updates = Vec::new();

updates.push(BuiltinTableUpdate {
vec![BuiltinTableUpdate {
id: &*MZ_CONTINUAL_TASKS,
row: Row::pack_slice(&[
Datum::String(&id.to_string()),
Expand All @@ -1412,9 +1410,7 @@ impl CatalogState {
Datum::String(&create_stmt.to_ast_string_redacted()),
]),
diff,
});

updates
}]
}

fn pack_sink_update(
Expand Down
2 changes: 2 additions & 0 deletions src/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ breaking:
# reason: does currently not require backward-compatibility
- catalog/protos/objects_v65.proto
# reason: does currently not require backward-compatibility
- catalog/protos/objects_v66.proto
# reason: does currently not require backward-compatibility
- cluster-client/src/client.proto
# reason: does currently not require backward-compatibility
- compute-client/src/logging.proto
Expand Down
6 changes: 4 additions & 2 deletions src/catalog/src/durable/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,14 @@ macro_rules! objects {
}
}

objects!(v60, v61, v62, v63, v64, v65);
objects!(v60, v61, v62, v63, v64, v65, v66);

/// The current version of the `Catalog`.
///
/// We will initialize new `Catalog`es with this version, and migrate existing `Catalog`es to this
/// version. Whenever the `Catalog` changes, e.g. the protobufs we serialize in the `Catalog`
/// change, we need to bump this version.
pub const CATALOG_VERSION: u64 = 65;
pub const CATALOG_VERSION: u64 = 66;

/// The minimum `Catalog` version number that we support migrating from.
///
Expand All @@ -205,6 +205,7 @@ mod v61_to_v62;
mod v62_to_v63;
mod v63_to_v64;
mod v64_to_v65;
mod v65_to_v66;

/// Describes a single action to take during a migration from `V1` to `V2`.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
Expand Down Expand Up @@ -288,6 +289,7 @@ async fn run_upgrade(
62 => run_versioned_upgrade(unopened_catalog_state, version, v62_to_v63::upgrade).await,
63 => run_versioned_upgrade(unopened_catalog_state, version, v63_to_v64::upgrade).await,
64 => run_versioned_upgrade(unopened_catalog_state, version, v64_to_v65::upgrade).await,
65 => run_versioned_upgrade(unopened_catalog_state, version, v65_to_v66::upgrade).await,

// Up-to-date, no migration needed!
CATALOG_VERSION => Ok(CATALOG_VERSION),
Expand Down
100 changes: 100 additions & 0 deletions src/catalog/src/durable/upgrade/snapshots/objects_v66.txt

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions src/catalog/src/durable/upgrade/v65_to_v66.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0.

use crate::durable::upgrade::MigrationAction;
use crate::durable::upgrade::{objects_v65 as v65, objects_v66 as v66};

/// In v66, we add various Continual Task enum variants.
pub fn upgrade(
_snapshot: Vec<v65::StateUpdateKind>,
) -> Vec<MigrationAction<v65::StateUpdateKind, v66::StateUpdateKind>> {
Vec::new()
}
1 change: 1 addition & 0 deletions test/sqllogictest/autogenerated/mz_internal.slt
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ mz_compute_hydration_statuses
mz_compute_hydration_times
mz_compute_operator_hydration_statuses
mz_compute_operator_hydration_statuses_per_worker
mz_continual_tasks
mz_frontiers
mz_global_frontiers
mz_history_retention_strategies
Expand Down
8 changes: 8 additions & 0 deletions test/sqllogictest/information_schema_tables.slt
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ mz_compute_operator_hydration_statuses_per_worker
SOURCE
materialize
mz_internal
mz_continual_tasks
BASE TABLE
materialize
mz_internal
mz_frontiers
SOURCE
materialize
Expand Down Expand Up @@ -497,6 +501,10 @@ mz_show_connections
VIEW
materialize
mz_internal
mz_show_continual_tasks
VIEW
materialize
mz_internal
mz_show_database_privileges
VIEW
materialize
Expand Down
2 changes: 2 additions & 0 deletions test/sqllogictest/oid.slt
Original file line number Diff line number Diff line change
Expand Up @@ -1132,3 +1132,5 @@ SELECT oid, name FROM mz_objects WHERE id LIKE 's%' AND oid < 20000 ORDER BY oid
17023 mz_wallclock_global_lag_recent_history
17024 mz_wallclock_global_lag_recent_history_ind
17025 mz_kafka_source_tables
17026 mz_continual_tasks
17027 mz_show_continual_tasks
2 changes: 2 additions & 0 deletions test/testdrive/catalog.td
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ mz_cluster_replica_statuses ""
mz_cluster_schedules ""
mz_cluster_workload_classes ""
mz_comments ""
mz_continual_tasks ""
mz_history_retention_strategies ""
mz_internal_cluster_replicas ""
mz_pending_cluster_replicas ""
Expand All @@ -622,6 +623,7 @@ mz_cluster_replica_utilization ""
mz_cluster_replica_utilization_history ""
mz_compute_hydration_statuses ""
mz_compute_operator_hydration_statuses ""
mz_show_continual_tasks ""
mz_global_frontiers ""
mz_hydration_statuses ""
mz_materialization_dependencies ""
Expand Down
1 change: 1 addition & 0 deletions test/testdrive/session.td
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ is_superuser off "Reports whether the
max_aws_privatelink_connections 0 "The maximum number of AWS PrivateLink connections in the region, across all schemas (Materialize)."
max_clusters 10 "The maximum number of clusters in the region (Materialize)."
max_connections 5000 "The maximum number of concurrent connections (PostgreSQL)."
max_continual_tasks 100 "The maximum number of continual tasks in the region, across all schemas (Materialize)."
max_copy_from_size 1073741824 "The maximum size in bytes we buffer for COPY FROM statements (Materialize)."
max_credit_consumption_rate 1024 "The maximum rate of credit consumption in a region. Credits are consumed based on the size of cluster replicas in use (Materialize)."
max_databases 1000 "The maximum number of databases in the region (Materialize)."
Expand Down

0 comments on commit 1f83c28

Please sign in to comment.