mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 14:07:02 +09:00
Update any-sync new deletion logic
This commit is contained in:
parent
8a38d54192
commit
73b27c7dac
9 changed files with 243 additions and 165 deletions
|
@ -76,6 +76,9 @@ type ObjectTree interface {
|
||||||
AddContent(ctx context.Context, content SignableChangeContent) (AddResult, error)
|
AddContent(ctx context.Context, content SignableChangeContent) (AddResult, error)
|
||||||
AddRawChanges(ctx context.Context, changes RawChangesPayload) (AddResult, error)
|
AddRawChanges(ctx context.Context, changes RawChangesPayload) (AddResult, error)
|
||||||
|
|
||||||
|
UnpackChange(raw *treechangeproto.RawTreeChangeWithId) (data []byte, err error)
|
||||||
|
PrepareChange(content SignableChangeContent) (res *treechangeproto.RawTreeChangeWithId, err error)
|
||||||
|
|
||||||
Delete() error
|
Delete() error
|
||||||
Close() error
|
Close() error
|
||||||
}
|
}
|
||||||
|
@ -191,6 +194,24 @@ func (ot *objectTree) AddContent(ctx context.Context, content SignableChangeCont
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ot *objectTree) UnpackChange(raw *treechangeproto.RawTreeChangeWithId) (data []byte, err error) {
|
||||||
|
unmarshalled, err := ot.changeBuilder.Unmarshall(raw, true)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
data = unmarshalled.Data
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ot *objectTree) PrepareChange(content SignableChangeContent) (res *treechangeproto.RawTreeChangeWithId, err error) {
|
||||||
|
payload, err := ot.prepareBuilderContent(content)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, res, err = ot.changeBuilder.Build(payload)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (ot *objectTree) prepareBuilderContent(content SignableChangeContent) (cnt BuilderContent, err error) {
|
func (ot *objectTree) prepareBuilderContent(content SignableChangeContent) (cnt BuilderContent, err error) {
|
||||||
ot.aclList.RLock()
|
ot.aclList.RLock()
|
||||||
defer ot.aclList.RUnlock()
|
defer ot.aclList.RUnlock()
|
||||||
|
|
|
@ -3,6 +3,7 @@ package settings
|
||||||
import (
|
import (
|
||||||
"github.com/anytypeio/any-sync/commonspace/object/treegetter"
|
"github.com/anytypeio/any-sync/commonspace/object/treegetter"
|
||||||
"github.com/anytypeio/any-sync/commonspace/settings/settingsstate"
|
"github.com/anytypeio/any-sync/commonspace/settings/settingsstate"
|
||||||
|
"github.com/anytypeio/any-sync/util/slice"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,12 +21,16 @@ type DeletionManager interface {
|
||||||
|
|
||||||
func newDeletionManager(
|
func newDeletionManager(
|
||||||
spaceId string,
|
spaceId string,
|
||||||
|
settingsId string,
|
||||||
|
isResponsible bool,
|
||||||
deletionInterval time.Duration,
|
deletionInterval time.Duration,
|
||||||
deletionState settingsstate.ObjectDeletionState,
|
deletionState settingsstate.ObjectDeletionState,
|
||||||
provider SpaceIdsProvider,
|
provider SpaceIdsProvider,
|
||||||
onSpaceDelete func()) DeletionManager {
|
onSpaceDelete func()) DeletionManager {
|
||||||
return &deletionManager{
|
return &deletionManager{
|
||||||
|
isResponsible: isResponsible,
|
||||||
spaceId: spaceId,
|
spaceId: spaceId,
|
||||||
|
settingsId: settingsId,
|
||||||
deletionState: deletionState,
|
deletionState: deletionState,
|
||||||
provider: provider,
|
provider: provider,
|
||||||
deletionInterval: deletionInterval,
|
deletionInterval: deletionInterval,
|
||||||
|
@ -39,6 +44,8 @@ type deletionManager struct {
|
||||||
treeGetter treegetter.TreeGetter
|
treeGetter treegetter.TreeGetter
|
||||||
deletionInterval time.Duration
|
deletionInterval time.Duration
|
||||||
spaceId string
|
spaceId string
|
||||||
|
settingsId string
|
||||||
|
isResponsible bool
|
||||||
onSpaceDelete func()
|
onSpaceDelete func()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,15 +54,18 @@ func (d *deletionManager) UpdateState(state *settingsstate.State) (err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("failed to add deleted ids to deletion state")
|
log.Warn("failed to add deleted ids to deletion state")
|
||||||
}
|
}
|
||||||
if !state.SpaceDeletionDate.IsZero() {
|
|
||||||
|
if state.DeleterId != "" {
|
||||||
spaceDeleter, ok := d.treeGetter.(SpaceDeleter)
|
spaceDeleter, ok := d.treeGetter.(SpaceDeleter)
|
||||||
if ok {
|
if ok {
|
||||||
spaceDeleter.DeleteSpace(d.spaceId)
|
spaceDeleter.DeleteSpace(d.spaceId)
|
||||||
}
|
}
|
||||||
if state.SpaceDeletionDate.Add(d.deletionInterval).Before(time.Now()) {
|
d.onSpaceDelete()
|
||||||
err = d.deletionState.Add(d.provider.AllIds()) // todo: except deletion tree
|
if d.isResponsible {
|
||||||
// todo: compaction in pogreb
|
allIds := slice.DiscardFromSlice(d.provider.AllIds(), func(s string) bool {
|
||||||
d.onSpaceDelete()
|
return s == d.settingsId
|
||||||
|
})
|
||||||
|
err = d.deletionState.Add(allIds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
@ -9,10 +9,15 @@ import (
|
||||||
"github.com/anytypeio/any-sync/commonspace/object/tree/objecttree"
|
"github.com/anytypeio/any-sync/commonspace/object/tree/objecttree"
|
||||||
"github.com/anytypeio/any-sync/commonspace/object/tree/synctree"
|
"github.com/anytypeio/any-sync/commonspace/object/tree/synctree"
|
||||||
"github.com/anytypeio/any-sync/commonspace/object/tree/synctree/updatelistener"
|
"github.com/anytypeio/any-sync/commonspace/object/tree/synctree/updatelistener"
|
||||||
|
"github.com/anytypeio/any-sync/commonspace/object/tree/treechangeproto"
|
||||||
"github.com/anytypeio/any-sync/commonspace/object/treegetter"
|
"github.com/anytypeio/any-sync/commonspace/object/treegetter"
|
||||||
"github.com/anytypeio/any-sync/commonspace/settings/settingsstate"
|
"github.com/anytypeio/any-sync/commonspace/settings/settingsstate"
|
||||||
spacestorage "github.com/anytypeio/any-sync/commonspace/spacestorage"
|
spacestorage "github.com/anytypeio/any-sync/commonspace/spacestorage"
|
||||||
|
"github.com/anytypeio/any-sync/commonspace/spacesyncproto"
|
||||||
|
"github.com/anytypeio/any-sync/nodeconf"
|
||||||
|
"github.com/gogo/protobuf/proto"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
"golang.org/x/exp/slices"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -24,16 +29,16 @@ type SettingsObject interface {
|
||||||
synctree.SyncTree
|
synctree.SyncTree
|
||||||
Init(ctx context.Context) (err error)
|
Init(ctx context.Context) (err error)
|
||||||
DeleteObject(id string) (err error)
|
DeleteObject(id string) (err error)
|
||||||
DeleteSpace(t time.Time) (err error)
|
DeleteSpace(ctx context.Context, deleterId string, raw *treechangeproto.RawTreeChangeWithId) (err error)
|
||||||
RestoreSpace() (err error)
|
SpaceDeleteRawChange(deleterId string) (raw *treechangeproto.RawTreeChangeWithId, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrDeleteSelf = errors.New("cannot delete self")
|
ErrDeleteSelf = errors.New("cannot delete self")
|
||||||
ErrAlreadyDeleted = errors.New("the object is already deleted")
|
ErrAlreadyDeleted = errors.New("the object is already deleted")
|
||||||
ErrObjDoesNotExist = errors.New("the object does not exist")
|
ErrObjDoesNotExist = errors.New("the object does not exist")
|
||||||
ErrMarkedDeleted = errors.New("this space is already marked deleted")
|
ErrCantDeleteSpace = errors.New("not able to delete space")
|
||||||
ErrMarkedNotDeleted = errors.New("this space is not marked not deleted")
|
ErrIncorrectDeleteChange = errors.New("incorrect delete change")
|
||||||
)
|
)
|
||||||
|
|
||||||
type BuildTreeFunc func(ctx context.Context, id string, listener updatelistener.UpdateListener) (t synctree.SyncTree, err error)
|
type BuildTreeFunc func(ctx context.Context, id string, listener updatelistener.UpdateListener) (t synctree.SyncTree, err error)
|
||||||
|
@ -43,6 +48,7 @@ type Deps struct {
|
||||||
Account accountservice.Service
|
Account accountservice.Service
|
||||||
TreeGetter treegetter.TreeGetter
|
TreeGetter treegetter.TreeGetter
|
||||||
Store spacestorage.SpaceStorage
|
Store spacestorage.SpaceStorage
|
||||||
|
Configuration nodeconf.Configuration
|
||||||
DeletionState settingsstate.ObjectDeletionState
|
DeletionState settingsstate.ObjectDeletionState
|
||||||
Provider SpaceIdsProvider
|
Provider SpaceIdsProvider
|
||||||
OnSpaceDelete func()
|
OnSpaceDelete func()
|
||||||
|
@ -82,7 +88,14 @@ func NewSettingsObject(deps Deps, spaceId string) (obj SettingsObject) {
|
||||||
deleter = deps.del
|
deleter = deps.del
|
||||||
}
|
}
|
||||||
if deps.delManager == nil {
|
if deps.delManager == nil {
|
||||||
deletionManager = newDeletionManager(spaceId, spaceDeletionInterval, deps.DeletionState, deps.Provider, deps.OnSpaceDelete)
|
deletionManager = newDeletionManager(
|
||||||
|
spaceId,
|
||||||
|
deps.Store.SpaceSettingsId(),
|
||||||
|
deps.Configuration.IsResponsible(spaceId),
|
||||||
|
spaceDeletionInterval,
|
||||||
|
deps.DeletionState,
|
||||||
|
deps.Provider,
|
||||||
|
deps.OnSpaceDelete)
|
||||||
} else {
|
} else {
|
||||||
deletionManager = deps.delManager
|
deletionManager = deps.delManager
|
||||||
}
|
}
|
||||||
|
@ -160,36 +173,39 @@ func (s *settingsObject) Close() error {
|
||||||
return s.SyncTree.Close()
|
return s.SyncTree.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *settingsObject) DeleteSpace(t time.Time) (err error) {
|
func (s *settingsObject) DeleteSpace(ctx context.Context, deleterId string, raw *treechangeproto.RawTreeChangeWithId) (err error) {
|
||||||
s.Lock()
|
s.Lock()
|
||||||
defer s.Unlock()
|
defer s.Unlock()
|
||||||
if !s.state.SpaceDeletionDate.IsZero() {
|
err = s.verifyDeleteSpace(deleterId, raw)
|
||||||
return ErrMarkedDeleted
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: add snapshot logic
|
|
||||||
res, err := s.changeFactory.CreateSpaceDeleteChange(t, s.state, false)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
res, err := s.AddRawChanges(ctx, objecttree.RawChangesPayload{
|
||||||
return s.addContent(res)
|
NewHeads: []string{raw.Id},
|
||||||
|
RawChanges: []*treechangeproto.RawTreeChangeWithId{raw},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !slices.Contains(res.Heads, raw.Id) {
|
||||||
|
return ErrCantDeleteSpace
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *settingsObject) RestoreSpace() (err error) {
|
func (s *settingsObject) SpaceDeleteRawChange(deleterId string) (raw *treechangeproto.RawTreeChangeWithId, err error) {
|
||||||
s.Lock()
|
data, err := s.changeFactory.CreateSpaceDeleteChange(deleterId, s.state, false)
|
||||||
defer s.Unlock()
|
|
||||||
if s.state.SpaceDeletionDate.IsZero() {
|
|
||||||
return ErrMarkedNotDeleted
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: add snapshot logic
|
|
||||||
res, err := s.changeFactory.CreateSpaceRestoreChange(s.state, false)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
accountData := s.account.Account()
|
||||||
return s.addContent(res)
|
return s.PrepareChange(objecttree.SignableChangeContent{
|
||||||
|
Data: data,
|
||||||
|
Key: accountData.SignKey,
|
||||||
|
Identity: accountData.Identity,
|
||||||
|
IsSnapshot: false,
|
||||||
|
IsEncrypted: false,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *settingsObject) DeleteObject(id string) (err error) {
|
func (s *settingsObject) DeleteObject(id string) (err error) {
|
||||||
|
@ -218,6 +234,24 @@ func (s *settingsObject) DeleteObject(id string) (err error) {
|
||||||
return s.addContent(res)
|
return s.addContent(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *settingsObject) verifyDeleteSpace(peerId string, raw *treechangeproto.RawTreeChangeWithId) (err error) {
|
||||||
|
data, err := s.UnpackChange(raw)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
content := &spacesyncproto.SettingsData{}
|
||||||
|
err = proto.Unmarshal(data, content)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(content.GetContent()) != 1 ||
|
||||||
|
content.GetContent()[0].GetSpaceDelete() == nil ||
|
||||||
|
content.GetContent()[0].GetSpaceDelete().GetDeleterPeerId() != peerId {
|
||||||
|
return ErrIncorrectDeleteChange
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (s *settingsObject) addContent(data []byte) (err error) {
|
func (s *settingsObject) addContent(data []byte) (err error) {
|
||||||
accountData := s.account.Account()
|
accountData := s.account.Account()
|
||||||
_, err = s.AddContent(context.Background(), objecttree.SignableChangeContent{
|
_, err = s.AddContent(context.Background(), objecttree.SignableChangeContent{
|
||||||
|
|
|
@ -2,13 +2,11 @@ package settingsstate
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/anytypeio/any-sync/commonspace/spacesyncproto"
|
"github.com/anytypeio/any-sync/commonspace/spacesyncproto"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ChangeFactory interface {
|
type ChangeFactory interface {
|
||||||
CreateObjectDeleteChange(id string, state *State, isSnapshot bool) (res []byte, err error)
|
CreateObjectDeleteChange(id string, state *State, isSnapshot bool) (res []byte, err error)
|
||||||
CreateSpaceDeleteChange(t time.Time, state *State, isSnapshot bool) (res []byte, err error)
|
CreateSpaceDeleteChange(peerId string, state *State, isSnapshot bool) (res []byte, err error)
|
||||||
CreateSpaceRestoreChange(state *State, isSnapshot bool) (res []byte, err error)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewChangeFactory() ChangeFactory {
|
func NewChangeFactory() ChangeFactory {
|
||||||
|
@ -33,24 +31,9 @@ func (c *changeFactory) CreateObjectDeleteChange(id string, state *State, isSnap
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *changeFactory) CreateSpaceDeleteChange(t time.Time, state *State, isSnapshot bool) (res []byte, err error) {
|
func (c *changeFactory) CreateSpaceDeleteChange(peerId string, state *State, isSnapshot bool) (res []byte, err error) {
|
||||||
content := &spacesyncproto.SpaceSettingsContent_SpaceDelete{
|
content := &spacesyncproto.SpaceSettingsContent_SpaceDelete{
|
||||||
SpaceDelete: &spacesyncproto.SpaceDelete{Timestamp: t.UnixNano()},
|
SpaceDelete: &spacesyncproto.SpaceDelete{DeleterPeerId: peerId},
|
||||||
}
|
|
||||||
change := &spacesyncproto.SettingsData{
|
|
||||||
Content: []*spacesyncproto.SpaceSettingsContent{
|
|
||||||
{Value: content},
|
|
||||||
},
|
|
||||||
Snapshot: nil,
|
|
||||||
}
|
|
||||||
// TODO: add snapshot logic
|
|
||||||
res, err = change.Marshal()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *changeFactory) CreateSpaceRestoreChange(state *State, isSnapshot bool) (res []byte, err error) {
|
|
||||||
content := &spacesyncproto.SpaceSettingsContent_SpaceDelete{
|
|
||||||
SpaceDelete: &spacesyncproto.SpaceDelete{},
|
|
||||||
}
|
}
|
||||||
change := &spacesyncproto.SettingsData{
|
change := &spacesyncproto.SettingsData{
|
||||||
Content: []*spacesyncproto.SpaceSettingsContent{
|
Content: []*spacesyncproto.SpaceSettingsContent{
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
package settingsstate
|
package settingsstate
|
||||||
|
|
||||||
import "time"
|
|
||||||
|
|
||||||
type State struct {
|
type State struct {
|
||||||
DeletedIds []string
|
DeletedIds []string
|
||||||
SpaceDeletionDate time.Time
|
DeleterId string
|
||||||
LastIteratedId string
|
LastIteratedId string
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import (
|
||||||
"github.com/anytypeio/any-sync/commonspace/object/tree/objecttree"
|
"github.com/anytypeio/any-sync/commonspace/object/tree/objecttree"
|
||||||
"github.com/anytypeio/any-sync/commonspace/spacesyncproto"
|
"github.com/anytypeio/any-sync/commonspace/spacesyncproto"
|
||||||
"github.com/gogo/protobuf/proto"
|
"github.com/gogo/protobuf/proto"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type StateBuilder interface {
|
type StateBuilder interface {
|
||||||
|
@ -59,9 +58,9 @@ func (s *stateBuilder) processChange(change *objecttree.Change, rootId, startId
|
||||||
// getting data from snapshot if we start from it
|
// getting data from snapshot if we start from it
|
||||||
if change.Id == rootId {
|
if change.Id == rootId {
|
||||||
state = &State{
|
state = &State{
|
||||||
DeletedIds: deleteChange.Snapshot.DeletedIds,
|
DeletedIds: deleteChange.Snapshot.DeletedIds,
|
||||||
SpaceDeletionDate: time.Unix(0, deleteChange.Snapshot.SpaceDeletionTimestamp),
|
DeleterId: deleteChange.Snapshot.DeleterPeerId,
|
||||||
LastIteratedId: rootId,
|
LastIteratedId: rootId,
|
||||||
}
|
}
|
||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
|
@ -72,7 +71,7 @@ func (s *stateBuilder) processChange(change *objecttree.Change, rootId, startId
|
||||||
case cnt.GetObjectDelete() != nil:
|
case cnt.GetObjectDelete() != nil:
|
||||||
state.DeletedIds = append(state.DeletedIds, cnt.GetObjectDelete().GetId())
|
state.DeletedIds = append(state.DeletedIds, cnt.GetObjectDelete().GetId())
|
||||||
case cnt.GetSpaceDelete() != nil:
|
case cnt.GetSpaceDelete() != nil:
|
||||||
state.SpaceDeletionDate = time.Unix(0, cnt.GetSpaceDelete().GetTimestamp())
|
state.DeleterId = cnt.GetSpaceDelete().GetDeleterPeerId()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return state
|
return state
|
||||||
|
|
|
@ -99,8 +99,8 @@ type Space interface {
|
||||||
DeleteTree(ctx context.Context, id string) (err error)
|
DeleteTree(ctx context.Context, id string) (err error)
|
||||||
BuildHistoryTree(ctx context.Context, id string, opts HistoryTreeOpts) (t objecttree.HistoryTree, err error)
|
BuildHistoryTree(ctx context.Context, id string, opts HistoryTreeOpts) (t objecttree.HistoryTree, err error)
|
||||||
|
|
||||||
DeleteSpace(ctx context.Context, t time.Time) (err error)
|
SpaceDeleteRawChange(ctx context.Context, deleterPeer string) (raw *treechangeproto.RawTreeChangeWithId, err error)
|
||||||
RestoreSpace(ctx context.Context) (err error)
|
DeleteSpace(ctx context.Context, deleterPeer string, deleteChange *treechangeproto.RawTreeChangeWithId) (err error)
|
||||||
|
|
||||||
HeadSync() headsync.HeadSync
|
HeadSync() headsync.HeadSync
|
||||||
ObjectSync() objectsync.ObjectSync
|
ObjectSync() objectsync.ObjectSync
|
||||||
|
@ -213,6 +213,7 @@ func (s *space) Init(ctx context.Context) (err error) {
|
||||||
Store: s.storage,
|
Store: s.storage,
|
||||||
DeletionState: deletionState,
|
DeletionState: deletionState,
|
||||||
Provider: s.headSync,
|
Provider: s.headSync,
|
||||||
|
Configuration: s.configuration,
|
||||||
OnSpaceDelete: s.onSpaceDelete,
|
OnSpaceDelete: s.onSpaceDelete,
|
||||||
}
|
}
|
||||||
s.settingsObject = settings.NewSettingsObject(deps, s.id)
|
s.settingsObject = settings.NewSettingsObject(deps, s.id)
|
||||||
|
@ -368,12 +369,12 @@ func (s *space) DeleteTree(ctx context.Context, id string) (err error) {
|
||||||
return s.settingsObject.DeleteObject(id)
|
return s.settingsObject.DeleteObject(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *space) DeleteSpace(ctx context.Context, t time.Time) (err error) {
|
func (s *space) SpaceDeleteRawChange(ctx context.Context, deleterPeer string) (raw *treechangeproto.RawTreeChangeWithId, err error) {
|
||||||
return s.settingsObject.DeleteSpace(t)
|
return s.settingsObject.SpaceDeleteRawChange(deleterPeer)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *space) RestoreSpace(ctx context.Context) (err error) {
|
func (s *space) DeleteSpace(ctx context.Context, deleterPeer string, deleteChange *treechangeproto.RawTreeChangeWithId) (err error) {
|
||||||
return s.settingsObject.RestoreSpace()
|
return s.settingsObject.DeleteSpace(ctx, deleterPeer, deleteChange)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *space) HandleMessage(ctx context.Context, hm HandleMessage) (err error) {
|
func (s *space) HandleMessage(ctx context.Context, hm HandleMessage) (err error) {
|
||||||
|
|
|
@ -124,15 +124,15 @@ message ObjectDelete {
|
||||||
string id = 1;
|
string id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SpaceDelete is a message containing timestamp when space was deleted
|
// SpaceDelete is a message containing deleter peer id
|
||||||
message SpaceDelete {
|
message SpaceDelete {
|
||||||
int64 timestamp = 1;
|
string deleterPeerId = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SpaceSettingsSnapshot contains all the deleted ids in a snapshot
|
// SpaceSettingsSnapshot contains all the deleted ids in a snapshot
|
||||||
message SpaceSettingsSnapshot {
|
message SpaceSettingsSnapshot {
|
||||||
repeated string deletedIds = 1;
|
repeated string deletedIds = 1;
|
||||||
int64 spaceDeletionTimestamp = 2;
|
string deleterPeerId = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SettingsData contains ObjectTree change payload
|
// SettingsData contains ObjectTree change payload
|
||||||
|
|
|
@ -999,9 +999,9 @@ func (m *ObjectDelete) GetId() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// SpaceDelete is a message containing timestamp when space was deleted
|
// SpaceDelete is a message containing deleter peer id
|
||||||
type SpaceDelete struct {
|
type SpaceDelete struct {
|
||||||
Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
|
DeleterPeerId string `protobuf:"bytes,1,opt,name=deleterPeerId,proto3" json:"deleterPeerId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SpaceDelete) Reset() { *m = SpaceDelete{} }
|
func (m *SpaceDelete) Reset() { *m = SpaceDelete{} }
|
||||||
|
@ -1037,17 +1037,17 @@ func (m *SpaceDelete) XXX_DiscardUnknown() {
|
||||||
|
|
||||||
var xxx_messageInfo_SpaceDelete proto.InternalMessageInfo
|
var xxx_messageInfo_SpaceDelete proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *SpaceDelete) GetTimestamp() int64 {
|
func (m *SpaceDelete) GetDeleterPeerId() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Timestamp
|
return m.DeleterPeerId
|
||||||
}
|
}
|
||||||
return 0
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// SpaceSettingsSnapshot contains all the deleted ids in a snapshot
|
// SpaceSettingsSnapshot contains all the deleted ids in a snapshot
|
||||||
type SpaceSettingsSnapshot struct {
|
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"`
|
DeleterPeerId string `protobuf:"bytes,2,opt,name=deleterPeerId,proto3" json:"deleterPeerId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SpaceSettingsSnapshot) Reset() { *m = SpaceSettingsSnapshot{} }
|
func (m *SpaceSettingsSnapshot) Reset() { *m = SpaceSettingsSnapshot{} }
|
||||||
|
@ -1090,11 +1090,11 @@ func (m *SpaceSettingsSnapshot) GetDeletedIds() []string {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SpaceSettingsSnapshot) GetSpaceDeletionTimestamp() int64 {
|
func (m *SpaceSettingsSnapshot) GetDeleterPeerId() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.SpaceDeletionTimestamp
|
return m.DeleterPeerId
|
||||||
}
|
}
|
||||||
return 0
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// SettingsData contains ObjectTree change payload
|
// SettingsData contains ObjectTree change payload
|
||||||
|
@ -1232,71 +1232,71 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptor_80e49f1f4ac27799 = []byte{
|
var fileDescriptor_80e49f1f4ac27799 = []byte{
|
||||||
// 1021 bytes of a gzipped FileDescriptorProto
|
// 1019 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6f, 0x1b, 0x45,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4b, 0x6f, 0xdb, 0x46,
|
||||||
0x14, 0xf7, 0x6e, 0xdc, 0x24, 0x7e, 0x71, 0x9c, 0xed, 0x34, 0x6d, 0x8d, 0x1b, 0xb9, 0xd6, 0x1c,
|
0x10, 0x16, 0xe9, 0xa7, 0xc6, 0xb2, 0xcc, 0x6c, 0x9c, 0x44, 0x55, 0x0c, 0x45, 0x58, 0x14, 0x85,
|
||||||
0x50, 0x54, 0xa4, 0x7e, 0xb8, 0x08, 0xa9, 0x05, 0x0e, 0x6d, 0xe2, 0x52, 0x0b, 0x95, 0x44, 0xe3,
|
0x91, 0x43, 0x1e, 0x72, 0x51, 0x20, 0x69, 0x7b, 0x48, 0x6c, 0xa5, 0x11, 0x8a, 0xd4, 0xc6, 0xaa,
|
||||||
0x56, 0x48, 0x48, 0x1c, 0x26, 0xbb, 0x13, 0x7b, 0x61, 0x3d, 0xb3, 0xec, 0x8c, 0x49, 0x7c, 0xe4,
|
0x41, 0x81, 0x02, 0x39, 0xac, 0xc9, 0xb1, 0xc4, 0x96, 0x22, 0x59, 0xee, 0xaa, 0xb6, 0x8e, 0x3d,
|
||||||
0xc4, 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, 0xf0, 0x11, 0x7e, 0x20, 0xd4, 0x03, 0xa8, 0x27, 0x69, 0x3e, 0x83, 0x2c, 0xe1, 0x02, 0x50,
|
||||||
0xa0, 0xfd, 0x12, 0x16, 0x47, 0xf3, 0x61, 0x60, 0x5a, 0xd9, 0x20, 0xd9, 0x51, 0x6b, 0x62, 0x3a,
|
0x76, 0x09, 0xc6, 0xc1, 0x6c, 0xe0, 0xe9, 0x52, 0xd6, 0x59, 0x76, 0x54, 0x92, 0x98, 0xcf, 0x82,
|
||||||
0x8f, 0x04, 0x0d, 0xda, 0x75, 0xc3, 0x5b, 0x76, 0x44, 0x1d, 0xd8, 0x16, 0x26, 0x81, 0x61, 0xd0,
|
0x88, 0x7b, 0xad, 0x75, 0xdd, 0xb7, 0xec, 0x48, 0xda, 0xb0, 0x1d, 0xe9, 0x00, 0x06, 0x5e, 0x6b,
|
||||||
0xbe, 0x61, 0x9c, 0xf2, 0x33, 0x1e, 0x80, 0x37, 0xd2, 0x81, 0x4f, 0x67, 0x72, 0x92, 0xb5, 0xf1,
|
0x43, 0x1b, 0xe5, 0x67, 0xda, 0x07, 0x67, 0xa8, 0x1c, 0x9f, 0x4d, 0xc5, 0x38, 0x2b, 0xe3, 0xd3,
|
||||||
0x49, 0x81, 0xa4, 0x73, 0xdb, 0xe9, 0xdf, 0x2d, 0x95, 0x99, 0x5a, 0xa7, 0xea, 0x3c, 0x04, 0xbe,
|
0x82, 0x49, 0xc5, 0xb6, 0xd3, 0xbb, 0x57, 0x4a, 0x33, 0xd5, 0x4e, 0xc5, 0xb9, 0x0b, 0x7a, 0x1b,
|
||||||
0x05, 0x37, 0x4b, 0x30, 0x69, 0xbb, 0x30, 0xce, 0xb1, 0xa3, 0x28, 0xc3, 0x5e, 0x62, 0x16, 0xbf,
|
0x6e, 0x95, 0x68, 0xd2, 0x72, 0x51, 0x9a, 0x73, 0x07, 0x41, 0xc6, 0xbd, 0xd0, 0x59, 0xfa, 0x2a,
|
||||||
0xca, 0x1d,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, 0x6e, 0x21, 0xe0, 0x15, 0xdb, 0x78, 0xa4, 0x12, 0x46, 0xa7, 0xe8, 0x60, 0xe5,
|
0x4f, 0x69, 0xa3, 0x30, 0x70, 0x8a, 0x1d, 0x3c, 0x94, 0x09, 0xf2, 0x09, 0x39, 0x58, 0x7a, 0xc3,
|
||||||
0x35, 0x97, 0x56, 0x75, 0xe7, 0x83, 0xda, 0x43, 0xe7, 0xb1, 0xf3, 0xf2, 0xd3, 0xbf, 0xaf, 0xba,
|
0xa5, 0x05, 0xdd, 0xfe, 0xa0, 0xf4, 0xd0, 0x7a, 0x62, 0xbd, 0xfc, 0xf4, 0xef, 0xeb, 0x8e, 0xf5,
|
||||||
0xce, 0xfb, 0xab, 0xae, 0xf3, 0xef, 0x55, 0xd7, 0xf9, 0xed, 0xba, 0x5b, 0x7b, 0x7f, 0xdd, 0xad,
|
0xfe, 0xba, 0x63, 0xfd, 0x7b, 0xdd, 0xb1, 0x7e, 0xbb, 0xe9, 0xd4, 0xde, 0xdf, 0x74, 0x6a, 0xff,
|
||||||
0xfd, 0x73, 0xdd, 0xad, 0x7d, 0xd7, 0x59, 0xff, 0x4f, 0xde, 0xd9, 0xa6, 0xf9, 0xf3, 0xf4, 0xbf,
|
0xdc, 0x74, 0x6a, 0xdf, 0xb7, 0x57, 0xff, 0x6b, 0x77, 0xbe, 0xa9, 0xff, 0x1c, 0xfd, 0x17, 0x00,
|
||||||
0x00, 0x00, 0x00, 0xff, 0xff, 0xd5, 0xd9, 0x0b, 0xc0, 0x09, 0x0a, 0x00, 0x00,
|
0x00, 0xff, 0xff, 0xa1, 0xe4, 0x04, 0x3d, 0xff, 0x09, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *HeadSyncRange) Marshal() (dAtA []byte, err error) {
|
func (m *HeadSyncRange) Marshal() (dAtA []byte, err error) {
|
||||||
|
@ -2000,10 +2000,12 @@ func (m *SpaceDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Timestamp != 0 {
|
if len(m.DeleterPeerId) > 0 {
|
||||||
i = encodeVarintSpacesync(dAtA, i, uint64(m.Timestamp))
|
i -= len(m.DeleterPeerId)
|
||||||
|
copy(dAtA[i:], m.DeleterPeerId)
|
||||||
|
i = encodeVarintSpacesync(dAtA, i, uint64(len(m.DeleterPeerId)))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x8
|
dAtA[i] = 0xa
|
||||||
}
|
}
|
||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
@ -2028,10 +2030,12 @@ func (m *SpaceSettingsSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.SpaceDeletionTimestamp != 0 {
|
if len(m.DeleterPeerId) > 0 {
|
||||||
i = encodeVarintSpacesync(dAtA, i, uint64(m.SpaceDeletionTimestamp))
|
i -= len(m.DeleterPeerId)
|
||||||
|
copy(dAtA[i:], m.DeleterPeerId)
|
||||||
|
i = encodeVarintSpacesync(dAtA, i, uint64(len(m.DeleterPeerId)))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x10
|
dAtA[i] = 0x12
|
||||||
}
|
}
|
||||||
if len(m.DeletedIds) > 0 {
|
if len(m.DeletedIds) > 0 {
|
||||||
for iNdEx := len(m.DeletedIds) - 1; iNdEx >= 0; iNdEx-- {
|
for iNdEx := len(m.DeletedIds) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
|
@ -2455,8 +2459,9 @@ func (m *SpaceDelete) Size() (n int) {
|
||||||
}
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Timestamp != 0 {
|
l = len(m.DeleterPeerId)
|
||||||
n += 1 + sovSpacesync(uint64(m.Timestamp))
|
if l > 0 {
|
||||||
|
n += 1 + l + sovSpacesync(uint64(l))
|
||||||
}
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
@ -2473,8 +2478,9 @@ func (m *SpaceSettingsSnapshot) Size() (n int) {
|
||||||
n += 1 + l + sovSpacesync(uint64(l))
|
n += 1 + l + sovSpacesync(uint64(l))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if m.SpaceDeletionTimestamp != 0 {
|
l = len(m.DeleterPeerId)
|
||||||
n += 1 + sovSpacesync(uint64(m.SpaceDeletionTimestamp))
|
if l > 0 {
|
||||||
|
n += 1 + l + sovSpacesync(uint64(l))
|
||||||
}
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
@ -4468,10 +4474,10 @@ func (m *SpaceDelete) Unmarshal(dAtA []byte) error {
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
if wireType != 0 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field DeleterPeerId", wireType)
|
||||||
}
|
}
|
||||||
m.Timestamp = 0
|
var stringLen uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
if shift >= 64 {
|
if shift >= 64 {
|
||||||
return ErrIntOverflowSpacesync
|
return ErrIntOverflowSpacesync
|
||||||
|
@ -4481,11 +4487,24 @@ func (m *SpaceDelete) Unmarshal(dAtA []byte) error {
|
||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
m.Timestamp |= int64(b&0x7F) << shift
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthSpacesync
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthSpacesync
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.DeleterPeerId = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipSpacesync(dAtA[iNdEx:])
|
skippy, err := skipSpacesync(dAtA[iNdEx:])
|
||||||
|
@ -4569,10 +4588,10 @@ func (m *SpaceSettingsSnapshot) Unmarshal(dAtA []byte) error {
|
||||||
m.DeletedIds = append(m.DeletedIds, string(dAtA[iNdEx:postIndex]))
|
m.DeletedIds = append(m.DeletedIds, string(dAtA[iNdEx:postIndex]))
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 2:
|
case 2:
|
||||||
if wireType != 0 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field SpaceDeletionTimestamp", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field DeleterPeerId", wireType)
|
||||||
}
|
}
|
||||||
m.SpaceDeletionTimestamp = 0
|
var stringLen uint64
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
if shift >= 64 {
|
if shift >= 64 {
|
||||||
return ErrIntOverflowSpacesync
|
return ErrIntOverflowSpacesync
|
||||||
|
@ -4582,11 +4601,24 @@ func (m *SpaceSettingsSnapshot) Unmarshal(dAtA []byte) error {
|
||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
m.SpaceDeletionTimestamp |= int64(b&0x7F) << shift
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthSpacesync
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthSpacesync
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.DeleterPeerId = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipSpacesync(dAtA[iNdEx:])
|
skippy, err := skipSpacesync(dAtA[iNdEx:])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue