reshard#

barecat.maintenance.reshard.reshard(bc, target_shard_size_limit)[source]#

Reshard the archive to a new shard size limit.

Optimized to avoid copying data that stays in place: - Shard0 is kept in place, files at the start that fit are not copied - Overflow goes to temp shard files - Old shards are truncated/deleted as they’re fully read (progressive storage reclaim) - Temp shards are renamed to final names at the end

Parameters:
  • bc (barecat.core.barecat.Barecat) – The barecat archive to reshard (must be opened read-write).

  • target_shard_size_limit (int) – The new shard size limit.

Raises: