Skip to content

Resending an image does not repair a truncated existing spill file #6087

Closed

Description

@Afloat16

Problem

persistImageToDisk treats every existing path as a complete image. Zero-byte or partial spill files stay broken even after a later request provides the complete original image again, so restored references keep pointing at truncated bytes.

Reproduction

At master 541cf26, build the incoming index from an actual image block, truncate its spill to zero or eight bytes, then index the same original image again. Both retain incomplete bytes on the base: 11 passed / 2 failed.

Expected

Skip writing only when the existing path is a regular file with the expected decoded byte count. Repair incomplete spills from original bytes. A third unchanged indexing pass preserves the completed file mtime; same-size corruption is outside this size-based repair.

Prior work

Screened all 3,221 cached upstream PRs. #2022 introduced image references and the existing-path fast path. Prior identity/collision and session cleanup work does not restore incomplete image bytes. Previous Afloat16 PRs #6046–#6055 are excluded.

Activity

  1. ranxianglei commented on Nov 12, 2026

    @ranxianglei
    Owner

    Fixed in batch PR #6439 (merged).

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions