Add indirection for large version vectors. (#6376)

This adds indirection of large version vectors in the same manner as we
already to block lists. The effect is the same: less duplicated data in
some situations.

To mitigate the impact for when this indirection
wouldn't be needed I've added an indirection cutoff for both blocks and
the new version vector stuff: we don't do the indirection at all for
small block lists or small version vectors, instead storing it directly
like we used to do. This is faster for small files and small setups.
This commit is contained in:
Jakob Borg
2020-05-13 14:28:42 +02:00
committed by GitHub
parent ba4462a70b
commit 531ceb2b0f
12 changed files with 570 additions and 216 deletions
+7 -4
View File
@@ -42,7 +42,8 @@ message FileInfoTruncated {
int32 block_size = 13 [(gogoproto.customname) = "RawBlockSize"];
// see bep.proto
uint32 local_flags = 1000;
uint32 local_flags = 1000;
bytes version_hash = 1001;
bool deleted = 6;
bool invalid = 7 [(gogoproto.customname) = "RawInvalid"];
@@ -54,9 +55,11 @@ message BlockList {
repeated protocol.BlockInfo Blocks = 1 [(gogoproto.nullable) = false];
}
// BlocksHashOnly is used to only unmarshal the block list hash from a FileInfo
message BlocksHashOnly {
bytes blocks_hash = 18;
// IndirectionHashesOnly is used to only unmarshal the indirection hashes
// from a FileInfo
message IndirectionHashesOnly {
bytes blocks_hash = 18;
bytes version_hash = 1001;
}
// For each folder and device we keep one of these to track the current