Skip to content

Commit 2460cbf

Browse files
committed
[dnm] test Mz version jump
This is a test to find unknown things that prevent us from supporting upgrades across more than one version. The one known thing, the persist version check, is removed here. The test arbitrarily uses v0.140.0 as the base version and attempts to upgrade to the currently checked-out state. Run it like this: ``` bin/mzcompose --find upgrade run default ```
1 parent 5b0536b commit 2460cbf

File tree

3 files changed

+69
-4
lines changed

3 files changed

+69
-4
lines changed

src/catalog/src/durable/persist.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,10 +1008,7 @@ impl UnopenedPersistCatalogState {
10081008
if mz_persist_client::cfg::check_data_version(&version_in_upgrade_shard, &version)
10091009
.is_err()
10101010
{
1011-
return Err(DurableCatalogError::IncompatiblePersistVersion {
1012-
found_version: version_in_upgrade_shard,
1013-
catalog_version: version,
1014-
});
1011+
tracing::info!("optimistically ignoring persist version error");
10151012
}
10161013
}
10171014

test/upgrade/mzcompose

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright Materialize, Inc. and contributors. All rights reserved.
4+
#
5+
# Use of this software is governed by the Business Source License
6+
# included in the LICENSE file at the root of this repository.
7+
#
8+
# As of the Change Date specified in that file, in accordance with
9+
# the Business Source License, use of this software will be governed
10+
# by the Apache License, Version 2.0.
11+
#
12+
# mzcompose — runs Docker Compose with Materialize customizations.
13+
14+
exec "$(dirname "$0")"/../../bin/pyactivate -m materialize.cli.mzcompose "$@"

test/upgrade/mzcompose.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright Materialize, Inc. and contributors. All rights reserved.
2+
#
3+
# Use of this software is governed by the Business Source License
4+
# included in the LICENSE file at the root of this repository.
5+
#
6+
# As of the Change Date specified in that file, in accordance with
7+
# the Business Source License, use of this software will be governed
8+
# by the Apache License, Version 2.0.
9+
10+
11+
from materialize.mzcompose import get_default_system_parameters
12+
from materialize.mzcompose.composition import Composition
13+
from materialize.mzcompose.services.materialized import DeploymentStatus, Materialized
14+
from materialize.mzcompose.services.postgres import CockroachOrPostgresMetadata
15+
16+
BASE_VERSION = "v0.140.0"
17+
18+
SYSTEM_PARAMETER_DEFAULTS = get_default_system_parameters()
19+
20+
SERVICES = [
21+
CockroachOrPostgresMetadata(),
22+
Materialized(
23+
name="mz_old",
24+
sanity_restart=False,
25+
image=f"materialize/materialized:{BASE_VERSION}",
26+
deploy_generation=0,
27+
system_parameter_defaults=SYSTEM_PARAMETER_DEFAULTS,
28+
external_metadata_store=True,
29+
default_replication_factor=2,
30+
),
31+
Materialized(
32+
name="mz_new",
33+
sanity_restart=False,
34+
deploy_generation=1,
35+
system_parameter_defaults=SYSTEM_PARAMETER_DEFAULTS,
36+
restart="on-failure",
37+
external_metadata_store=True,
38+
default_replication_factor=2,
39+
),
40+
]
41+
42+
43+
def workflow_default(c: Composition):
44+
c.down(destroy_volumes=True)
45+
46+
c.up("mz_old")
47+
c.sql("SELECT * FROM mz_tables LIMIT 1", service="mz_old")
48+
49+
c.up("mz_new")
50+
c.await_mz_deployment_status(DeploymentStatus.READY_TO_PROMOTE, "mz_new")
51+
c.promote_mz("mz_new")
52+
c.await_mz_deployment_status(DeploymentStatus.IS_LEADER, "mz_new")
53+
54+
c.sql("SELECT * FROM mz_tables LIMIT 1", service="mz_new")

0 commit comments

Comments
 (0)