Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

migration: the copy and verify loops have no executing test, so a cursor or checksum regression reaches a cutover unmeasured #1314

Backlog

Description

@chappie-daemon

Found by job 045's security lens (row 5 of #868) at 8488bf13.

The fourteen in-file tests at crates/nostream-cli/src/commands/migrate.rs:1245-1700 cover the target refusals, the pin and the checksum arithmetic; none drives migrate_with or verify_with. The one test that replays a batch and folds the checksum is crates/nostream-storage/tests/migration_pg.rs, which is #[ignore]d and needs PARITY_ADMIN_URL, so it runs in CI's storage job and nowhere a CLI change is developed. Resumability is proven by construction and by a comment, not by a case that kills a run mid-table and resumes it.

Evidence

grep -n 'pub async fn migrate_with' crates/nostream-cli/src/commands/migrate.rs → 153:pub async fn migrate_with(

What a fix changes

Drive migrate_with over an in-memory MigrationSource that fails its fourth batch, then resume, and assert the manifest's cursor, row count and checksum. The security relevance is the cutover: a cursor that skips a batch or a checksum that folds a row twice is exactly the class the manifest exists to catch.

Acceptance

  • A test runs migrate_with to completion against a fake source and asserts the folded checksum.
  • A test kills the copy mid-table, resumes, and asserts no batch is copied twice and none is skipped.

Record: docs/rewrite/reviews/2026-11-30-relay-storage.md — finding F17, lens security, tree 8488bf13.

Activity

  1. added
    bug
    rewrite
    rust
    factory
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfactoryrewriterust

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions