Skip to content

fix(sqlite-storage): allow invalidate_v1_migration on non-migrating META#4813

Open
NathanFlurry wants to merge 1 commit intoengine-stabilize/runner-envoy-testsfrom
engine-stabilize/sqlite-invalidate-v1-passthrough
Open

fix(sqlite-storage): allow invalidate_v1_migration on non-migrating META#4813
NathanFlurry wants to merge 1 commit intoengine-stabilize/runner-envoy-testsfrom
engine-stabilize/sqlite-invalidate-v1-passthrough

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented Apr 27, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 27, 2026

Code Review: fix(sqlite-storage): allow invalidate_v1_migration on non-migrating META

Overview

This is a small targeted bug fix in reset_v1_migration. Previously, calling invalidate_v1_migration on an actor that had already passed the v1 migration stage (Native or MigratedFromV1 origin) would return a hard InvalidV1MigrationState error. This change makes that case a no-op (returns Ok(false)) since there is nothing stale to clean up, while preserving the hard error for prepare_v1_migration callers where invoking on an already-migrated actor represents a real bug.

The logic is correct and the fix is well-reasoned.


Issues

1. Em dash in comment — style violation

CLAUDE.md states: "Do not use em dashes (—). Use periods to separate sentences instead."

// no-op — there is nothing stale to clean up. For

Should be:

// no-op. There is nothing stale to clean up. For

2. Missing test coverage for the new code path

The fix introduces a meaningful new behavior: calling invalidate_v1_migration on an actor in Native or MigratedFromV1 state should return Ok(false) rather than an error. There is no test for this scenario. Given that the existing test suite already covers prepare_v1_migration thoroughly (see prepare_v1_migration_wipes_actor_rows_and_chunk_subkeys), a paired test like invalidate_v1_migration_on_already_migrated_actor_is_noop would be straightforward to add and would guard against regressions.

3. PR description checklist left blank

None of the checklist items are ticked. Worth marking at minimum: bug fix, self-review, and whether tests were added.


Minor observations

  • bail! is the right tool here and its explicit import is correct per the no-glob-import rule.
  • The else if require_stage_in_progress { return Ok(None) } branch (no META at all + invalidate call) is also a correct no-op and is unchanged by this PR.
  • invalidate_v1_migration returning Ok(false) for the new path correctly propagates through .is_some() at the call site.

Summary

The fix is logically sound and the diff is minimal. Two concrete asks before merge: fix the em dash in the comment, and add a test for the newly allowed no-op path.

@NathanFlurry NathanFlurry marked this pull request as ready for review April 27, 2026 10:02
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