Skip to content

chunker: sparsify if all-zero data was read #5566

Closed
@ThomasWaldmann

Description

@ThomasWaldmann

related to #14:

once we have better sparse handling inside borg (communicating data vs. hole status between chunker, hashing, ...), it makes sense to add a sparsify functionality.

assume we read all-zero chunks from a file:

  1. could be a hole (no space allocated on disk) [we can avoid this with upcoming change from sparse map / file map support for fixed size chunker #5561]
  2. could be file space allocated, but never used (fallocate)
  3. could be zeros stored on disk

for the last 2 cases, we could add a --sparsify to borg create:

just compare the chunk content to an all-zero bytearray.

if it compares equal and --sparsify was given, the chunker shall (at least) yield "this is a hole of length X".

later it could yield (if we can detect somehow):

  • "this is a not-allocated hole of length X" (case 1)
  • "this is fallocated unused space of length X" (case 2)
  • "this is on-disk all-zero space of length X" (case 3)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions