Marten 9.32.1 needs an event-store schema migration in the 3.x-to-4.0 upgrade
- Dominant language
- C#
- Stars
- 6
- Forks
- 7
- Avg merge
- 4h 21m
- Merged PRs (30d)
- 307
Description
Dependabot #656 bumped Marten 9.30.0 to 9.32.1 and JasperFx 2.56.0 to 2.66.0. The build and the event-sourcing suite pass on those versions, but the `Upgrade from 3.x` gate fails, and the reason is real:
Marten 9.32.1 changes its own event-store schema. It expects a new `mt_streams.compacted_version` column and about a dozen new `mt_event_progression` columns (`mode`, `rebuild_threshold`, `assigned_node`, `heartbeat`, `agent_status`, `pause_reason`, `running_on_node`, `critical_behind_threshold`, `failure_category`, `failure_event_sequence`, `failure_event_type`, `failure_event_tenant_id`).
Production runs `AutoCreate.CreateOnly`, which creates missing objects on a fresh database but does not alter an existing one, so an upgraded 3.x database never gets those columns and `AssertDatabaseMatchesConfigurationAsync` fails.
To take the bump:
- Add Marten 9.32.1's internal DDL for `mt_streams` and `mt_event_progression` to `migrations/4.0.0/3.x-to-4.0.sql` (or a dedicated Marten-schema step). Marten can emit the DDL, so generate it rather than hand-write.
- Add the matching drops to `migrations/4.0.0/rollback-to-3.x.sql`.
- Re-prove `scripts/upgrade-check.sh` end to end.
Deferred out of #656 so the 4.0 tag is not carrying a fresh data-layer migration. #656 keeps the safe test-infra bumps. Take this in 4.0.1.
Contributor guide
Research direction
Inspect migrations/4.0.0/3.x-to-4.0.sql and rollback-to-3.x.sql, then use Marten 9.32.1 to generate the required event-store DDL. Add the forward schema changes and matching rollback drops, and run scripts/upgrade-check.sh end to end to confirm the 3.x-to-4.0 upgrade passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100