Skip to content

Commit

Permalink
mzcompose: Fortify mzcompose against MaterializeInc#15725
Browse files Browse the repository at this point in the history
Due to MaterializeInc#15725, environmentd may fail to spawn all the required
computeds unless the process orchestrator metadata is wiped
in advance.

We consolidate the wiping procedure in `up()` so that
all testing frameworks that happen to restart Mz can benefit.
  • Loading branch information
philip-stoev committed Nov 8, 2022
1 parent 3b5d516 commit 71611b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
8 changes: 0 additions & 8 deletions misc/python/materialize/checks/mzcompose_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ def execute(self, e: Executor) -> None:
)

with c.override(mz):
# Work around https://github.com/MaterializeInc/materialize/issues/15725
# by cleaning up Process Orchestrator metadata on restart
c.run(
"materialized",
"-c",
"rm -rf /mzdata/*.pid /mzdata/*.ports",
entrypoint="bash",
)
c.up("materialized")

c.wait_for_materialized()
Expand Down
10 changes: 10 additions & 0 deletions misc/python/materialize/mzcompose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,16 @@ def up(self, *services: str, detach: bool = True, persistent: bool = False) -> N
service["command"] = []
self._write_compose()

if "materialized" in services:
# Work around https://github.com/MaterializeInc/materialize/issues/15725
# by cleaning up Process Orchestrator metadata on restart
self.run(
"materialized",
"-c",
"rm -rf /mzdata/*.pid /mzdata/*.ports",
entrypoint="bash",
)

self.invoke("up", *(["--detach"] if detach else []), *services)

if persistent:
Expand Down
9 changes: 0 additions & 9 deletions misc/python/materialize/zippy/mz_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ class MzStart(Action):
"""Starts a Mz instance (all components are running in the same container)."""

def run(self, c: Composition) -> None:
# Work around https://github.com/MaterializeInc/materialize/issues/15725
# by cleaning up Process Orchestrator metadata on restart
c.run(
"materialized",
"-c",
"rm -rf /mzdata/*.pid /mzdata/*.ports",
entrypoint="bash",
)

c.up("materialized")
# Loaded Mz environments take a while to start up
c.wait_for_materialized(timeout_secs=300)
Expand Down

0 comments on commit 71611b0

Please sign in to comment.