Skip to content

Commit 0510991

Browse files
def-claude
andcommitted
parallel-workload: prepare (disabled) extensions 2 and 4
Land the coverage for extension directions 2 and 4 but leave it commented out of read_action_list, ready to flip on once the tracked bugs are fixed. Enabling now would only re-detect known-unfixed coordinator/compute bugs, breaking mergeability without finding anything new. - DependencyConsistencyAction (ext 2, dependency oracle): flags any mz_object_dependencies edge whose endpoints are not both live objects, the SQL-521 MissingUses class. Enable once SQL-521 is fixed. - SourceReadHoldSweepAction (ext 4, kill enrichment): reads source-backed relations to force read-hold acquisition on their remap shards, stressing reinstatement across restart (SS-346) and post-ALTER-TABLE-ADD-COLUMN as_of (PER-49). Enable once SS-346 and PER-49 are fixed. Extension 3 (namespace CASCADE races) is already prepared this way: DropDatabaseCascadeAction exists and is commented out with a SQL-518 TODO. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9e7fef4 commit 0510991

1 file changed

Lines changed: 83 additions & 0 deletions

File tree

  • misc/python/materialize/parallel_workload

misc/python/materialize/parallel_workload/action.py

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5309,6 +5309,85 @@ def run(self, exe: Executor) -> bool:
53095309
return True
53105310

53115311

5312+
class DependencyConsistencyAction(Action):
5313+
"""Client-side catalog dependency oracle: flag any dependency edge whose
5314+
endpoints are not both live objects (a dangling uses/used_by edge).
5315+
5316+
PREPARED BUT DISABLED (commented out of read_action_list). This targets the
5317+
SQL-521 class: a sink left pointing at a materialized view that was dropped
5318+
under cancel, i.e. the same MissingUses inconsistency the coordinator's own
5319+
check_consistency asserts on. While SQL-521 is open the workload
5320+
legitimately produces such danglers, so enabling this now would re-detect
5321+
the known corruption rather than find new bugs.
5322+
TODO: enable in read_action_list once SQL-521 is fixed. Verify the
5323+
mz_internal.mz_object_dependencies column names (object_id,
5324+
referenced_object_id) still hold when enabling."""
5325+
5326+
def errors_to_ignore(self, exe: Executor) -> list[str]:
5327+
return [
5328+
# Reading a catalog relation inside a read txn that already touched
5329+
# user objects crosses timedomains.
5330+
"in the same timedomain",
5331+
] + super().errors_to_ignore(exe)
5332+
5333+
def run(self, exe: Executor) -> bool:
5334+
exe.execute(
5335+
"SELECT d.object_id, d.referenced_object_id "
5336+
"FROM mz_internal.mz_object_dependencies d "
5337+
"LEFT JOIN mz_objects o1 ON d.object_id = o1.id "
5338+
"LEFT JOIN mz_objects o2 ON d.referenced_object_id = o2.id "
5339+
"WHERE o1.id IS NULL OR o2.id IS NULL",
5340+
http=Http.NO,
5341+
)
5342+
dangling = exe.cur.fetchall()
5343+
if dangling:
5344+
raise ValueError(
5345+
f"dangling catalog dependency edges (SQL-521 class): {dangling[:5]}"
5346+
)
5347+
return True
5348+
5349+
5350+
class SourceReadHoldSweepAction(Action):
5351+
"""Read a source-backed relation to force read-hold acquisition on the
5352+
source's remap shard.
5353+
5354+
PREPARED BUT DISABLED (commented out of read_action_list). Intended for the
5355+
kill scenario, where racing envd/clusterd restarts stresses read-hold
5356+
reinstatement: the SS-346 class (a dependent's read hold on a source's remap
5357+
shard not upheld across a restart, so its since advances past the
5358+
dependent's upper) and PER-49 (a compute import as_of behind the compacted
5359+
since after ALTER TABLE ADD COLUMN + kill). Enabling it now just re-triggers
5360+
those known coordinator/compute panics.
5361+
TODO: enable in read_action_list once SS-346 and PER-49 are fixed."""
5362+
5363+
def errors_to_ignore(self, exe: Executor) -> list[str]:
5364+
return [
5365+
"in the same timedomain",
5366+
] + super().errors_to_ignore(exe)
5367+
5368+
def run(self, exe: Executor) -> bool:
5369+
with exe.db.lock:
5370+
sources = [
5371+
o
5372+
for o in exe.db.db_objects()
5373+
if isinstance(
5374+
o,
5375+
LoadGeneratorSource
5376+
| KafkaSource
5377+
| PostgresSource
5378+
| MySqlSource
5379+
| SqlServerSource
5380+
| WebhookSource,
5381+
)
5382+
]
5383+
if not sources:
5384+
return False
5385+
obj = self.rng.choice(sources)
5386+
exe.execute(f"SELECT count(*) FROM {obj}", http=Http.RANDOM)
5387+
exe.cur.fetchall()
5388+
return True
5389+
5390+
53125391
class ActionList:
53135392
action_classes: list[type[Action]]
53145393
weights: list[float]
@@ -5342,6 +5421,10 @@ def __init__(
53425421
# EXPLAIN ANALYZE handle the drop gracefully). See SQL-519 /
53435422
# FINDINGS-BUGS.md.
53445423
# (ExplainFilterPushdownAction, 5),
5424+
# PREPARED BUT DISABLED (see class docstrings): enabling these now just
5425+
# re-detects known-unfixed coordinator bugs rather than finding new ones.
5426+
# (DependencyConsistencyAction, 5), # TODO: enable once SQL-521 fixed
5427+
# (SourceReadHoldSweepAction, 5), # TODO: enable once SS-346 & PER-49 fixed
53455428
(SetClusterAction, 1),
53465429
(CommitRollbackAction, 30),
53475430
(ReconnectAction, 1),

0 commit comments

Comments
 (0)