From 531ceb2b0f17389bfa4e372d2a0c537601b0f556 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 13 May 2020 14:28:42 +0200 Subject: [PATCH] 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. --- cmd/stindex/idxck.go | 39 ++++- lib/db/keyer.go | 21 ++- lib/db/lowlevel.go | 66 ++++++-- lib/db/schemaupdater.go | 41 +++-- lib/db/structs.pb.go | 243 +++++++++++++++++++--------- lib/db/structs.proto | 11 +- lib/db/transactions.go | 59 ++++++- lib/model/model.go | 6 +- lib/protocol/bep.pb.go | 283 +++++++++++++++++++-------------- lib/protocol/bep.proto | 3 + lib/protocol/bep_extensions.go | 13 ++ lib/sha256/sha256.go | 1 + 12 files changed, 570 insertions(+), 216 deletions(-) diff --git a/cmd/stindex/idxck.go b/cmd/stindex/idxck.go index cf752820e..6f5011a08 100644 --- a/cmd/stindex/idxck.go +++ b/cmd/stindex/idxck.go @@ -43,7 +43,9 @@ func idxck(ldb backend.Backend) (success bool) { sequences := make(map[sequenceKey]string) needs := make(map[globalKey]struct{}) blocklists := make(map[string]struct{}) + versions := make(map[string]protocol.Vector) usedBlocklists := make(map[string]struct{}) + usedVersions := make(map[string]struct{}) var localDeviceKey uint32 success = true @@ -106,6 +108,16 @@ func idxck(ldb backend.Backend) (success bool) { case db.KeyTypeBlockList: hash := string(key[1:]) blocklists[hash] = struct{}{} + + case db.KeyTypeVersion: + hash := string(key[1:]) + var v protocol.Vector + if err := v.Unmarshal(it.Value()); err != nil { + fmt.Println("Unable to unmarshal Vector:", err) + success = false + continue + } + versions[hash] = v } } @@ -157,6 +169,23 @@ func idxck(ldb backend.Backend) (success bool) { usedBlocklists[key] = struct{}{} } } + + if fi.VersionHash != nil { + key := string(fi.VersionHash) + if _, ok := versions[key]; !ok { + fmt.Printf("Missing version vector for file %q, version hash %x\n", fi.Name, fi.VersionHash) + success = false + } else { + usedVersions[key] = struct{}{} + } + } + + _, ok := globals[globalKey{fk.folder, fk.name}] + if !ok { + fmt.Printf("Missing global for file %q\n", fi.Name) + success = false + continue + } } // Aggregate the ranges of missing sequence entries, print them @@ -201,7 +230,12 @@ func idxck(ldb backend.Backend) (success bool) { fmt.Printf("VersionList %q, folder %q, entry %d refers to unknown FileInfo\n", gk.name, folder, i) success = false } - if !fi.Version.Equal(fv.Version) { + + fiv := fi.Version + if fi.VersionHash != nil { + fiv = versions[string(fi.VersionHash)] + } + if !fiv.Equal(fv.Version) { fmt.Printf("VersionList %q, folder %q, entry %d, FileInfo version mismatch, %v (VersionList) != %v (FileInfo)\n", gk.name, folder, i, fv.Version, fi.Version) success = false } @@ -277,6 +311,9 @@ func idxck(ldb backend.Backend) (success bool) { if d := len(blocklists) - len(usedBlocklists); d > 0 { fmt.Printf("%d block list entries out of %d needs GC\n", d, len(blocklists)) } + if d := len(versions) - len(usedVersions); d > 0 { + fmt.Printf("%d version entries out of %d needs GC\n", d, len(versions)) + } return } diff --git a/lib/db/keyer.go b/lib/db/keyer.go index 88103eb07..f3e15feff 100644 --- a/lib/db/keyer.go +++ b/lib/db/keyer.go @@ -65,6 +65,9 @@ const ( // KeyTypeBlockListMap = KeyTypeBlockListMap = 14 + + // KeyTypeVersion = Vector + KeyTypeVersion = 15 ) type keyer interface { @@ -104,6 +107,9 @@ type keyer interface { // Block lists GenerateBlockListKey(key []byte, hash []byte) blockListKey + + // Version vectors + GenerateVersionKey(key []byte, hash []byte) versionKey } // defaultKeyer implements our key scheme. It needs folder and device @@ -328,7 +334,20 @@ func (k defaultKeyer) GenerateBlockListKey(key []byte, hash []byte) blockListKey return key } -func (k blockListKey) BlocksHash() []byte { +func (k blockListKey) Hash() []byte { + return k[keyPrefixLen:] +} + +type versionKey []byte + +func (k defaultKeyer) GenerateVersionKey(key []byte, hash []byte) versionKey { + key = resize(key, keyPrefixLen+len(hash)) + key[0] = KeyTypeVersion + copy(key[keyPrefixLen:], hash) + return key +} + +func (k versionKey) Hash() []byte { return k[keyPrefixLen:] } diff --git a/lib/db/lowlevel.go b/lib/db/lowlevel.go index 985aa29eb..5bcfe3ba5 100644 --- a/lib/db/lowlevel.go +++ b/lib/db/lowlevel.go @@ -15,6 +15,7 @@ import ( "github.com/greatroar/blobloom" "github.com/syncthing/syncthing/lib/db/backend" "github.com/syncthing/syncthing/lib/protocol" + "github.com/syncthing/syncthing/lib/sha256" "github.com/syncthing/syncthing/lib/sync" "github.com/syncthing/syncthing/lib/util" "github.com/thejerf/suture" @@ -34,6 +35,8 @@ const ( // Use indirection for the block list when it exceeds this many entries blocksIndirectionCutoff = 3 + // Use indirection for the version vector when it exceeds this many entries + versionIndirectionCutoff = 10 recheckDefaultInterval = 30 * 24 * time.Hour ) @@ -630,11 +633,8 @@ func (db *Lowlevel) gcIndirect(ctx context.Context) error { if db.gcKeyCount > capacity { capacity = db.gcKeyCount } - blockFilter := blobloom.NewOptimized(blobloom.Config{ - Capacity: uint64(capacity), - FPRate: indirectGCBloomFalsePositiveRate, - MaxBits: 8 * indirectGCBloomMaxBytes, - }) + blockFilter := newBloomFilter(capacity) + versionFilter := newBloomFilter(capacity) // Iterate the FileInfos, unmarshal the block and version hashes and // add them to the filter. @@ -651,12 +651,15 @@ func (db *Lowlevel) gcIndirect(ctx context.Context) error { default: } - var bl BlocksHashOnly - if err := bl.Unmarshal(it.Value()); err != nil { + var hashes IndirectionHashesOnly + if err := hashes.Unmarshal(it.Value()); err != nil { return err } - if len(bl.BlocksHash) > 0 { - blockFilter.Add(bloomHash(bl.BlocksHash)) + if len(hashes.BlocksHash) > 0 { + blockFilter.Add(bloomHash(hashes.BlocksHash)) + } + if len(hashes.VersionHash) > 0 { + versionFilter.Add(bloomHash(hashes.VersionHash)) } } it.Release() @@ -681,7 +684,7 @@ func (db *Lowlevel) gcIndirect(ctx context.Context) error { } key := blockListKey(it.Key()) - if blockFilter.Has(bloomHash(key.BlocksHash())) { + if blockFilter.Has(bloomHash(key.Hash())) { matchedBlocks++ continue } @@ -694,8 +697,40 @@ func (db *Lowlevel) gcIndirect(ctx context.Context) error { return err } + // Iterate over version lists, removing keys with hashes that don't match + // the filter. + + it, err = db.NewPrefixIterator([]byte{KeyTypeVersion}) + if err != nil { + return err + } + matchedVersions := 0 + for it.Next() { + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + + key := versionKey(it.Key()) + if versionFilter.Has(bloomHash(key.Hash())) { + matchedVersions++ + continue + } + if err := t.Delete(key); err != nil { + return err + } + } + it.Release() + if err := it.Error(); err != nil { + return err + } + // Remember the number of unique keys we kept until the next pass. db.gcKeyCount = matchedBlocks + if matchedVersions > matchedBlocks { + db.gcKeyCount = matchedVersions + } if err := t.Commit(); err != nil { return err @@ -704,9 +739,20 @@ func (db *Lowlevel) gcIndirect(ctx context.Context) error { return db.Compact() } +func newBloomFilter(capacity int) *blobloom.Filter { + return blobloom.NewOptimized(blobloom.Config{ + Capacity: uint64(capacity), + FPRate: indirectGCBloomFalsePositiveRate, + MaxBits: 8 * indirectGCBloomMaxBytes, + }) +} + // Hash function for the bloomfilter: first eight bytes of the SHA-256. // Big or little-endian makes no difference, as long as we're consistent. func bloomHash(key []byte) uint64 { + if len(key) != sha256.Size { + panic("bug: bloomHash passed something not a SHA256 hash") + } return binary.BigEndian.Uint64(key) } diff --git a/lib/db/schemaupdater.go b/lib/db/schemaupdater.go index f973b2f9f..b2d6f1f86 100644 --- a/lib/db/schemaupdater.go +++ b/lib/db/schemaupdater.go @@ -23,9 +23,10 @@ import ( // 7: v0.14.53 // 8-9: v1.4.0 // 10-11: v1.6.0 +// 12: v1.7.0 const ( - dbVersion = 11 - dbMinSyncthingVersion = "v1.6.0" + dbVersion = 12 + dbMinSyncthingVersion = "v1.7.0" ) type databaseDowngradeError struct { @@ -88,6 +89,7 @@ func (db *schemaUpdater) updateSchema() error { {9, db.updateSchemaTo9}, {10, db.updateSchemaTo10}, {11, db.updateSchemaTo11}, + {12, db.updateSchemaTo12}, } for _, m := range migrations { @@ -453,7 +455,6 @@ func (db *schemaUpdater) updateSchema6to7(_ int) error { func (db *schemaUpdater) updateSchemaTo9(prev int) error { // Loads and rewrites all files with blocks, to deduplicate block lists. - // Checks for missing or incorrect sequence entries and rewrites those. t, err := db.newReadWriteTransaction() if err != nil { @@ -461,6 +462,16 @@ func (db *schemaUpdater) updateSchemaTo9(prev int) error { } defer t.close() + if err := db.rewriteFiles(t); err != nil { + return err + } + + db.recordTime(indirectGCTimeKey) + + return t.Commit() +} + +func (db *schemaUpdater) rewriteFiles(t readWriteTransaction) error { it, err := t.NewPrefixIterator([]byte{KeyTypeDevice}) if err != nil { return err @@ -491,13 +502,7 @@ func (db *schemaUpdater) updateSchemaTo9(prev int) error { } } it.Release() - if err := it.Error(); err != nil { - return err - } - - db.recordTime(indirectGCTimeKey) - - return t.Commit() + return it.Error() } func (db *schemaUpdater) updateSchemaTo10(_ int) error { @@ -610,3 +615,19 @@ func (db *schemaUpdater) updateSchemaTo11(_ int) error { } return t.Commit() } + +func (db *schemaUpdater) updateSchemaTo12(_ int) error { + // Loads and rewrites all files, to deduplicate version vectors. + + t, err := db.newReadWriteTransaction() + if err != nil { + return err + } + defer t.close() + + if err := db.rewriteFiles(t); err != nil { + return err + } + + return t.Commit() +} diff --git a/lib/db/structs.pb.go b/lib/db/structs.pb.go index 7b829d188..d343c80e6 100644 --- a/lib/db/structs.pb.go +++ b/lib/db/structs.pb.go @@ -118,6 +118,7 @@ type FileInfoTruncated struct { RawBlockSize int32 `protobuf:"varint,13,opt,name=block_size,json=blockSize,proto3" json:"block_size,omitempty"` // see bep.proto LocalFlags uint32 `protobuf:"varint,1000,opt,name=local_flags,json=localFlags,proto3" json:"local_flags,omitempty"` + VersionHash []byte `protobuf:"bytes,1001,opt,name=version_hash,json=versionHash,proto3" json:"version_hash,omitempty"` Deleted bool `protobuf:"varint,6,opt,name=deleted,proto3" json:"deleted,omitempty"` RawInvalid bool `protobuf:"varint,7,opt,name=invalid,proto3" json:"invalid,omitempty"` NoPermissions bool `protobuf:"varint,8,opt,name=no_permissions,json=noPermissions,proto3" json:"no_permissions,omitempty"` @@ -193,23 +194,25 @@ func (m *BlockList) XXX_DiscardUnknown() { var xxx_messageInfo_BlockList proto.InternalMessageInfo -// BlocksHashOnly is used to only unmarshal the block list hash from a FileInfo -type BlocksHashOnly struct { - BlocksHash []byte `protobuf:"bytes,18,opt,name=blocks_hash,json=blocksHash,proto3" json:"blocks_hash,omitempty"` +// IndirectionHashesOnly is used to only unmarshal the indirection hashes +// from a FileInfo +type IndirectionHashesOnly struct { + BlocksHash []byte `protobuf:"bytes,18,opt,name=blocks_hash,json=blocksHash,proto3" json:"blocks_hash,omitempty"` + VersionHash []byte `protobuf:"bytes,1001,opt,name=version_hash,json=versionHash,proto3" json:"version_hash,omitempty"` } -func (m *BlocksHashOnly) Reset() { *m = BlocksHashOnly{} } -func (m *BlocksHashOnly) String() string { return proto.CompactTextString(m) } -func (*BlocksHashOnly) ProtoMessage() {} -func (*BlocksHashOnly) Descriptor() ([]byte, []int) { +func (m *IndirectionHashesOnly) Reset() { *m = IndirectionHashesOnly{} } +func (m *IndirectionHashesOnly) String() string { return proto.CompactTextString(m) } +func (*IndirectionHashesOnly) ProtoMessage() {} +func (*IndirectionHashesOnly) Descriptor() ([]byte, []int) { return fileDescriptor_e774e8f5f348d14d, []int{4} } -func (m *BlocksHashOnly) XXX_Unmarshal(b []byte) error { +func (m *IndirectionHashesOnly) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *BlocksHashOnly) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *IndirectionHashesOnly) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_BlocksHashOnly.Marshal(b, m, deterministic) + return xxx_messageInfo_IndirectionHashesOnly.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -219,17 +222,17 @@ func (m *BlocksHashOnly) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *BlocksHashOnly) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlocksHashOnly.Merge(m, src) +func (m *IndirectionHashesOnly) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndirectionHashesOnly.Merge(m, src) } -func (m *BlocksHashOnly) XXX_Size() int { +func (m *IndirectionHashesOnly) XXX_Size() int { return m.ProtoSize() } -func (m *BlocksHashOnly) XXX_DiscardUnknown() { - xxx_messageInfo_BlocksHashOnly.DiscardUnknown(m) +func (m *IndirectionHashesOnly) XXX_DiscardUnknown() { + xxx_messageInfo_IndirectionHashesOnly.DiscardUnknown(m) } -var xxx_messageInfo_BlocksHashOnly proto.InternalMessageInfo +var xxx_messageInfo_IndirectionHashesOnly proto.InternalMessageInfo // For each folder and device we keep one of these to track the current // counts and sequence. We also keep one for the global state of the folder. @@ -320,7 +323,7 @@ func init() { proto.RegisterType((*VersionList)(nil), "db.VersionList") proto.RegisterType((*FileInfoTruncated)(nil), "db.FileInfoTruncated") proto.RegisterType((*BlockList)(nil), "db.BlockList") - proto.RegisterType((*BlocksHashOnly)(nil), "db.BlocksHashOnly") + proto.RegisterType((*IndirectionHashesOnly)(nil), "db.IndirectionHashesOnly") proto.RegisterType((*Counts)(nil), "db.Counts") proto.RegisterType((*CountsSet)(nil), "db.CountsSet") } @@ -328,54 +331,56 @@ func init() { func init() { proto.RegisterFile("structs.proto", fileDescriptor_e774e8f5f348d14d) } var fileDescriptor_e774e8f5f348d14d = []byte{ - // 747 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xbf, 0x8f, 0xe2, 0x46, - 0x14, 0xc6, 0x07, 0x66, 0xe1, 0x19, 0xc8, 0xdd, 0xe4, 0xb4, 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 0xfc, 0x4a, 0x80, - 0x77, 0x69, 0x92, 0xff, 0xaf, 0x4a, 0xe3, 0x7f, 0x0c, 0x68, 0x7f, 0xcb, 0x76, 0xa9, 0xe0, 0xe8, - 0x25, 0x98, 0x4b, 0x9a, 0x10, 0xae, 0xcc, 0x6e, 0x62, 0x0d, 0xe4, 0x99, 0x62, 0x9a, 0x29, 0x17, - 0x51, 0xc2, 0x95, 0x9a, 0x26, 0xae, 0x53, 0xca, 0x4c, 0xda, 0x1a, 0x5c, 0x7d, 0x13, 0x26, 0xae, - 0xf0, 0xd3, 0xef, 0xd6, 0x3c, 0x9d, 0xf0, 0x25, 0x98, 0x61, 0x2e, 0x48, 0xf9, 0xb1, 0x68, 0xf0, - 0xc8, 0x98, 0xed, 0x27, 0xc6, 0x1c, 0x42, 0x47, 0xbf, 0x13, 0xb3, 0xb7, 0xca, 0x92, 0x3d, 0x5c, - 0x61, 0xe4, 0x40, 0x4d, 0x38, 0xb5, 0xe6, 0x23, 0x29, 0xc7, 0xef, 0xa0, 0xab, 0xb7, 0x9c, 0x13, - 0x81, 0x3c, 0x68, 0x47, 0x0a, 0x14, 0x97, 0x05, 0xf9, 0x42, 0xe8, 0x74, 0x79, 0x50, 0x9d, 0x97, - 0xe3, 0x47, 0x19, 0x91, 0x2f, 0x81, 0x5a, 0xbc, 0x89, 0x4b, 0xe8, 0xbb, 0xf7, 0x7f, 0x3b, 0x8d, - 0xfb, 0x83, 0x63, 0x3c, 0x1c, 0x1c, 0xe3, 0xaf, 0x83, 0xd3, 0xf8, 0xed, 0xe8, 0x34, 0xee, 0x8e, - 0x8e, 0xf1, 0x70, 0x74, 0x1a, 0x7f, 0x1c, 0x9d, 0x46, 0xd8, 0x56, 0x72, 0xbd, 0xf9, 0x2f, 0x00, - 0x00, 0xff, 0xff, 0x8a, 0x67, 0x08, 0x85, 0x7f, 0x05, 0x00, 0x00, + // 774 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x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 0x3f, 0x38, + 0xc6, 0x9f, 0x07, 0xa7, 0xf6, 0xcb, 0xd1, 0xa9, 0xdd, 0x1e, 0x1d, 0xe3, 0xfe, 0xe8, 0xd4, 0x7e, + 0x3f, 0x3a, 0xb5, 0xa0, 0xa9, 0x94, 0x7d, 0xfd, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3a, 0x45, + 0x1c, 0xc5, 0xce, 0x05, 0x00, 0x00, } func (m *FileVersion) Marshal() (dAtA []byte, err error) { @@ -495,6 +500,15 @@ func (m *FileInfoTruncated) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.VersionHash) > 0 { + i -= len(m.VersionHash) + copy(dAtA[i:], m.VersionHash) + i = encodeVarintStructs(dAtA, i, uint64(len(m.VersionHash))) + i-- + dAtA[i] = 0x3e + i-- + dAtA[i] = 0xca + } if m.LocalFlags != 0 { i = encodeVarintStructs(dAtA, i, uint64(m.LocalFlags)) i-- @@ -647,7 +661,7 @@ func (m *BlockList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *BlocksHashOnly) Marshal() (dAtA []byte, err error) { +func (m *IndirectionHashesOnly) Marshal() (dAtA []byte, err error) { size := m.ProtoSize() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -657,16 +671,25 @@ func (m *BlocksHashOnly) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BlocksHashOnly) MarshalTo(dAtA []byte) (int, error) { +func (m *IndirectionHashesOnly) MarshalTo(dAtA []byte) (int, error) { size := m.ProtoSize() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *BlocksHashOnly) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *IndirectionHashesOnly) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.VersionHash) > 0 { + i -= len(m.VersionHash) + copy(dAtA[i:], m.VersionHash) + i = encodeVarintStructs(dAtA, i, uint64(len(m.VersionHash))) + i-- + dAtA[i] = 0x3e + i-- + dAtA[i] = 0xca + } if len(m.BlocksHash) > 0 { i -= len(m.BlocksHash) copy(dAtA[i:], m.BlocksHash) @@ -893,6 +916,10 @@ func (m *FileInfoTruncated) ProtoSize() (n int) { if m.LocalFlags != 0 { n += 2 + sovStructs(uint64(m.LocalFlags)) } + l = len(m.VersionHash) + if l > 0 { + n += 2 + l + sovStructs(uint64(l)) + } return n } @@ -911,7 +938,7 @@ func (m *BlockList) ProtoSize() (n int) { return n } -func (m *BlocksHashOnly) ProtoSize() (n int) { +func (m *IndirectionHashesOnly) ProtoSize() (n int) { if m == nil { return 0 } @@ -921,6 +948,10 @@ func (m *BlocksHashOnly) ProtoSize() (n int) { if l > 0 { n += 2 + l + sovStructs(uint64(l)) } + l = len(m.VersionHash) + if l > 0 { + n += 2 + l + sovStructs(uint64(l)) + } return n } @@ -1620,6 +1651,40 @@ func (m *FileInfoTruncated) Unmarshal(dAtA []byte) error { break } } + case 1001: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VersionHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStructs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStructs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStructs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VersionHash = append(m.VersionHash[:0], dAtA[iNdEx:postIndex]...) + if m.VersionHash == nil { + m.VersionHash = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipStructs(dAtA[iNdEx:]) @@ -1731,7 +1796,7 @@ func (m *BlockList) Unmarshal(dAtA []byte) error { } return nil } -func (m *BlocksHashOnly) Unmarshal(dAtA []byte) error { +func (m *IndirectionHashesOnly) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1754,10 +1819,10 @@ func (m *BlocksHashOnly) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BlocksHashOnly: wiretype end group for non-group") + return fmt.Errorf("proto: IndirectionHashesOnly: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BlocksHashOnly: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IndirectionHashesOnly: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 18: @@ -1794,6 +1859,40 @@ func (m *BlocksHashOnly) Unmarshal(dAtA []byte) error { m.BlocksHash = []byte{} } iNdEx = postIndex + case 1001: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VersionHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStructs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthStructs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthStructs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VersionHash = append(m.VersionHash[:0], dAtA[iNdEx:postIndex]...) + if m.VersionHash == nil { + m.VersionHash = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipStructs(dAtA[iNdEx:]) diff --git a/lib/db/structs.proto b/lib/db/structs.proto index 0f99e70e8..5a488e9a8 100644 --- a/lib/db/structs.proto +++ b/lib/db/structs.proto @@ -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 diff --git a/lib/db/transactions.go b/lib/db/transactions.go index 0bb091363..37aedacb3 100644 --- a/lib/db/transactions.go +++ b/lib/db/transactions.go @@ -79,6 +79,9 @@ func (t readOnlyTransaction) unmarshalTrunc(bs []byte, trunc bool) (FileIntf, er if err != nil { return nil, err } + if err := t.fillTruncated(&tf); err != nil { + return nil, err + } return tf, nil } @@ -92,7 +95,8 @@ func (t readOnlyTransaction) unmarshalTrunc(bs []byte, trunc bool) (FileIntf, er return fi, nil } -// fillFileInfo follows the (possible) indirection of blocks and fills it out. +// fillFileInfo follows the (possible) indirection of blocks and version +// vector and fills it out. func (t readOnlyTransaction) fillFileInfo(fi *protocol.FileInfo) error { var key []byte @@ -110,6 +114,41 @@ func (t readOnlyTransaction) fillFileInfo(fi *protocol.FileInfo) error { fi.Blocks = bl.Blocks } + if len(fi.VersionHash) != 0 { + key = t.keyer.GenerateVersionKey(key, fi.VersionHash) + bs, err := t.Get(key) + if err != nil { + return err + } + var v protocol.Vector + if err := v.Unmarshal(bs); err != nil { + return err + } + fi.Version = v + } + + return nil +} + +// fillTruncated follows the (possible) indirection of version vector and +// fills it. +func (t readOnlyTransaction) fillTruncated(fi *FileInfoTruncated) error { + var key []byte + + if len(fi.VersionHash) == 0 { + return nil + } + + key = t.keyer.GenerateVersionKey(key, fi.VersionHash) + bs, err := t.Get(key) + if err != nil { + return err + } + var v protocol.Vector + if err := v.Unmarshal(bs); err != nil { + return err + } + fi.Version = v return nil } @@ -511,6 +550,24 @@ func (t readWriteTransaction) putFile(fkey []byte, fi protocol.FileInfo, truncat fi.Blocks = nil } + // Indirect the version vector if it's large enough. + if len(fi.Version.Counters) > versionIndirectionCutoff { + fi.VersionHash = protocol.VectorHash(fi.Version) + bkey = t.keyer.GenerateVersionKey(bkey, fi.VersionHash) + if _, err := t.Get(bkey); backend.IsNotFound(err) { + // Marshal the version vector and save it + versionBs := mustMarshal(&fi.Version) + if err := t.Put(bkey, versionBs); err != nil { + return err + } + } else if err != nil { + return err + } + fi.Version = protocol.Vector{} + } else { + fi.VersionHash = nil + } + fiBs := mustMarshal(&fi) return t.Put(fkey, fiBs) } diff --git a/lib/model/model.go b/lib/model/model.go index 27b3180ef..3167de7b5 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -924,6 +924,7 @@ func (m *model) handleIndex(deviceID protocol.DeviceID, folder string, fs []prot // The local attributes should never be transmitted over the wire. // Make sure they look like they weren't. fs[i].LocalFlags = 0 + fs[i].VersionHash = nil } files.Update(deviceID, fs) @@ -1968,7 +1969,10 @@ func (s *indexSender) sendIndexTo(ctx context.Context) error { if f.IsReceiveOnlyChanged() { f.Version = protocol.Vector{} } - f.LocalFlags = 0 // never sent externally + + // never sent externally + f.LocalFlags = 0 + f.VersionHash = nil previousWasDelete = f.IsDeleted() diff --git a/lib/protocol/bep.pb.go b/lib/protocol/bep.pb.go index a8d347a5f..a459cfbbe 100644 --- a/lib/protocol/bep.pb.go +++ b/lib/protocol/bep.pb.go @@ -506,7 +506,10 @@ type FileInfo struct { // host only. It is not part of the protocol, doesn't get sent or // received (we make sure to zero it), nonetheless we need it on our // struct and to be able to serialize it to/from the database. - LocalFlags uint32 `protobuf:"varint,1000,opt,name=local_flags,json=localFlags,proto3" json:"local_flags,omitempty"` + LocalFlags uint32 `protobuf:"varint,1000,opt,name=local_flags,json=localFlags,proto3" json:"local_flags,omitempty"` + // The version_hash is an implementation detail and not part of the wire + // format. + VersionHash []byte `protobuf:"bytes,1001,opt,name=version_hash,json=versionHash,proto3" json:"version_hash,omitempty"` Deleted bool `protobuf:"varint,6,opt,name=deleted,proto3" json:"deleted,omitempty"` RawInvalid bool `protobuf:"varint,7,opt,name=invalid,proto3" json:"invalid,omitempty"` NoPermissions bool `protobuf:"varint,8,opt,name=no_permissions,json=noPermissions,proto3" json:"no_permissions,omitempty"` @@ -922,122 +925,123 @@ func init() { func init() { proto.RegisterFile("bep.proto", fileDescriptor_e3f59eb60afbbc6e) } var fileDescriptor_e3f59eb60afbbc6e = []byte{ - // 1825 bytes of a gzipped FileDescriptorProto + // 1842 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x73, 0xdb, 0xc6, - 0x15, 0x26, 0x48, 0xf0, 0xd7, 0x23, 0xa5, 0x40, 0x6b, 0x5b, 0x45, 0x61, 0x9b, 0x84, 0x69, 0x3b, - 0x66, 0x34, 0xa9, 0xed, 0x26, 0x69, 0x3b, 0xed, 0xb4, 0x9d, 0xe1, 0x0f, 0x48, 0xe6, 0x54, 0x26, - 0xd5, 0x25, 0xe5, 0xd4, 0x39, 0x14, 0x03, 0x11, 0x4b, 0x0a, 0x63, 0x10, 0xcb, 0x02, 0xa0, 0x64, - 0xe6, 0x4f, 0xe0, 0xa9, 0xc7, 0x5e, 0x38, 0x93, 0x99, 0x9e, 0xfa, 0x9f, 0xf8, 0xe8, 0xf6, 0xd4, - 0xe9, 0x41, 0xd3, 0xc8, 0x97, 0x1c, 0x7b, 0xe9, 0xb5, 0xed, 0xec, 0x2e, 0x40, 0x82, 0x52, 0x9c, - 0xc9, 0xa1, 0x27, 0xec, 0xbe, 0xf7, 0xed, 0x5b, 0xec, 0xf7, 0xde, 0xfb, 0x76, 0xa1, 0x78, 0x42, - 0xa6, 0x8f, 0xa7, 0x3e, 0x0d, 0x29, 0x2a, 0xf0, 0xcf, 0x90, 0xba, 0xda, 0x7d, 0x9f, 0x4c, 0x69, - 0xf0, 0x84, 0xcf, 0x4f, 0x66, 0xa3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0xb5, 0x4e, 0x88, 0x1b, 0x91, 0x23, 0x26, 0xe8, 0x36, 0x14, + 0x7d, 0x62, 0xd9, 0x26, 0xf5, 0xdc, 0x39, 0xa7, 0xa4, 0x80, 0x0b, 0xcc, 0xd0, 0xf3, 0xdc, 0x39, + 0xfa, 0x11, 0x20, 0x67, 0xec, 0x51, 0x9f, 0x98, 0x53, 0xe2, 0x4f, 0x1c, 0x7e, 0xda, 0x40, 0x95, + 0x39, 0x6a, 0x47, 0x78, 0x8e, 0xd6, 0x0e, 0x74, 0x1f, 0xb6, 0x22, 0xb8, 0x4d, 0x5c, 0x12, 0x12, + 0x35, 0xcb, 0x91, 0x65, 0x61, 0x6c, 0x73, 0x1b, 0x7a, 0x0a, 0x37, 0x6d, 0x27, 0xb0, 0x4e, 0x5c, + 0x62, 0x86, 0x64, 0x32, 0x35, 0x1d, 0xcf, 0x26, 0xaf, 0x49, 0xa0, 0xe6, 0x38, 0x16, 0x45, 0xbe, + 0x01, 0x99, 0x4c, 0x3b, 0xc2, 0x83, 0x76, 0x21, 0x37, 0xb5, 0x66, 0x01, 0xb1, 0xd5, 0x3c, 0xc7, + 0x44, 0x33, 0xc6, 0x92, 0xa8, 0x80, 0x40, 0x55, 0xae, 0xb2, 0xd4, 0xe6, 0x8e, 0x98, 0xa5, 0x08, + 0x56, 0xfb, 0x57, 0x1a, 0x72, 0xc2, 0x83, 0x3e, 0x5c, 0xb1, 0x54, 0x6e, 0xee, 0x32, 0xd4, 0xdf, + 0x2f, 0xaa, 0x05, 0xe1, 0xeb, 0xb4, 0x13, 0xac, 0x21, 0x90, 0x13, 0x15, 0xc5, 0xc7, 0xe8, 0x0e, + 0x14, 0x2d, 0xdb, 0x66, 0xb7, 0x47, 0x02, 0x35, 0xa3, 0x67, 0xea, 0x45, 0xbc, 0x36, 0xa0, 0x9f, + 0x6d, 0x56, 0x83, 0x7c, 0xb5, 0x7e, 0xde, 0x57, 0x06, 0xec, 0x2a, 0x86, 0xc4, 0x8f, 0x2a, 0x38, + 0xcb, 0xf7, 0x2b, 0x30, 0x03, 0xaf, 0xdf, 0x7b, 0x50, 0x9e, 0x58, 0xaf, 0xcd, 0x80, 0xfc, 0x61, + 0x46, 0xbc, 0x21, 0xe1, 0x74, 0x65, 0x70, 0x69, 0x62, 0xbd, 0xee, 0x47, 0x26, 0x54, 0x01, 0x70, + 0xbc, 0xd0, 0xa7, 0xf6, 0x6c, 0x48, 0xfc, 0x88, 0xab, 0x84, 0x05, 0xfd, 0x04, 0x0a, 0x9c, 0x6c, + 0xd3, 0xb1, 0xd5, 0x82, 0x2e, 0xd5, 0xe5, 0xa6, 0x16, 0x25, 0x9e, 0xe7, 0x54, 0xf3, 0xbc, 0xe3, + 0x21, 0xce, 0x73, 0x6c, 0xc7, 0x46, 0xbf, 0x04, 0x2d, 0x78, 0xe5, 0xb0, 0x8b, 0x12, 0x91, 0x42, + 0x87, 0x7a, 0xa6, 0x4f, 0x26, 0xf4, 0xcc, 0x72, 0x03, 0xb5, 0xc8, 0xb7, 0x51, 0x19, 0xa2, 0x93, + 0x00, 0xe0, 0xc8, 0x5f, 0xeb, 0x41, 0x96, 0x47, 0x64, 0xb7, 0x28, 0x8a, 0x35, 0xea, 0xde, 0x68, + 0x86, 0x1e, 0x43, 0x76, 0xe4, 0xb8, 0x24, 0x50, 0xd3, 0xfc, 0x0e, 0x51, 0xa2, 0xd2, 0x1d, 0x97, + 0x74, 0xbc, 0x11, 0x8d, 0x6e, 0x51, 0xc0, 0x6a, 0xc7, 0x50, 0xe2, 0x01, 0x8f, 0xa7, 0xb6, 0x15, + 0x92, 0xff, 0x59, 0xd8, 0xaf, 0xb3, 0x50, 0x88, 0x3d, 0xab, 0x4b, 0x97, 0x12, 0x97, 0x8e, 0x40, + 0x0e, 0x9c, 0x2f, 0x09, 0xef, 0x91, 0x0c, 0xe6, 0x63, 0x74, 0x17, 0x60, 0x42, 0x6d, 0x67, 0xe4, + 0x10, 0xdb, 0x0c, 0xf8, 0x95, 0x65, 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a7, 0xec, 0x7f, 0xab, 0x59, 0x7f, 0xf3, 0x4d, 0x25, 0xf5, 0xf6, 0x9b, 0x4a, 0xea, 0xcd, + 0x65, 0x45, 0x7a, 0x7b, 0x59, 0x91, 0xfe, 0x71, 0x59, 0x49, 0x7d, 0x7b, 0x59, 0x91, 0xfe, 0xf8, + 0xae, 0x92, 0xfa, 0xea, 0x5d, 0x45, 0x7a, 0xfb, 0xae, 0x92, 0xfa, 0xdb, 0xbb, 0x4a, 0xea, 0x24, + 0xc7, 0x35, 0xef, 0xd3, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x99, 0x31, 0x0e, 0x75, 0x0f, + 0x00, 0x00, } func (m *Hello) Marshal() (dAtA []byte, err error) { @@ -1456,6 +1460,15 @@ func (m *FileInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.VersionHash) > 0 { + i -= len(m.VersionHash) + copy(dAtA[i:], m.VersionHash) + i = encodeVarintBep(dAtA, i, uint64(len(m.VersionHash))) + i-- + dAtA[i] = 0x3e + i-- + dAtA[i] = 0xca + } if m.LocalFlags != 0 { i = encodeVarintBep(dAtA, i, uint64(m.LocalFlags)) i-- @@ -2210,6 +2223,10 @@ func (m *FileInfo) ProtoSize() (n int) { if m.LocalFlags != 0 { n += 2 + sovBep(uint64(m.LocalFlags)) } + l = len(m.VersionHash) + if l > 0 { + n += 2 + l + sovBep(uint64(l)) + } return n } @@ -3913,6 +3930,40 @@ func (m *FileInfo) Unmarshal(dAtA []byte) error { break } } + case 1001: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VersionHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBep + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBep + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthBep + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VersionHash = append(m.VersionHash[:0], dAtA[iNdEx:postIndex]...) + if m.VersionHash == nil { + m.VersionHash = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipBep(dAtA[iNdEx:]) diff --git a/lib/protocol/bep.proto b/lib/protocol/bep.proto index 60344e339..f2c222d2c 100644 --- a/lib/protocol/bep.proto +++ b/lib/protocol/bep.proto @@ -119,6 +119,9 @@ message FileInfo { // received (we make sure to zero it), nonetheless we need it on our // struct and to be able to serialize it to/from the database. uint32 local_flags = 1000; + // The version_hash is an implementation detail and not part of the wire + // format. + bytes version_hash = 1001; bool deleted = 6; bool invalid = 7 [(gogoproto.customname) = "RawInvalid"]; diff --git a/lib/protocol/bep_extensions.go b/lib/protocol/bep_extensions.go index 62be831ea..d37cd1c5e 100644 --- a/lib/protocol/bep_extensions.go +++ b/lib/protocol/bep_extensions.go @@ -360,3 +360,16 @@ func BlocksHash(bs []BlockInfo) []byte { } return h.Sum(nil) } + +func VectorHash(v Vector) []byte { + h := sha256.New() + for _, c := range v.Counters { + if err := binary.Write(h, binary.BigEndian, c.ID); err != nil { + panic("impossible: failed to write c.ID to hash function: " + err.Error()) + } + if err := binary.Write(h, binary.BigEndian, c.Value); err != nil { + panic("impossible: failed to write c.Value to hash function: " + err.Error()) + } + } + return h.Sum(nil) +} diff --git a/lib/sha256/sha256.go b/lib/sha256/sha256.go index 63dba134c..30f7dc9c8 100644 --- a/lib/sha256/sha256.go +++ b/lib/sha256/sha256.go @@ -26,6 +26,7 @@ const ( benchmarkingDuration = 150 * time.Millisecond defaultImpl = "crypto/sha256" minioImpl = "minio/sha256-simd" + Size = cryptoSha256.Size ) // May be switched out for another implementation