Skip to content

borg2: check [--repair] improvements #8466

Closed

Description

@ThomasWaldmann

Currently (beta12), borg2 check just deletes the chunks index cached in the repo. This is because borg check --repair might have deleted some invalid repo objects, thus the cached chunks index is not uptodate anymore. After that, first access to the repo will rebuild the chunks index cache (slow).

Guess we could just build and cache a new chunks index within borg check --repair and maybe also in borg check without --repair.

Activity

  1. added this to the 2.0.0b13 milestone on Oct 8, 2024
  2. ThomasWaldmann commented on Oct 10, 2024

    @ThomasWaldmann
    MemberAuthor

    Some improvements were done in #8468:

    It builds a ChunkIndex in the repository part of the check (for close to zero addtl. cost) and reuses it in the archives part (saving the slow rebuild there we had before).

    After the archives part, it still kills the ChunkIndex and triggers another rebuild by next operation though.

  3. removed this from the 2.0.0b18 milestone on Jun 18, 2025
  4. 17 remaining items

  5. mr-raj12 commented on Sep 16, 2026

    @mr-raj12
    Contributor

    Have raised draft PR #10379 for this, now finish() of check --repair re-reads only the packs written by the repair instead of all packs, kindly have a look once #10368 is merged.

  6. added a commit that references this issue on Sep 23, 2026
  7. ThomasWaldmann commented on Oct 5, 2026

    @ThomasWaldmann
    MemberAuthor

    This is done on master:

    Without --repair, borg check uses the stored index and does not rebuild it from the packs. With --repair, it walks all packs once. It needs to do that to find archives that reference chunks in missing packs.

    Avoiding unnecessary index rebuilds in other commands is tracked in #8476.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions