Skip to content

refactor: remove legacy v1 schema migration logic #4862#4925

Open
neerajvipparla wants to merge 1 commit into
restatedev:mainfrom
neerajvipparla:fix/#4862
Open

refactor: remove legacy v1 schema migration logic #4862#4925
neerajvipparla wants to merge 1 commit into
restatedev:mainfrom
neerajvipparla:fix/#4862

Conversation

@neerajvipparla

Copy link
Copy Markdown
Contributor

Changes for #4862 — Remove schema V1 support and metadata v2 migration

What: PR #4861 added a one-shot migration that, on node startup, detected whether the schema in the metadata store was still in the old V1 format and re-wrote it as V2. That migration code was explicitly marked // todo(azmy): Remove in Restate v1.8. This PR does that cleanup, and also removes the V1 schema deserialization path that the migration depended on.


Deleted

  • crates/core/src/metadata/metadata_migrations.rs — the transit migrate_metadata function that read-modify-wrote the schema to force a V1→V2 re-serialization. No longer needed: any node that ran ≥1.7 has already migrated.

Modified

crates/core/src/lib.rs / crates/core/src/metadata.rs
Removed the mod metadata_migrations declaration and its pub use migrate_metadata re-export from both the inner and outer module.

crates/node/src/lib.rs
Removed the migrate_metadata import and the call to it inside Node::start. The startup sequence no longer performs a schema migration.

crates/types/src/schema/metadata/mod.rs
Removed the three additions that PR #4861 made to Schema:

  • legacy_v1: bool field (used as a sentinel to know migration was needed)
  • is_legacy_v1() accessor
  • touch() helper (bumped the version to force a metadata-store write)

crates/types/src/schema/metadata/serde_hacks.rs (largest change — ~1460 → 85 lines)
Removed all V1 schema support that predated PR #4861:

  • mod v1_data_model — the old on-disk types (ServiceSchemas, ServiceLocation, DeploymentSchemas, HandlerSchemas, InvocationTargetMetadata and their inner serde compat shims)
  • mod conversions — V1Schemas/V2Schemas structs and into_v2/into_v1 conversion logic
  • The services and deployments (V1) fields from the intermediate serde Schema struct
  • The V1 deserialization branch (else if let (Some(services), Some(deployments))) in From for super::Schema
  • Both integration tests (old_to_new, v2_to_v1_to_schema) that exercised V1 round-trips

The From for super::Schema impl now expects deployments_v2 to be present — any attempt to load V1 data against v1.8+ will produce a clear error message directing the user to upgrade via v1.7 first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant