From 09387888de488163a522fc85bf00eff3a869a8ba Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Mon, 20 Feb 2023 21:43:14 +0100 Subject: [PATCH] Add some deletion logic --- commonspace/settings/deletionmanager.go | 55 +++ commonspace/settings/settings.go | 79 ++-- commonspace/settings/state.go | 9 + commonspace/settings/statebuilder.go | 85 ++++ commonspace/space.go | 1 + .../spacesyncproto/protos/spacesync.proto | 9 +- commonspace/spacesyncproto/spacesync.pb.go | 405 +++++++++++++++--- 7 files changed, 545 insertions(+), 98 deletions(-) create mode 100644 commonspace/settings/deletionmanager.go create mode 100644 commonspace/settings/state.go create mode 100644 commonspace/settings/statebuilder.go diff --git a/commonspace/settings/deletionmanager.go b/commonspace/settings/deletionmanager.go new file mode 100644 index 00000000..d96d8321 --- /dev/null +++ b/commonspace/settings/deletionmanager.go @@ -0,0 +1,55 @@ +package settings + +import ( + "github.com/anytypeio/any-sync/commonspace/object/treegetter" + "github.com/anytypeio/any-sync/commonspace/settings/deletionstate" + "time" +) + +type SpaceIdsProvider interface { + AllIds() []string +} + +type SpaceDeleter interface { + DeleteSpace(spaceId string) +} + +type DeletionManager interface { + UpdateState(state *State) (err error) +} + +func newDeletionManager( + spaceId string, + deletionState deletionstate.DeletionState, + provider SpaceIdsProvider, + deletionInterval time.Duration) DeletionManager { + return &deletionManager{ + spaceId: spaceId, + deletionState: deletionState, + provider: provider, + deletionInterval: deletionInterval, + } +} + +type deletionManager struct { + deletionState deletionstate.DeletionState + provider SpaceIdsProvider + treeGetter treegetter.TreeGetter + deletionInterval time.Duration + spaceId string +} + +func (d *deletionManager) UpdateState(state *State) (err error) { + err = d.deletionState.Add(state.DeletedIds) + if err != nil { + log.Warn("failed to add deleted ids to deletion state") + } + if !state.SpaceDeletionDate.IsZero() && state.SpaceDeletionDate.Add(d.deletionInterval).Before(time.Now()) { + err = d.deletionState.Add(d.provider.AllIds()) + spaceDeleter, ok := d.treeGetter.(SpaceDeleter) + if ok { + spaceDeleter.DeleteSpace(d.spaceId) + } + } + return +} diff --git a/commonspace/settings/settings.go b/commonspace/settings/settings.go index 180bb57d..b32cfd7e 100644 --- a/commonspace/settings/settings.go +++ b/commonspace/settings/settings.go @@ -13,10 +13,13 @@ import ( "github.com/anytypeio/any-sync/commonspace/settings/deletionstate" spacestorage "github.com/anytypeio/any-sync/commonspace/spacestorage" "go.uber.org/zap" + "time" ) var log = logger.NewNamed("common.commonspace.settings") +const spaceDeletionInterval = time.Hour * 24 * 7 + type SettingsObject interface { synctree.SyncTree Init(ctx context.Context) (err error) @@ -37,9 +40,11 @@ type Deps struct { TreeGetter treegetter.TreeGetter Store spacestorage.SpaceStorage DeletionState deletionstate.DeletionState + Provider SpaceIdsProvider // testing dependencies - prov DeletedIdsProvider - del Deleter + builder StateBuilder + del Deleter + delManager DeletionManager } type settingsObject struct { @@ -48,21 +53,35 @@ type settingsObject struct { spaceId string treeGetter treegetter.TreeGetter store spacestorage.SpaceStorage - prov DeletedIdsProvider + builder StateBuilder buildFunc BuildTreeFunc loop *deleteLoop - deletionState deletionstate.DeletionState - lastChangeId string + deletionState deletionstate.DeletionState + deletionManager DeletionManager } func NewSettingsObject(deps Deps, spaceId string) (obj SettingsObject) { - var deleter Deleter + var ( + deleter Deleter + deletionManager DeletionManager + builder StateBuilder + ) if deps.del == nil { deleter = newDeleter(deps.Store, deps.DeletionState, deps.TreeGetter) } else { deleter = deps.del } + if deps.delManager == nil { + deletionManager = newDeletionManager(spaceId, deps.DeletionState, deps.Provider, spaceDeletionInterval) + } else { + deletionManager = deps.delManager + } + if deps.builder == nil { + builder = newStateBuilder() + } else { + builder = deps.builder + } loop := newDeleteLoop(func() { deleter.Delete() @@ -72,48 +91,40 @@ func NewSettingsObject(deps Deps, spaceId string) (obj SettingsObject) { }) s := &settingsObject{ - loop: loop, - spaceId: spaceId, - account: deps.Account, - deletionState: deps.DeletionState, - treeGetter: deps.TreeGetter, - store: deps.Store, - buildFunc: deps.BuildFunc, + loop: loop, + spaceId: spaceId, + account: deps.Account, + deletionState: deps.DeletionState, + treeGetter: deps.TreeGetter, + store: deps.Store, + buildFunc: deps.BuildFunc, + builder: builder, + deletionManager: deletionManager, } - - // this is needed mainly for testing - if deps.prov == nil { - s.prov = &provider{} - } else { - s.prov = deps.prov - } - obj = s return } -func (s *settingsObject) updateIds(tr objecttree.ObjectTree, lastChangeId string) { - s.lastChangeId = lastChangeId - ids, lastId, err := s.prov.ProvideIds(tr, s.lastChangeId) +func (s *settingsObject) updateIds(tr objecttree.ObjectTree, isUpdate bool) { + state, err := s.builder.Build(tr, isUpdate) if err != nil { - log.With(zap.Strings("ids", ids), zap.Error(err)).Error("failed to update state") + log.Error("failed to build state", zap.Error(err)) return } - s.lastChangeId = lastId - if err = s.deletionState.Add(ids); err != nil { - log.With(zap.Strings("ids", ids), zap.Error(err)).Error("failed to queue ids to delete") + if err = s.deletionManager.UpdateState(state); err != nil { + log.Error("failed to update state", zap.Error(err)) } } // Update is called as part of UpdateListener interface func (s *settingsObject) Update(tr objecttree.ObjectTree) { - s.updateIds(tr, s.lastChangeId) + s.updateIds(tr, true) } // Rebuild is called as part of UpdateListener interface (including when the object is built for the first time, e.g. on Init call) func (s *settingsObject) Rebuild(tr objecttree.ObjectTree) { // at initial build "s" may not contain the object tree, so it is safer to provide it from the function parameter - s.updateIds(tr, "") + s.updateIds(tr, false) } func (s *settingsObject) Init(ctx context.Context) (err error) { @@ -133,6 +144,14 @@ func (s *settingsObject) Close() error { return s.SyncTree.Close() } +func (s *settingsObject) DeleteAccount() (err error) { + return nil +} + +func (s *settingsObject) RestoreAccount() (err error) { + return nil +} + func (s *settingsObject) DeleteObject(id string) (err error) { s.Lock() defer s.Unlock() diff --git a/commonspace/settings/state.go b/commonspace/settings/state.go new file mode 100644 index 00000000..0821fb7e --- /dev/null +++ b/commonspace/settings/state.go @@ -0,0 +1,9 @@ +package settings + +import "time" + +type State struct { + DeletedIds []string + SpaceDeletionDate time.Time + LastIteratedId string +} diff --git a/commonspace/settings/statebuilder.go b/commonspace/settings/statebuilder.go new file mode 100644 index 00000000..7f1e418a --- /dev/null +++ b/commonspace/settings/statebuilder.go @@ -0,0 +1,85 @@ +package settings + +import ( + "github.com/anytypeio/any-sync/commonspace/object/tree/objecttree" + "github.com/anytypeio/any-sync/commonspace/spacesyncproto" + "github.com/gogo/protobuf/proto" + "time" +) + +type StateBuilder interface { + Build(tree objecttree.ObjectTree, isUpdate bool) (*State, error) +} + +func newStateBuilder() StateBuilder { + return &stateBuilder{} +} + +type stateBuilder struct { + state *State +} + +func (s *stateBuilder) Build(tr objecttree.ObjectTree, isUpdate bool) (state *State, err error) { + state = s.state + defer func() { + if err == nil { + s.state = state + } + }() + + if !isUpdate || state == nil { + state = &State{} + } + var ( + rootId = tr.Root().Id + startId = state.LastIteratedId + ) + process := func(change *objecttree.Change) bool { + state.LastIteratedId = change.Id + state = s.processChange(change, rootId, startId, state) + return true + } + convert := func(decrypted []byte) (res any, err error) { + deleteChange := &spacesyncproto.SettingsData{} + err = proto.Unmarshal(decrypted, deleteChange) + if err != nil { + return nil, err + } + return deleteChange, nil + } + + if startId == "" { + startId = rootId + } + err = tr.IterateFrom(state.LastIteratedId, convert, process) + return +} + +func (s *stateBuilder) processChange(change *objecttree.Change, rootId, startId string, state *State) *State { + // ignoring root change which has empty model or startId change + if change.Model == nil || (change.Id == startId && startId != "") { + return state + } + + deleteChange := change.Model.(*spacesyncproto.SettingsData) + // getting data from snapshot if we start from it + if change.Id == rootId { + state = &State{ + DeletedIds: deleteChange.Snapshot.DeletedIds, + SpaceDeletionDate: time.Unix(0, deleteChange.Snapshot.SpaceDeletionTimestamp), + LastIteratedId: rootId, + } + return state + } + + // otherwise getting data from content + for _, cnt := range deleteChange.Content { + switch { + case cnt.GetObjectDelete() != nil: + state.DeletedIds = append(state.DeletedIds, cnt.GetObjectDelete().GetId()) + case cnt.GetSpaceDelete() != nil: + state.SpaceDeletionDate = time.Unix(0, cnt.GetSpaceDelete().GetTimestamp()) + } + } + return state +} diff --git a/commonspace/space.go b/commonspace/space.go index 22b2d29a..330f85a2 100644 --- a/commonspace/space.go +++ b/commonspace/space.go @@ -208,6 +208,7 @@ func (s *space) Init(ctx context.Context) (err error) { TreeGetter: s.cache, Store: s.storage, DeletionState: deletionState, + Provider: s.headSync, } s.settingsObject = settings.NewSettingsObject(deps, s.id) s.objectSync.Init() diff --git a/commonspace/spacesyncproto/protos/spacesync.proto b/commonspace/spacesyncproto/protos/spacesync.proto index 3c96820e..059eb7ba 100644 --- a/commonspace/spacesyncproto/protos/spacesync.proto +++ b/commonspace/spacesyncproto/protos/spacesync.proto @@ -60,8 +60,6 @@ message ObjectSyncMessage { string replyId = 3; bytes payload = 4; string objectId = 5; - // string identity = 5; - // string peerSignature = 6; } // SpacePushRequest is a request to add space on a node containing only one acl record @@ -116,6 +114,7 @@ message RawSpaceHeaderWithId { message SpaceSettingsContent { oneof value { ObjectDelete objectDelete = 1; + SpaceDelete spaceDelete = 2; } } @@ -124,9 +123,15 @@ message ObjectDelete { string id = 1; } +// SpaceDelete is a message containing timestamp when space was deleted +message SpaceDelete { + int64 timestamp = 1; +} + // SpaceSettingsSnapshot contains all the deleted ids in a snapshot message SpaceSettingsSnapshot { repeated string deletedIds = 1; + int64 spaceDeletionTimestamp = 2; } // SettingsData contains ObjectTree change payload diff --git a/commonspace/spacesyncproto/spacesync.pb.go b/commonspace/spacesyncproto/spacesync.pb.go index 7ed8a11e..3f9aabc7 100644 --- a/commonspace/spacesyncproto/spacesync.pb.go +++ b/commonspace/spacesyncproto/spacesync.pb.go @@ -869,6 +869,7 @@ type SpaceSettingsContent struct { // Types that are valid to be assigned to Value: // // *SpaceSettingsContent_ObjectDelete + // *SpaceSettingsContent_SpaceDelete Value isSpaceSettingsContent_Value `protobuf_oneof:"value"` } @@ -914,8 +915,12 @@ type isSpaceSettingsContent_Value interface { type SpaceSettingsContent_ObjectDelete struct { ObjectDelete *ObjectDelete `protobuf:"bytes,1,opt,name=objectDelete,proto3,oneof" json:"objectDelete,omitempty"` } +type SpaceSettingsContent_SpaceDelete struct { + SpaceDelete *SpaceDelete `protobuf:"bytes,2,opt,name=spaceDelete,proto3,oneof" json:"spaceDelete,omitempty"` +} func (*SpaceSettingsContent_ObjectDelete) isSpaceSettingsContent_Value() {} +func (*SpaceSettingsContent_SpaceDelete) isSpaceSettingsContent_Value() {} func (m *SpaceSettingsContent) GetValue() isSpaceSettingsContent_Value { if m != nil { @@ -931,10 +936,18 @@ func (m *SpaceSettingsContent) GetObjectDelete() *ObjectDelete { return nil } +func (m *SpaceSettingsContent) GetSpaceDelete() *SpaceDelete { + if x, ok := m.GetValue().(*SpaceSettingsContent_SpaceDelete); ok { + return x.SpaceDelete + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*SpaceSettingsContent) XXX_OneofWrappers() []interface{} { return []interface{}{ (*SpaceSettingsContent_ObjectDelete)(nil), + (*SpaceSettingsContent_SpaceDelete)(nil), } } @@ -983,16 +996,62 @@ func (m *ObjectDelete) GetId() string { return "" } +// SpaceDelete is a message containing timestamp when space was deleted +type SpaceDelete struct { + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (m *SpaceDelete) Reset() { *m = SpaceDelete{} } +func (m *SpaceDelete) String() string { return proto.CompactTextString(m) } +func (*SpaceDelete) ProtoMessage() {} +func (*SpaceDelete) Descriptor() ([]byte, []int) { + return fileDescriptor_80e49f1f4ac27799, []int{16} +} +func (m *SpaceDelete) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpaceDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpaceDelete.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SpaceDelete) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpaceDelete.Merge(m, src) +} +func (m *SpaceDelete) XXX_Size() int { + return m.Size() +} +func (m *SpaceDelete) XXX_DiscardUnknown() { + xxx_messageInfo_SpaceDelete.DiscardUnknown(m) +} + +var xxx_messageInfo_SpaceDelete proto.InternalMessageInfo + +func (m *SpaceDelete) GetTimestamp() int64 { + if m != nil { + return m.Timestamp + } + return 0 +} + // SpaceSettingsSnapshot contains all the deleted ids in a snapshot type SpaceSettingsSnapshot struct { - DeletedIds []string `protobuf:"bytes,1,rep,name=deletedIds,proto3" json:"deletedIds,omitempty"` + DeletedIds []string `protobuf:"bytes,1,rep,name=deletedIds,proto3" json:"deletedIds,omitempty"` + SpaceDeletionTimestamp int64 `protobuf:"varint,2,opt,name=spaceDeletionTimestamp,proto3" json:"spaceDeletionTimestamp,omitempty"` } func (m *SpaceSettingsSnapshot) Reset() { *m = SpaceSettingsSnapshot{} } func (m *SpaceSettingsSnapshot) String() string { return proto.CompactTextString(m) } func (*SpaceSettingsSnapshot) ProtoMessage() {} func (*SpaceSettingsSnapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_80e49f1f4ac27799, []int{16} + return fileDescriptor_80e49f1f4ac27799, []int{17} } func (m *SpaceSettingsSnapshot) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1028,6 +1087,13 @@ func (m *SpaceSettingsSnapshot) GetDeletedIds() []string { return nil } +func (m *SpaceSettingsSnapshot) GetSpaceDeletionTimestamp() int64 { + if m != nil { + return m.SpaceDeletionTimestamp + } + return 0 +} + // SettingsData contains ObjectTree change payload type SettingsData struct { Content []*SpaceSettingsContent `protobuf:"bytes,1,rep,name=content,proto3" json:"content,omitempty"` @@ -1038,7 +1104,7 @@ func (m *SettingsData) Reset() { *m = SettingsData{} } func (m *SettingsData) String() string { return proto.CompactTextString(m) } func (*SettingsData) ProtoMessage() {} func (*SettingsData) Descriptor() ([]byte, []int) { - return fileDescriptor_80e49f1f4ac27799, []int{17} + return fileDescriptor_80e49f1f4ac27799, []int{18} } func (m *SettingsData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1090,7 +1156,7 @@ func (m *SpaceSubscription) Reset() { *m = SpaceSubscription{} } func (m *SpaceSubscription) String() string { return proto.CompactTextString(m) } func (*SpaceSubscription) ProtoMessage() {} func (*SpaceSubscription) Descriptor() ([]byte, []int) { - return fileDescriptor_80e49f1f4ac27799, []int{18} + return fileDescriptor_80e49f1f4ac27799, []int{19} } func (m *SpaceSubscription) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1152,6 +1218,7 @@ func init() { proto.RegisterType((*RawSpaceHeaderWithId)(nil), "spacesync.RawSpaceHeaderWithId") proto.RegisterType((*SpaceSettingsContent)(nil), "spacesync.SpaceSettingsContent") proto.RegisterType((*ObjectDelete)(nil), "spacesync.ObjectDelete") + proto.RegisterType((*SpaceDelete)(nil), "spacesync.SpaceDelete") proto.RegisterType((*SpaceSettingsSnapshot)(nil), "spacesync.SpaceSettingsSnapshot") proto.RegisterType((*SettingsData)(nil), "spacesync.SettingsData") proto.RegisterType((*SpaceSubscription)(nil), "spacesync.SpaceSubscription") @@ -1162,68 +1229,70 @@ func init() { } var fileDescriptor_80e49f1f4ac27799 = []byte{ - // 971 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4b, 0x6f, 0xdb, 0xc6, - 0x13, 0x17, 0xe5, 0xa7, 0xc6, 0xb4, 0xcc, 0x6c, 0x9c, 0x7f, 0xf8, 0x57, 0x0c, 0x45, 0xd8, 0x43, - 0x61, 0xe4, 0x90, 0x87, 0x52, 0xb4, 0x48, 0x1f, 0x87, 0xc4, 0x56, 0x1a, 0xa1, 0x48, 0x6d, 0xac, - 0x1a, 0x14, 0x28, 0xd0, 0x02, 0x6b, 0x72, 0x2c, 0xb1, 0xa5, 0x96, 0x2c, 0x77, 0xd5, 0x58, 0xc7, - 0x9e, 0x7a, 0xed, 0xbd, 0xa7, 0x7e, 0x87, 0x7e, 0x88, 0x1e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 0x6a, 0x2c, 0x8e, 0xb8, 0x37, 0x43, 0x67, 0x4d, 0x5b, 0x8d, 0x92, 0x24, 0x4a, - 0x4e, 0xce, 0xcf, 0x25, 0x2a, 0xc7, 0x7f, 0xf0, 0x0c, 0xee, 0xde, 0xc0, 0x83, 0xec, 0x42, 0x27, - 0x93, 0x9e, 0xa1, 0xd3, 0xd2, 0xae, 0x6f, 0x84, 0x2c, 0x04, 0xd6, 0xf0, 0xcf, 0x36, 0x74, 0x52, - 0xdf, 0xa5, 0xf0, 0xc8, 0x11, 0x6c, 0xe7, 0xcf, 0x03, 0xe9, 0x35, 0xbe, 0x19, 0x66, 0x3b, 0xf6, - 0xee, 0x35, 0xbf, 0x27, 0xe9, 0x56, 0x7c, 0x99, 0x21, 0xea, 0x1d, 0x4b, 0xee, 0xad, 0x6c, 0xc4, - 0x72, 0x81, 0xf7, 0x0e, 0x9a, 0x95, 0x2b, 0x38, 0x61, 0xd8, 0x84, 0x53, 0x2c, 0xeb, 0x26, 0x9c, - 0xca, 0x96, 0x66, 0xe0, 0x94, 0xef, 0xda, 0x44, 0x25, 0xc8, 0xe7, 0xe4, 0x60, 0x65, 0x30, 0x2a, - 0x8f, 0x5e, 0xef, 0xbd, 0xda, 0x43, 0xeb, 0xb1, 0xf5, 0xe2, 0xc3, 0xbf, 0x2e, 0xfb, 0xd6, 0xbb, - 0xcb, 0xbe, 0xf5, 0xcf, 0x65, 0xdf, 0xfa, 0xed, 0xaa, 0xdf, 0x7a, 0x77, 0xd5, 0x6f, 0xfd, 0x7d, - 0xd5, 0x6f, 0x7d, 0xdb, 0xbb, 0xf9, 0xdf, 0xa5, 0xb3, 0x4d, 0xf3, 0xe7, 0xe9, 0xbf, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x23, 0x56, 0x6f, 0xd6, 0x53, 0x09, 0x00, 0x00, + // 1007 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcb, 0x6f, 0x1b, 0x45, + 0x18, 0xf7, 0x6e, 0x9e, 0xfe, 0xe2, 0x38, 0xdb, 0x69, 0xda, 0x1a, 0x37, 0x72, 0xad, 0x39, 0xa0, + 0xa8, 0x48, 0x7d, 0xa4, 0x08, 0xa9, 0x05, 0x0e, 0x6d, 0xe2, 0x52, 0x0b, 0x95, 0x44, 0xe3, 0x56, + 0x48, 0x48, 0x1c, 0x26, 0xbb, 0x13, 0x7b, 0x61, 0x3d, 0xb3, 0xec, 0x8c, 0x69, 0x7c, 0xe4, 0xc4, + 0x95, 0x33, 0x9c, 0xf8, 0x1f, 0xf8, 0x23, 0x38, 0xf6, 0xc8, 0x11, 0x25, 0xff, 0x08, 0x9a, 0xd9, + 0xd9, 0x97, 0xbd, 0xee, 0x81, 0x8b, 0xb3, 0xdf, 0xeb, 0xf7, 0x3d, 0xe7, 0xfb, 0x02, 0x8f, 0x7d, + 0x31, 0x9d, 0x0a, 0x2e, 0x63, 0xea, 0xb3, 0x87, 0xe6, 0x57, 0xce, 0xb9, 0x1f, 0x27, 0x42, 0x89, + 0x87, 0xe6, 0x57, 0x16, 0xdc, 0x07, 0x86, 0x81, 0x9a, 0x39, 0x03, 0x0f, 0x61, 0xf7, 0x15, 0xa3, + 0xc1, 0x68, 0xce, 0x7d, 0x42, 0xf9, 0x98, 0x21, 0x04, 0xeb, 0x17, 0x89, 0x98, 0x76, 0x9c, 0xbe, + 0x73, 0xb8, 0x4e, 0xcc, 0x37, 0x6a, 0x83, 0xab, 0x44, 0xc7, 0x35, 0x1c, 0x57, 0x09, 0xb4, 0x0f, + 0x1b, 0x51, 0x38, 0x0d, 0x55, 0x67, 0xad, 0xef, 0x1c, 0xee, 0x92, 0x94, 0xc0, 0x97, 0xd0, 0xce, + 0xa1, 0x98, 0x9c, 0x45, 0x4a, 0x63, 0x4d, 0xa8, 0x9c, 0x18, 0xac, 0x16, 0x31, 0xdf, 0xe8, 0x0b, + 0xd8, 0x66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, 0x7b, 0x50, 0x2f, 0x5c, 0xc2, 0x89, 0xa2, 0x3a, 0x9c, + 0xfc, 0x9c, 0xd4, 0xe1, 0x94, 0xee, 0x08, 0x01, 0xaf, 0xb8, 0xbc, 0x23, 0x95, 0x30, 0x3a, 0x45, + 0x07, 0x4b, 0x2f, 0xb7, 0x74, 0x96, 0xbb, 0x1f, 0x94, 0x1e, 0x3a, 0x8f, 0x9c, 0x17, 0x9f, 0xfe, + 0x7d, 0xd5, 0x73, 0xde, 0x5f, 0xf5, 0x9c, 0x7f, 0xaf, 0x7a, 0xce, 0x6f, 0xd7, 0xbd, 0xc6, 0xfb, + 0xeb, 0x5e, 0xe3, 0x9f, 0xeb, 0x5e, 0xe3, 0xbb, 0xee, 0xea, 0x7f, 0xe8, 0xce, 0x37, 0xcd, 0x9f, + 0x27, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x33, 0x0a, 0x59, 0xe5, 0xf5, 0x09, 0x00, 0x00, } func (m *HeadSyncRange) Marshal() (dAtA []byte, err error) { @@ -1856,6 +1925,27 @@ func (m *SpaceSettingsContent_ObjectDelete) MarshalToSizedBuffer(dAtA []byte) (i } return len(dAtA) - i, nil } +func (m *SpaceSettingsContent_SpaceDelete) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpaceSettingsContent_SpaceDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.SpaceDelete != nil { + { + size, err := m.SpaceDelete.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSpacesync(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} func (m *ObjectDelete) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1886,6 +1976,34 @@ func (m *ObjectDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *SpaceDelete) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SpaceDelete) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpaceDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Timestamp != 0 { + i = encodeVarintSpacesync(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *SpaceSettingsSnapshot) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1906,6 +2024,11 @@ func (m *SpaceSettingsSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SpaceDeletionTimestamp != 0 { + i = encodeVarintSpacesync(dAtA, i, uint64(m.SpaceDeletionTimestamp)) + i-- + dAtA[i] = 0x10 + } if len(m.DeletedIds) > 0 { for iNdEx := len(m.DeletedIds) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.DeletedIds[iNdEx]) @@ -2297,6 +2420,18 @@ func (m *SpaceSettingsContent_ObjectDelete) Size() (n int) { } return n } +func (m *SpaceSettingsContent_SpaceDelete) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SpaceDelete != nil { + l = m.SpaceDelete.Size() + n += 1 + l + sovSpacesync(uint64(l)) + } + return n +} func (m *ObjectDelete) Size() (n int) { if m == nil { return 0 @@ -2310,6 +2445,18 @@ func (m *ObjectDelete) Size() (n int) { return n } +func (m *SpaceDelete) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Timestamp != 0 { + n += 1 + sovSpacesync(uint64(m.Timestamp)) + } + return n +} + func (m *SpaceSettingsSnapshot) Size() (n int) { if m == nil { return 0 @@ -2322,6 +2469,9 @@ func (m *SpaceSettingsSnapshot) Size() (n int) { n += 1 + l + sovSpacesync(uint64(l)) } } + if m.SpaceDeletionTimestamp != 0 { + n += 1 + sovSpacesync(uint64(m.SpaceDeletionTimestamp)) + } return n } @@ -4146,6 +4296,41 @@ func (m *SpaceSettingsContent) Unmarshal(dAtA []byte) error { } m.Value = &SpaceSettingsContent_ObjectDelete{v} iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpaceDelete", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpacesync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSpacesync + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSpacesync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SpaceDelete{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &SpaceSettingsContent_SpaceDelete{v} + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSpacesync(dAtA[iNdEx:]) @@ -4249,6 +4434,75 @@ func (m *ObjectDelete) Unmarshal(dAtA []byte) error { } return nil } +func (m *SpaceDelete) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpacesync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SpaceDelete: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpaceDelete: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpacesync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSpacesync(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSpacesync + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *SpaceSettingsSnapshot) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4310,6 +4564,25 @@ func (m *SpaceSettingsSnapshot) Unmarshal(dAtA []byte) error { } m.DeletedIds = append(m.DeletedIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SpaceDeletionTimestamp", wireType) + } + m.SpaceDeletionTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpacesync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SpaceDeletionTimestamp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipSpacesync(dAtA[iNdEx:])