Move treeheader to upper level in sync

This commit is contained in:
mcrakhman 2022-08-11 16:31:09 +02:00
parent 88b0e8cd7e
commit eed3c518cd
No known key found for this signature in database
GPG Key ID: DED12CFEF5B8396B
8 changed files with 308 additions and 492 deletions

View File

@ -283,7 +283,9 @@ func (a *aclTree) AddRawChanges(ctx context.Context, rawChanges ...*aclpb.RawCha
return
}
if a.updateListener != nil {
if a.updateListener == nil {
return
}
switch mode {
case Append:
a.updateListener.Update(a)
@ -292,7 +294,6 @@ func (a *aclTree) AddRawChanges(ctx context.Context, rawChanges ...*aclpb.RawCha
default:
break
}
}
}()
getAddedChanges := func() []*aclpb.RawChange {
@ -317,16 +318,7 @@ func (a *aclTree) AddRawChanges(ctx context.Context, rawChanges ...*aclpb.RawCha
}
prevHeads := a.tree.Heads()
mode = a.tree.Add(changes...)
switch mode {
case Nothing:
return AddResult{
OldHeads: prevHeads,
Heads: prevHeads,
Summary: AddResultSummaryNothing,
}, nil
case Rebuild:
rebuild := func() (AddResult, error) {
err = a.rebuildFromStorage()
if err != nil {
return AddResult{}, err
@ -338,6 +330,26 @@ func (a *aclTree) AddRawChanges(ctx context.Context, rawChanges ...*aclpb.RawCha
Added: getAddedChanges(),
Summary: AddResultSummaryRebuild,
}, nil
}
mode = a.tree.Add(changes...)
switch mode {
case Nothing:
for _, ch := range changes {
// rebuilding if the snapshot is different from the root
if ch.SnapshotId != a.tree.RootId() {
return rebuild()
}
}
return AddResult{
OldHeads: prevHeads,
Heads: prevHeads,
Summary: AddResultSummaryNothing,
}, nil
case Rebuild:
return rebuild()
default:
// just rebuilding the state from start without reloading everything from tree storage
// as an optimization we could've started from current heads, but I didn't implement that

View File

@ -165,7 +165,9 @@ func (d *docTree) AddContent(ctx context.Context, aclTree ACLTree, content proto
defer func() {
// TODO: should this be called in a separate goroutine to prevent accidental cycles (tree->updater->tree)
if d.updateListener != nil {
d.updateListener.Update(d)
}
}()
state := aclTree.ACLState()
change := &aclpb.Change{
@ -256,6 +258,10 @@ func (d *docTree) AddRawChanges(ctx context.Context, aclTree ACLTree, rawChanges
return
}
if d.updateListener == nil {
return
}
switch mode {
case Append:
d.updateListener.Update(d)

View File

@ -2,6 +2,7 @@ package message
import (
"context"
"fmt"
"github.com/anytypeio/go-anytype-infrastructure-experiments/app"
"github.com/anytypeio/go-anytype-infrastructure-experiments/app/logger"
"github.com/anytypeio/go-anytype-infrastructure-experiments/service/net/pool"
@ -85,7 +86,7 @@ func (s *service) SendMessageAsync(peerId string, msg *syncproto.Sync) (err erro
return
}
go s.sendAsync(peerId, msgType(msg), marshalled)
go s.sendAsync(peerId, msgInfo(msg), marshalled)
return
}
@ -108,15 +109,16 @@ func (s *service) sendAsync(peerId string, msgTypeStr string, marshalled []byte)
})
}
func msgType(content *syncproto.Sync) string {
func msgInfo(content *syncproto.Sync) (syncMethod string) {
msg := content.GetMessage()
switch {
case msg.GetFullSyncRequest() != nil:
return "FullSyncRequest"
syncMethod = "FullSyncRequest"
case msg.GetFullSyncResponse() != nil:
return "FullSyncResponse"
syncMethod = "FullSyncResponse"
case msg.GetHeadUpdate() != nil:
return "HeadUpdate"
syncMethod = "HeadUpdate"
}
return "UnknownMessage"
syncMethod = fmt.Sprintf("method: %s, treeType: %s", syncMethod, content.TreeHeader.Type.String())
return
}

View File

@ -64,26 +64,32 @@ func (r *requestHandler) HandleSyncMessage(ctx context.Context, senderId string,
msg := content.GetMessage()
switch {
case msg.GetFullSyncRequest() != nil:
return r.HandleFullSyncRequest(ctx, senderId, msg.GetFullSyncRequest())
return r.HandleFullSyncRequest(ctx, senderId, msg.GetFullSyncRequest(), content.GetTreeHeader(), content.GetTreeId())
case msg.GetFullSyncResponse() != nil:
return r.HandleFullSyncResponse(ctx, senderId, msg.GetFullSyncResponse())
return r.HandleFullSyncResponse(ctx, senderId, msg.GetFullSyncResponse(), content.GetTreeHeader(), content.GetTreeId())
case msg.GetHeadUpdate() != nil:
return r.HandleHeadUpdate(ctx, senderId, msg.GetHeadUpdate())
return r.HandleHeadUpdate(ctx, senderId, msg.GetHeadUpdate(), content.GetTreeHeader(), content.GetTreeId())
}
return nil
}
func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string, update *syncproto.SyncHeadUpdate) (err error) {
func (r *requestHandler) HandleHeadUpdate(
ctx context.Context,
senderId string,
update *syncproto.SyncHeadUpdate,
header *treepb.TreeHeader,
treeId string) (err error) {
var (
fullRequest *syncproto.SyncFullRequest
snapshotPath []string
result tree.AddResult
)
log.With(zap.String("peerId", senderId), zap.String("treeId", update.TreeId)).
log.With(zap.String("peerId", senderId), zap.String("treeId", treeId)).
Debug("processing head update")
updateACLTree := func() {
err = r.treeCache.Do(ctx, update.TreeId, func(obj interface{}) error {
err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error {
t := obj.(tree.ACLTree)
t.Lock()
defer t.Unlock()
@ -97,7 +103,7 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string,
shouldFullSync := !slice.UnsortedEquals(update.Heads, t.Heads())
snapshotPath = t.SnapshotPath()
if shouldFullSync {
fullRequest, err = r.prepareFullSyncRequest(update.TreeId, update.TreeHeader, update.SnapshotPath, t)
fullRequest, err = r.prepareFullSyncRequest(treeId, header, update.SnapshotPath, t)
if err != nil {
return err
}
@ -107,12 +113,12 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string,
}
updateDocTree := func() {
err = r.treeCache.Do(ctx, update.TreeId, func(obj interface{}) error {
err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error {
docTree := obj.(tree.DocTree)
docTree.Lock()
defer docTree.Unlock()
return r.treeCache.Do(ctx, update.TreeId, func(obj interface{}) error {
return r.treeCache.Do(ctx, treeId, func(obj interface{}) error {
aclTree := obj.(tree.ACLTree)
aclTree.RLock()
defer aclTree.RUnlock()
@ -126,7 +132,7 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string,
shouldFullSync := !slice.UnsortedEquals(update.Heads, docTree.Heads())
snapshotPath = docTree.SnapshotPath()
if shouldFullSync {
fullRequest, err = r.prepareFullSyncRequest(update.TreeId, update.TreeHeader, update.SnapshotPath, docTree)
fullRequest, err = r.prepareFullSyncRequest(treeId, header, update.SnapshotPath, docTree)
if err != nil {
return err
}
@ -136,7 +142,7 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string,
})
}
switch update.TreeHeader.Type {
switch header.Type {
case treepb.TreeHeader_ACLTree:
updateACLTree()
case treepb.TreeHeader_DocTree:
@ -148,14 +154,11 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string,
// if there are no such tree
if err == treestorage.ErrUnknownTreeId {
// TODO: maybe we can optimize this by sending the header and stuff right away, so when the tree is created we are able to add it on first request
fullRequest = &syncproto.SyncFullRequest{
TreeId: update.TreeId,
TreeHeader: update.TreeHeader,
}
fullRequest = &syncproto.SyncFullRequest{}
}
// if we have incompatible heads, or we haven't seen the tree at all
if fullRequest != nil {
return r.messageService.SendMessageAsync(senderId, syncproto.WrapFullRequest(fullRequest))
return r.messageService.SendMessageAsync(senderId, syncproto.WrapFullRequest(fullRequest, header, treeId))
}
// if error or nothing has changed
if err != nil || len(result.Added) == 0 {
@ -166,23 +169,27 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string,
Heads: result.Heads,
Changes: result.Added,
SnapshotPath: snapshotPath,
TreeId: update.TreeId,
TreeHeader: update.TreeHeader,
}
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate))
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate, header, treeId))
}
func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId string, request *syncproto.SyncFullRequest) (err error) {
func (r *requestHandler) HandleFullSyncRequest(
ctx context.Context,
senderId string,
request *syncproto.SyncFullRequest,
header *treepb.TreeHeader,
treeId string) (err error) {
var (
fullResponse *syncproto.SyncFullResponse
snapshotPath []string
result tree.AddResult
)
log.With(zap.String("peerId", senderId), zap.String("treeId", request.TreeId)).
log.With(zap.String("peerId", senderId), zap.String("treeId", treeId)).
Debug("processing full sync request")
requestACLTree := func() {
err = r.treeCache.Do(ctx, request.TreeId, func(obj interface{}) error {
err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error {
t := obj.(tree.ACLTree)
t.Lock()
defer t.Unlock()
@ -196,7 +203,7 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str
}
}
snapshotPath = t.SnapshotPath()
fullResponse, err = r.prepareFullSyncResponse(request.TreeId, request.SnapshotPath, request.Changes, t)
fullResponse, err = r.prepareFullSyncResponse(treeId, request.SnapshotPath, request.Changes, t)
if err != nil {
return err
}
@ -205,12 +212,12 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str
}
requestDocTree := func() {
err = r.treeCache.Do(ctx, request.TreeId, func(obj interface{}) error {
err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error {
docTree := obj.(tree.DocTree)
docTree.Lock()
defer docTree.Unlock()
return r.treeCache.Do(ctx, request.TreeId, func(obj interface{}) error {
return r.treeCache.Do(ctx, treeId, func(obj interface{}) error {
aclTree := obj.(tree.ACLTree)
aclTree.RLock()
defer aclTree.RUnlock()
@ -223,7 +230,7 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str
}
}
snapshotPath = docTree.SnapshotPath()
fullResponse, err = r.prepareFullSyncResponse(request.TreeId, request.SnapshotPath, request.Changes, docTree)
fullResponse, err = r.prepareFullSyncResponse(treeId, request.SnapshotPath, request.Changes, docTree)
if err != nil {
return err
}
@ -232,7 +239,7 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str
})
}
switch request.TreeHeader.Type {
switch header.Type {
case treepb.TreeHeader_ACLTree:
requestACLTree()
case treepb.TreeHeader_DocTree:
@ -244,7 +251,7 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str
if err != nil {
return err
}
err = r.messageService.SendMessageAsync(senderId, syncproto.WrapFullResponse(fullResponse))
err = r.messageService.SendMessageAsync(senderId, syncproto.WrapFullResponse(fullResponse, header, treeId))
// if error or nothing has changed
if err != nil || len(result.Added) == 0 {
return err
@ -255,22 +262,26 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str
Heads: result.Heads,
Changes: result.Added,
SnapshotPath: snapshotPath,
TreeId: request.TreeId,
TreeHeader: request.TreeHeader,
}
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate))
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate, header, treeId))
}
func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId string, response *syncproto.SyncFullResponse) (err error) {
func (r *requestHandler) HandleFullSyncResponse(
ctx context.Context,
senderId string,
response *syncproto.SyncFullResponse,
header *treepb.TreeHeader,
treeId string) (err error) {
var (
snapshotPath []string
result tree.AddResult
)
log.With(zap.String("peerId", senderId), zap.String("treeId", response.TreeId)).
log.With(zap.String("peerId", senderId), zap.String("treeId", treeId)).
Debug("processing full sync response")
responseACLTree := func() {
err = r.treeCache.Do(ctx, response.TreeId, func(obj interface{}) error {
err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error {
t := obj.(tree.ACLTree)
t.Lock()
defer t.Unlock()
@ -285,12 +296,12 @@ func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId st
}
responseDocTree := func() {
err = r.treeCache.Do(ctx, response.TreeId, func(obj interface{}) error {
err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error {
docTree := obj.(tree.DocTree)
docTree.Lock()
defer docTree.Unlock()
return r.treeCache.Do(ctx, response.TreeId, func(obj interface{}) error {
return r.treeCache.Do(ctx, treeId, func(obj interface{}) error {
aclTree := obj.(tree.ACLTree)
aclTree.RLock()
defer aclTree.RUnlock()
@ -305,7 +316,7 @@ func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId st
})
}
switch response.TreeHeader.Type {
switch header.Type {
case treepb.TreeHeader_ACLTree:
responseACLTree()
case treepb.TreeHeader_DocTree:
@ -320,7 +331,7 @@ func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId st
}
// if we have a new tree
if err == treestorage.ErrUnknownTreeId {
err = r.createTree(ctx, response)
err = r.createTree(ctx, response, header, treeId)
if err != nil {
return err
}
@ -335,9 +346,8 @@ func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId st
Heads: result.Heads,
Changes: result.Added,
SnapshotPath: snapshotPath,
TreeId: response.TreeId,
}
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate))
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate, header, treeId))
}
func (r *requestHandler) prepareFullSyncRequest(treeId string, header *treepb.TreeHeader, theirPath []string, t tree.CommonTree) (*syncproto.SyncFullRequest, error) {
@ -348,9 +358,7 @@ func (r *requestHandler) prepareFullSyncRequest(treeId string, header *treepb.Tr
return &syncproto.SyncFullRequest{
Heads: t.Heads(),
Changes: ourChanges,
TreeId: treeId,
SnapshotPath: t.SnapshotPath(),
TreeHeader: header,
}, nil
}
@ -382,17 +390,20 @@ func (r *requestHandler) prepareFullSyncResponse(
return &syncproto.SyncFullResponse{
Heads: t.Heads(),
Changes: final,
TreeId: treeId,
SnapshotPath: t.SnapshotPath(),
TreeHeader: t.Header(),
}, nil
}
func (r *requestHandler) createTree(ctx context.Context, response *syncproto.SyncFullResponse) error {
func (r *requestHandler) createTree(
ctx context.Context,
response *syncproto.SyncFullResponse,
header *treepb.TreeHeader,
treeId string) error {
return r.treeCache.Add(
ctx,
response.TreeId,
response.TreeHeader,
treeId,
header,
response.Changes,
func(obj interface{}) error {
return nil

View File

@ -6,7 +6,6 @@ import (
"github.com/anytypeio/go-anytype-infrastructure-experiments/app"
"github.com/anytypeio/go-anytype-infrastructure-experiments/app/logger"
"github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges/aclpb"
"github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/acltree"
"github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/tree"
"github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/treestorage/treepb"
"github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/ocache"
@ -19,7 +18,6 @@ const CName = "treecache"
// TODO: add context
type TreeFunc = func(tree interface{}) error
type ChangeBuildFunc = func(builder acltree.ChangeBuilder) error
var log = logger.NewNamed("treecache")

View File

@ -1,19 +1,33 @@
package syncproto
func WrapHeadUpdate(update *SyncHeadUpdate) *Sync {
return &Sync{Message: &SyncContentValue{
import "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/treestorage/treepb"
func WrapHeadUpdate(update *SyncHeadUpdate, header *treepb.TreeHeader, treeId string) *Sync {
return &Sync{
Message: &SyncContentValue{
Value: &SyncContentValueValueOfHeadUpdate{HeadUpdate: update},
}}
},
TreeHeader: header,
TreeId: treeId,
}
}
func WrapFullRequest(request *SyncFullRequest) *Sync {
return &Sync{Message: &SyncContentValue{
func WrapFullRequest(request *SyncFullRequest, header *treepb.TreeHeader, treeId string) *Sync {
return &Sync{
Message: &SyncContentValue{
Value: &SyncContentValueValueOfFullSyncRequest{FullSyncRequest: request},
}}
},
TreeHeader: header,
TreeId: treeId,
}
}
func WrapFullResponse(response *SyncFullResponse) *Sync {
return &Sync{Message: &SyncContentValue{
func WrapFullResponse(response *SyncFullResponse, header *treepb.TreeHeader, treeId string) *Sync {
return &Sync{
Message: &SyncContentValue{
Value: &SyncContentValueValueOfFullSyncResponse{FullSyncResponse: response},
}}
},
TreeHeader: header,
TreeId: treeId,
}
}

View File

@ -64,6 +64,8 @@ message Subscription {
message Sync {
string spaceId = 1;
ContentValue message = 2;
tree.TreeHeader treeHeader = 3;
string treeId = 4;
message ContentValue {
oneof value {
@ -76,9 +78,7 @@ message Sync {
message HeadUpdate {
repeated string heads = 1;
repeated acl.RawChange changes = 2;
string treeId = 3;
repeated string snapshotPath = 4;
tree.TreeHeader treeHeader = 5;
repeated string snapshotPath = 3;
}
message Full {
@ -86,17 +86,13 @@ message Sync {
message Request {
repeated string heads = 1;
repeated acl.RawChange changes = 2;
string treeId = 3;
repeated string snapshotPath = 4;
tree.TreeHeader treeHeader = 5;
repeated string snapshotPath = 3;
}
message Response {
repeated string heads = 1;
repeated acl.RawChange changes = 2;
string treeId = 3;
repeated string snapshotPath = 4;
tree.TreeHeader treeHeader = 5;
repeated string snapshotPath = 3;
}
}
}

View File

@ -592,6 +592,8 @@ func (m *SubscriptionUnsubscribeSpace) GetSpaceId() string {
type Sync struct {
SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"`
Message *SyncContentValue `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
TreeHeader *treepb.TreeHeader `protobuf:"bytes,3,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"`
TreeId string `protobuf:"bytes,4,opt,name=treeId,proto3" json:"treeId,omitempty"`
}
func (m *Sync) Reset() { *m = Sync{} }
@ -641,6 +643,20 @@ func (m *Sync) GetMessage() *SyncContentValue {
return nil
}
func (m *Sync) GetTreeHeader() *treepb.TreeHeader {
if m != nil {
return m.TreeHeader
}
return nil
}
func (m *Sync) GetTreeId() string {
if m != nil {
return m.TreeId
}
return ""
}
type SyncContentValue struct {
// Types that are valid to be assigned to Value:
// *SyncContentValueValueOfHeadUpdate
@ -742,9 +758,7 @@ func (*SyncContentValue) XXX_OneofWrappers() []interface{} {
type SyncHeadUpdate struct {
Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"`
Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"`
TreeId string `protobuf:"bytes,3,opt,name=treeId,proto3" json:"treeId,omitempty"`
SnapshotPath []string `protobuf:"bytes,4,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"`
TreeHeader *treepb.TreeHeader `protobuf:"bytes,5,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"`
SnapshotPath []string `protobuf:"bytes,3,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"`
}
func (m *SyncHeadUpdate) Reset() { *m = SyncHeadUpdate{} }
@ -794,13 +808,6 @@ func (m *SyncHeadUpdate) GetChanges() []*aclpb.RawChange {
return nil
}
func (m *SyncHeadUpdate) GetTreeId() string {
if m != nil {
return m.TreeId
}
return ""
}
func (m *SyncHeadUpdate) GetSnapshotPath() []string {
if m != nil {
return m.SnapshotPath
@ -808,13 +815,6 @@ func (m *SyncHeadUpdate) GetSnapshotPath() []string {
return nil
}
func (m *SyncHeadUpdate) GetTreeHeader() *treepb.TreeHeader {
if m != nil {
return m.TreeHeader
}
return nil
}
type SyncFull struct {
}
@ -855,9 +855,7 @@ var xxx_messageInfo_SyncFull proto.InternalMessageInfo
type SyncFullRequest struct {
Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"`
Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"`
TreeId string `protobuf:"bytes,3,opt,name=treeId,proto3" json:"treeId,omitempty"`
SnapshotPath []string `protobuf:"bytes,4,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"`
TreeHeader *treepb.TreeHeader `protobuf:"bytes,5,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"`
SnapshotPath []string `protobuf:"bytes,3,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"`
}
func (m *SyncFullRequest) Reset() { *m = SyncFullRequest{} }
@ -907,13 +905,6 @@ func (m *SyncFullRequest) GetChanges() []*aclpb.RawChange {
return nil
}
func (m *SyncFullRequest) GetTreeId() string {
if m != nil {
return m.TreeId
}
return ""
}
func (m *SyncFullRequest) GetSnapshotPath() []string {
if m != nil {
return m.SnapshotPath
@ -921,19 +912,10 @@ func (m *SyncFullRequest) GetSnapshotPath() []string {
return nil
}
func (m *SyncFullRequest) GetTreeHeader() *treepb.TreeHeader {
if m != nil {
return m.TreeHeader
}
return nil
}
type SyncFullResponse struct {
Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"`
Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"`
TreeId string `protobuf:"bytes,3,opt,name=treeId,proto3" json:"treeId,omitempty"`
SnapshotPath []string `protobuf:"bytes,4,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"`
TreeHeader *treepb.TreeHeader `protobuf:"bytes,5,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"`
SnapshotPath []string `protobuf:"bytes,3,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"`
}
func (m *SyncFullResponse) Reset() { *m = SyncFullResponse{} }
@ -983,13 +965,6 @@ func (m *SyncFullResponse) GetChanges() []*aclpb.RawChange {
return nil
}
func (m *SyncFullResponse) GetTreeId() string {
if m != nil {
return m.TreeId
}
return ""
}
func (m *SyncFullResponse) GetSnapshotPath() []string {
if m != nil {
return m.SnapshotPath
@ -997,13 +972,6 @@ func (m *SyncFullResponse) GetSnapshotPath() []string {
return nil
}
func (m *SyncFullResponse) GetTreeHeader() *treepb.TreeHeader {
if m != nil {
return m.TreeHeader
}
return nil
}
func init() {
proto.RegisterEnum("anytype.MessageType", MessageType_name, MessageType_value)
proto.RegisterEnum("anytype.SystemErrorCode", SystemErrorCode_name, SystemErrorCode_value)
@ -1028,62 +996,61 @@ func init() {
func init() { proto.RegisterFile("syncproto/proto/sync.proto", fileDescriptor_4b28dfdd48a89166) }
var fileDescriptor_4b28dfdd48a89166 = []byte{
// 868 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xd1, 0x8e, 0xda, 0x46,
0x14, 0x65, 0xc0, 0x40, 0xb8, 0x20, 0xd6, 0x9d, 0x24, 0xad, 0xeb, 0x44, 0x08, 0xa1, 0xb4, 0x45,
// 858 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x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fc, 0xf9, 0xea, 0xff, 0x00, 0x00, 0x00,
0xff, 0xff, 0x6a, 0x04, 0xc0, 0x87, 0xa2, 0x07, 0x00, 0x00,
}
func (m *Message) Marshal() (dAtA []byte, err error) {
@ -1494,6 +1461,25 @@ func (m *Sync) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if len(m.TreeId) > 0 {
i -= len(m.TreeId)
copy(dAtA[i:], m.TreeId)
i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId)))
i--
dAtA[i] = 0x22
}
if m.TreeHeader != nil {
{
size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintSync(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
if m.Message != nil {
{
size, err := m.Message.MarshalToSizedBuffer(dAtA[:i])
@ -1631,34 +1617,15 @@ func (m *SyncHeadUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.TreeHeader != nil {
{
size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintSync(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x2a
}
if len(m.SnapshotPath) > 0 {
for iNdEx := len(m.SnapshotPath) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.SnapshotPath[iNdEx])
copy(dAtA[i:], m.SnapshotPath[iNdEx])
i = encodeVarintSync(dAtA, i, uint64(len(m.SnapshotPath[iNdEx])))
i--
dAtA[i] = 0x22
}
}
if len(m.TreeId) > 0 {
i -= len(m.TreeId)
copy(dAtA[i:], m.TreeId)
i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId)))
i--
dAtA[i] = 0x1a
}
}
if len(m.Changes) > 0 {
for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- {
{
@ -1728,34 +1695,15 @@ func (m *SyncFullRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.TreeHeader != nil {
{
size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintSync(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x2a
}
if len(m.SnapshotPath) > 0 {
for iNdEx := len(m.SnapshotPath) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.SnapshotPath[iNdEx])
copy(dAtA[i:], m.SnapshotPath[iNdEx])
i = encodeVarintSync(dAtA, i, uint64(len(m.SnapshotPath[iNdEx])))
i--
dAtA[i] = 0x22
}
}
if len(m.TreeId) > 0 {
i -= len(m.TreeId)
copy(dAtA[i:], m.TreeId)
i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId)))
i--
dAtA[i] = 0x1a
}
}
if len(m.Changes) > 0 {
for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- {
{
@ -1802,34 +1750,15 @@ func (m *SyncFullResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.TreeHeader != nil {
{
size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintSync(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x2a
}
if len(m.SnapshotPath) > 0 {
for iNdEx := len(m.SnapshotPath) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.SnapshotPath[iNdEx])
copy(dAtA[i:], m.SnapshotPath[iNdEx])
i = encodeVarintSync(dAtA, i, uint64(len(m.SnapshotPath[iNdEx])))
i--
dAtA[i] = 0x22
}
}
if len(m.TreeId) > 0 {
i -= len(m.TreeId)
copy(dAtA[i:], m.TreeId)
i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId)))
i--
dAtA[i] = 0x1a
}
}
if len(m.Changes) > 0 {
for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- {
{
@ -2042,6 +1971,14 @@ func (m *Sync) Size() (n int) {
l = m.Message.Size()
n += 1 + l + sovSync(uint64(l))
}
if m.TreeHeader != nil {
l = m.TreeHeader.Size()
n += 1 + l + sovSync(uint64(l))
}
l = len(m.TreeId)
if l > 0 {
n += 1 + l + sovSync(uint64(l))
}
return n
}
@ -2111,20 +2048,12 @@ func (m *SyncHeadUpdate) Size() (n int) {
n += 1 + l + sovSync(uint64(l))
}
}
l = len(m.TreeId)
if l > 0 {
n += 1 + l + sovSync(uint64(l))
}
if len(m.SnapshotPath) > 0 {
for _, s := range m.SnapshotPath {
l = len(s)
n += 1 + l + sovSync(uint64(l))
}
}
if m.TreeHeader != nil {
l = m.TreeHeader.Size()
n += 1 + l + sovSync(uint64(l))
}
return n
}
@ -2155,20 +2084,12 @@ func (m *SyncFullRequest) Size() (n int) {
n += 1 + l + sovSync(uint64(l))
}
}
l = len(m.TreeId)
if l > 0 {
n += 1 + l + sovSync(uint64(l))
}
if len(m.SnapshotPath) > 0 {
for _, s := range m.SnapshotPath {
l = len(s)
n += 1 + l + sovSync(uint64(l))
}
}
if m.TreeHeader != nil {
l = m.TreeHeader.Size()
n += 1 + l + sovSync(uint64(l))
}
return n
}
@ -2190,20 +2111,12 @@ func (m *SyncFullResponse) Size() (n int) {
n += 1 + l + sovSync(uint64(l))
}
}
l = len(m.TreeId)
if l > 0 {
n += 1 + l + sovSync(uint64(l))
}
if len(m.SnapshotPath) > 0 {
for _, s := range m.SnapshotPath {
l = len(s)
n += 1 + l + sovSync(uint64(l))
}
}
if m.TreeHeader != nil {
l = m.TreeHeader.Size()
n += 1 + l + sovSync(uint64(l))
}
return n
}
@ -3385,6 +3298,74 @@ func (m *Sync) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSync
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthSync
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthSync
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.TreeHeader == nil {
m.TreeHeader = &treepb.TreeHeader{}
}
if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSync
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSync
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthSync
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.TreeId = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipSync(dAtA[iNdEx:])
@ -3657,38 +3638,6 @@ func (m *SyncHeadUpdate) Unmarshal(dAtA []byte) error {
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSync
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSync
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthSync
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.TreeId = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SnapshotPath", wireType)
}
@ -3720,42 +3669,6 @@ func (m *SyncHeadUpdate) Unmarshal(dAtA []byte) error {
}
m.SnapshotPath = append(m.SnapshotPath, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSync
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthSync
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthSync
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.TreeHeader == nil {
m.TreeHeader = &treepb.TreeHeader{}
}
if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipSync(dAtA[iNdEx:])
@ -3923,38 +3836,6 @@ func (m *SyncFullRequest) Unmarshal(dAtA []byte) error {
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSync
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSync
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthSync
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.TreeId = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SnapshotPath", wireType)
}
@ -3986,42 +3867,6 @@ func (m *SyncFullRequest) Unmarshal(dAtA []byte) error {
}
m.SnapshotPath = append(m.SnapshotPath, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSync
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthSync
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthSync
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.TreeHeader == nil {
m.TreeHeader = &treepb.TreeHeader{}
}
if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipSync(dAtA[iNdEx:])
@ -4139,38 +3984,6 @@ func (m *SyncFullResponse) Unmarshal(dAtA []byte) error {
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSync
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSync
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthSync
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.TreeId = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SnapshotPath", wireType)
}
@ -4202,42 +4015,6 @@ func (m *SyncFullResponse) Unmarshal(dAtA []byte) error {
}
m.SnapshotPath = append(m.SnapshotPath, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSync
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthSync
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthSync
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.TreeHeader == nil {
m.TreeHeader = &treepb.TreeHeader{}
}
if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipSync(dAtA[iNdEx:])