Skip to content

borg2: repoindex improvements#6705

Merged
ThomasWaldmann merged 3 commits intoborgbackup:borg2from
ThomasWaldmann:repoindex
Jun 14, 2022
Merged

borg2: repoindex improvements#6705
ThomasWaldmann merged 3 commits intoborgbackup:borg2from
ThomasWaldmann:repoindex

Conversation

@ThomasWaldmann
Copy link
Member

@ThomasWaldmann ThomasWaldmann commented May 18, 2022

improvements:

  • NSIndex: added the payload data size and an extra uint32 to the repo index
  • NSIndex1: keeps the repo index code for old borg
  • open_index peeks into the hashindex header to find out what's old and what's new.
  • NSIndex.flags can query/set/clear flags in the 32bit extra word

@ThomasWaldmann ThomasWaldmann changed the title Repoindex repoindex improvements May 18, 2022
@ThomasWaldmann ThomasWaldmann changed the title repoindex improvements borg2: repoindex improvements May 18, 2022
@ThomasWaldmann ThomasWaldmann force-pushed the repoindex branch 3 times, most recently from 4bf1be7 to 696f8aa Compare June 14, 2022 12:29
…ries

This saves some segment file random IO that was previously necessary
just to determine the size of to be deleted data.

Keep old one as NSIndex1 for old borg compatibility.
Choose NSIndex or NSIndex1 based on repo index layout from HashHeader.

for an old repo index repo.get(key) returns segment, offset, None, None
this fixes a strange test failure that did not happen until now:
it could not read the MAGIC bytes from a (quite new) segment file,
it just returned the empty string.

maybe its appearance is related to the removed I/O calls.
use this to query or set/clear flags in the "extra" word.

also: remove direct access to the "extra" word, adapt tests.
@ThomasWaldmann ThomasWaldmann merged commit dc4a1e6 into borgbackup:borg2 Jun 14, 2022
@ThomasWaldmann ThomasWaldmann deleted the repoindex branch June 14, 2022 12:51
snorkelopsstgtesting1-spec pushed a commit to snorkel-marlin-repos/borgbackup_borg_pr_6705_71411a73-d907-4e4b-bd68-b430eea13d6c that referenced this pull request Oct 22, 2025
Original PR #6705 by ThomasWaldmann
Original: borgbackup/borg#6705
snorkelopstesting4-web added a commit to snorkel-marlin-repos/borgbackup_borg_pr_6705_71411a73-d907-4e4b-bd68-b430eea13d6c that referenced this pull request Oct 22, 2025
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