From d0c265bdf576d2a59a8d685afa6385580f6185c6 Mon Sep 17 00:00:00 2001 From: lak hyeon Kim Date: Fri, 1 Sep 2023 00:44:02 +0900 Subject: [PATCH 1/4] Fix typo in retention design document (#633) * The figure explains that there is a problem when deleting S3, not S2 --- design/retention.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design/retention.md b/design/retention.md index 54ce78c25..06262385f 100644 --- a/design/retention.md +++ b/design/retention.md @@ -56,7 +56,7 @@ In conclusion, when a snapshot is created, it should not simply delete the chang This can be expressed as a picture above(when SnapshotInterval=10, SnapshotThreshold=5). Assuming that there are a series of C (changes) in chronological order (ServerSeq), S (snapshots) are being created at intervals of 10 and the synchronized ServerSeq is being recorded in SyncedSeq. At this time, there may be a situation where Client A's synchronization is delayed for some reason. -In this situation, if all previous Cs are deleted when S2 is created, Client A must pull C19 and C20 for synchronization, but it is already deleted and does not exist. This is the reason why the previous changes are deleted based on the minimum synced ServerSeq in the actual implementation. +In this situation, if all previous Cs are deleted when S3 is created, Client A must pull C19 and C20 for synchronization, but it is already deleted and does not exist. This is the reason why the previous changes are deleted based on the minimum synced ServerSeq in the actual implementation. ### How it was implemented as code From 3ff801a81d8f1e9c65f7ecc96d95c38614eed8c5 Mon Sep 17 00:00:00 2001 From: JOOHOJANG <46807540+JOOHOJANG@users.noreply.github.com> Date: Wed, 6 Sep 2023 17:29:51 +0900 Subject: [PATCH 2/4] Add Tree benchmark tests (#637) --- test/bench/document_bench_test.go | 149 ++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) diff --git a/test/bench/document_bench_test.go b/test/bench/document_bench_test.go index 2f43393a0..2cf0dc666 100644 --- a/test/bench/document_bench_test.go +++ b/test/bench/document_bench_test.go @@ -470,6 +470,155 @@ func BenchmarkDocument(b *testing.B) { b.Run("object 10000", func(b *testing.B) { benchmarkObject(10000, b) }) + + b.Run("tree 100", func(b *testing.B) { + benchmarkTree(100, b) + }) + + b.Run("tree 1000", func(b *testing.B) { + benchmarkTree(1000, b) + }) + + b.Run("tree 10000", func(b *testing.B) { + benchmarkTree(10000, b) + }) + + b.Run("tree delete all 1000", func(b *testing.B) { + benchmarkTreeDeleteAll(1000, b) + }) + + b.Run("tree edit gc 100", func(b *testing.B) { + benchmarkTreeEditGC(100, b) + }) + + b.Run("tree edit gc 1000", func(b *testing.B) { + benchmarkTreeEditGC(1000, b) + }) + + b.Run("tree split gc 100", func(b *testing.B) { + benchmarkTreeSplitGC(100, b) + }) + + b.Run("tree split gc 1000", func(b *testing.B) { + benchmarkTreeSplitGC(1000, b) + }) + +} + +func benchmarkTree(cnt int, b *testing.B) { + for i := 0; i < b.N; i++ { + doc := document.New("d1") + + err := doc.Update(func(root *json.Object, p *presence.Presence) error { + tree := root.SetNewTree("t", &json.TreeNode{ + Type: "root", + Children: []json.TreeNode{{ + Type: "p", + Children: []json.TreeNode{}, + }}, + }) + for c := 1; c <= cnt; c++ { + tree.Edit(c, c, &json.TreeNode{Type: "text", Value: "a"}) + } + return nil + }) + assert.NoError(b, err) + } +} + +func benchmarkTreeDeleteAll(cnt int, b *testing.B) { + for i := 0; i < b.N; i++ { + doc := document.New("d1") + + err := doc.Update(func(root *json.Object, p *presence.Presence) error { + tree := root.SetNewTree("t", &json.TreeNode{ + Type: "root", + Children: []json.TreeNode{{ + Type: "p", + Children: []json.TreeNode{}, + }}, + }) + for c := 1; c <= cnt; c++ { + tree.Edit(c, c, &json.TreeNode{Type: "text", Value: "a"}) + } + return nil + }) + + err = doc.Update(func(root *json.Object, p *presence.Presence) error { + tree := root.GetTree("t") + tree.Edit(1, cnt+1) + + return nil + }) + assert.NoError(b, err) + } +} + +func benchmarkTreeEditGC(cnt int, b *testing.B) { + for i := 0; i < b.N; i++ { + doc := document.New("d1") + + err := doc.Update(func(root *json.Object, p *presence.Presence) error { + tree := root.SetNewTree("t", &json.TreeNode{ + Type: "root", + Children: []json.TreeNode{{ + Type: "p", + Children: []json.TreeNode{}, + }}, + }) + for c := 1; c <= cnt; c++ { + tree.Edit(c, c, &json.TreeNode{Type: "text", Value: "a"}) + } + return nil + }) + + err = doc.Update(func(root *json.Object, p *presence.Presence) error { + tree := root.GetTree("t") + for c := 1; c <= cnt; c++ { + tree.Edit(c, c+1, &json.TreeNode{Type: "text", Value: "b"}) + } + + return nil + }) + assert.NoError(b, err) + assert.Equal(b, cnt, doc.GarbageLen()) + assert.Equal(b, cnt, doc.GarbageCollect(time.MaxTicket)) + } +} + +func benchmarkTreeSplitGC(cnt int, b *testing.B) { + for i := 0; i < b.N; i++ { + doc := document.New("d1") + + var builder strings.Builder + for i := 0; i < cnt; i++ { + builder.WriteString("a") + } + err := doc.Update(func(root *json.Object, p *presence.Presence) error { + tree := root.SetNewTree("t", &json.TreeNode{ + Type: "root", + Children: []json.TreeNode{{ + Type: "p", + Children: []json.TreeNode{}, + }}, + }) + tree.Edit(1, 1, &json.TreeNode{Type: "text", Value: builder.String()}) + + return nil + }) + + err = doc.Update(func(root *json.Object, p *presence.Presence) error { + tree := root.GetTree("t") + for c := 1; c <= cnt; c++ { + tree.Edit(c, c+1, &json.TreeNode{Type: "text", Value: "b"}) + } + + return nil + }) + assert.NoError(b, err) + assert.Equal(b, cnt, doc.GarbageLen()) + assert.Equal(b, cnt, doc.GarbageCollect(time.MaxTicket)) + } } func benchmarkText(cnt int, b *testing.B) { From 3d10ce57c0871dbcdc7282f2800e889d9705eeae Mon Sep 17 00:00:00 2001 From: Sion Kang Date: Tue, 12 Sep 2023 19:24:02 +0900 Subject: [PATCH 3/4] Bump checkout from v3 to v4 (#641) Signed-off-by: Sion Kang --- .github/workflows/base-docker-publish.yml | 2 +- .github/workflows/chart-release.yml | 2 +- .github/workflows/ci.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/base-docker-publish.yml b/.github/workflows/base-docker-publish.yml index 5c3ee7b6f..635ccb536 100644 --- a/.github/workflows/base-docker-publish.yml +++ b/.github/workflows/base-docker-publish.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go 1.19.2 uses: actions/setup-go@v4 diff --git a/.github/workflows/chart-release.yml b/.github/workflows/chart-release.yml index 473f1766e..09fdf03a9 100644 --- a/.github/workflows/chart-release.yml +++ b/.github/workflows/chart-release.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1969c1297..7d908eefb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: github_token: ${{ github.token }} - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Get tools dependencies run: make tools From 940941a0428ef8969df62c70568421aabd48b02b Mon Sep 17 00:00:00 2001 From: gyuwonMoon <78714820+MoonGyu1@users.noreply.github.com> Date: Tue, 12 Sep 2023 19:25:30 +0900 Subject: [PATCH 4/4] Support concurrent formatting of Text (#639) Currently, we are unable to check for concurrent cases when applying the Text.setStyle operation. This pull request introduces a map called latestCreatedAtMapByActor to track the causality between the operations of the two clients and ensures that the results converge into one. --- api/converter/from_pb.go | 7 + api/converter/to_pb.go | 11 +- api/yorkie/v1/resources.pb.go | 522 +++++++++++++++++++--------- api/yorkie/v1/resources.proto | 1 + pkg/document/crdt/rga_tree_split.go | 6 + pkg/document/crdt/text.go | 38 +- pkg/document/crdt/text_test.go | 2 +- pkg/document/json/text.go | 7 +- pkg/document/operations/style.go | 25 +- test/integration/text_test.go | 78 +++++ 10 files changed, 507 insertions(+), 190 deletions(-) diff --git a/api/converter/from_pb.go b/api/converter/from_pb.go index dcc119b6f..a1b3f623e 100644 --- a/api/converter/from_pb.go +++ b/api/converter/from_pb.go @@ -440,6 +440,12 @@ func fromStyle(pbStyle *api.Operation_Style) (*operations.Style, error) { if err != nil { return nil, err } + createdAtMapByActor, err := fromCreatedAtMapByActor( + pbStyle.CreatedAtMapByActor, + ) + if err != nil { + return nil, err + } executedAt, err := fromTimeTicket(pbStyle.ExecutedAt) if err != nil { return nil, err @@ -448,6 +454,7 @@ func fromStyle(pbStyle *api.Operation_Style) (*operations.Style, error) { parentCreatedAt, from, to, + createdAtMapByActor, pbStyle.Attributes, executedAt, ), nil diff --git a/api/converter/to_pb.go b/api/converter/to_pb.go index 1b1206203..7a603157e 100644 --- a/api/converter/to_pb.go +++ b/api/converter/to_pb.go @@ -354,11 +354,12 @@ func toEdit(e *operations.Edit) (*api.Operation_Edit_, error) { func toStyle(style *operations.Style) (*api.Operation_Style_, error) { return &api.Operation_Style_{ Style: &api.Operation_Style{ - ParentCreatedAt: ToTimeTicket(style.ParentCreatedAt()), - From: toTextNodePos(style.From()), - To: toTextNodePos(style.To()), - Attributes: style.Attributes(), - ExecutedAt: ToTimeTicket(style.ExecutedAt()), + ParentCreatedAt: ToTimeTicket(style.ParentCreatedAt()), + From: toTextNodePos(style.From()), + To: toTextNodePos(style.To()), + CreatedAtMapByActor: toCreatedAtMapByActor(style.CreatedAtMapByActor()), + Attributes: style.Attributes(), + ExecutedAt: ToTimeTicket(style.ExecutedAt()), }, }, nil } diff --git a/api/yorkie/v1/resources.pb.go b/api/yorkie/v1/resources.pb.go index e7e1c9682..77c2f9696 100644 --- a/api/yorkie/v1/resources.pb.go +++ b/api/yorkie/v1/resources.pb.go @@ -1072,14 +1072,15 @@ func (m *Operation_Select) GetExecutedAt() *TimeTicket { } type Operation_Style struct { - ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` - From *TextNodePos `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` - To *TextNodePos `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` - Attributes map[string]string `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - ExecutedAt *TimeTicket `protobuf:"bytes,5,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` + From *TextNodePos `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` + To *TextNodePos `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` + Attributes map[string]string `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ExecutedAt *TimeTicket `protobuf:"bytes,5,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"` + CreatedAtMapByActor map[string]*TimeTicket `protobuf:"bytes,6,rep,name=created_at_map_by_actor,json=createdAtMapByActor,proto3" json:"created_at_map_by_actor,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Operation_Style) Reset() { *m = Operation_Style{} } @@ -1150,6 +1151,13 @@ func (m *Operation_Style) GetExecutedAt() *TimeTicket { return nil } +func (m *Operation_Style) GetCreatedAtMapByActor() map[string]*TimeTicket { + if m != nil { + return m.CreatedAtMapByActor + } + return nil +} + type Operation_Increase struct { ParentCreatedAt *TimeTicket `protobuf:"bytes,1,opt,name=parent_created_at,json=parentCreatedAt,proto3" json:"parent_created_at,omitempty"` Value *JSONElementSimple `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` @@ -3341,6 +3349,7 @@ func init() { proto.RegisterType((*Operation_Select)(nil), "yorkie.v1.Operation.Select") proto.RegisterType((*Operation_Style)(nil), "yorkie.v1.Operation.Style") proto.RegisterMapType((map[string]string)(nil), "yorkie.v1.Operation.Style.AttributesEntry") + proto.RegisterMapType((map[string]*TimeTicket)(nil), "yorkie.v1.Operation.Style.CreatedAtMapByActorEntry") proto.RegisterType((*Operation_Increase)(nil), "yorkie.v1.Operation.Increase") proto.RegisterType((*Operation_TreeEdit)(nil), "yorkie.v1.Operation.TreeEdit") proto.RegisterMapType((map[string]*TimeTicket)(nil), "yorkie.v1.Operation.TreeEdit.CreatedAtMapByActorEntry") @@ -3382,170 +3391,171 @@ func init() { func init() { proto.RegisterFile("yorkie/v1/resources.proto", fileDescriptor_36361b2f5d0f0896) } var fileDescriptor_36361b2f5d0f0896 = []byte{ - // 2599 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0xcd, 0x8f, 0x1b, 0x49, - 0x15, 0x9f, 0x6e, 0xb7, 0x3f, 0xfa, 0x4d, 0x32, 0xe3, 0xd4, 0xe4, 0xc3, 0x71, 0x92, 0xd9, 0x89, - 0x97, 0x5d, 0x66, 0x13, 0xf0, 0x7c, 0xb0, 0xbb, 0x2c, 0x09, 0x01, 0x3c, 0x76, 0x27, 0xe3, 0xec, - 0xc4, 0x33, 0xb4, 0x3d, 0x59, 0xb2, 0x02, 0xb5, 0x7a, 0xba, 0x6b, 0x66, 0x7a, 0xc7, 0xee, 0xf6, - 0x76, 0xb7, 0xbd, 0xb1, 0x84, 0x84, 0x84, 0x40, 0xe2, 0xca, 0x0d, 0xfe, 0x04, 0x2e, 0xdc, 0xf7, - 0x08, 0x07, 0x84, 0x84, 0x10, 0x2b, 0xb1, 0x12, 0x57, 0x36, 0x1c, 0x10, 0xdc, 0x10, 0x12, 0x37, - 0x24, 0x54, 0x1f, 0xdd, 0x6e, 0xdb, 0x6d, 0x8f, 0x63, 0x86, 0x55, 0x22, 0x6e, 0x5d, 0x55, 0xb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, 0xa0, 0x2b, 0x29, - 0xba, 0xea, 0xd4, 0xed, 0x06, 0x09, 0x58, 0x2a, 0x03, 0xcc, 0x98, 0x95, 0x47, 0x39, 0x99, 0x98, - 0x81, 0x93, 0xd2, 0x74, 0x9c, 0xcc, 0xff, 0x51, 0x00, 0x39, 0xf4, 0xea, 0x44, 0xab, 0x1e, 0x94, - 0x5e, 0x1e, 0xab, 0xfe, 0x26, 0x80, 0x1c, 0x32, 0x2d, 0x5c, 0x77, 0xc2, 0xf4, 0xeb, 0x4e, 0x8c, - 0xac, 0xbb, 0x19, 0xcf, 0x84, 0x51, 0x5b, 0xa5, 0x19, 0x6c, 0x4d, 0x4e, 0x69, 0xeb, 0x1f, 0x04, - 0x90, 0xc8, 0xc2, 0x40, 0x6f, 0x0c, 0x3a, 0x6f, 0x29, 0x26, 0xf7, 0x7b, 0x39, 0xbc, 0xf7, 0x57, - 0x01, 0xd2, 0x7c, 0xd1, 0xfe, 0x3f, 0xf8, 0xce, 0xc5, 0x78, 0xa2, 0xef, 0x78, 0x02, 0xf4, 0x52, - 0xf8, 0x2e, 0xdc, 0x9f, 0x1f, 0x41, 0x9a, 0xc7, 0xc1, 0x98, 0xed, 0x7d, 0x1d, 0xd2, 0x98, 0xc5, - 0xd8, 0x98, 0x13, 0x4d, 0xf4, 0xf2, 0x23, 0x80, 0x15, 0x0c, 0x48, 0xf3, 0x00, 0x44, 0x92, 0x22, - 0x9b, 0x6c, 0x15, 0xc2, 0x48, 0xba, 0x13, 0x84, 0x28, 0xda, 0x3e, 0xc3, 0x20, 0x8f, 0x21, 0x43, - 0xe4, 0x49, 0x7a, 0xd2, 0x67, 0x93, 0x10, 0xc9, 0x40, 0xc8, 0x9c, 0x74, 0xda, 0xe6, 0x74, 0x73, - 0xcf, 0x81, 0x25, 0xbf, 0xf0, 0x7b, 0x11, 0x32, 0xc1, 0x0a, 0x44, 0xaf, 0x45, 0x6e, 0x05, 0x2e, - 0xc5, 0x2c, 0x51, 0x7e, 0x2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 0x02, 0x7f, 0x1e, 0x11, 0x49, 0xec, 0xd7, 0x20, 0x13, - 0x3c, 0x50, 0x98, 0xf4, 0x30, 0x25, 0x04, 0x15, 0x5a, 0xc1, 0xb3, 0x14, 0xd2, 0x09, 0xba, 0x06, - 0x57, 0xca, 0xdb, 0xa5, 0xda, 0x03, 0x45, 0x6b, 0x3c, 0xd9, 0x53, 0xb4, 0xfd, 0x5a, 0x7d, 0x4f, - 0x29, 0x57, 0xef, 0x57, 0x95, 0x4a, 0x76, 0x0e, 0x2d, 0xc1, 0x62, 0xb4, 0x71, 0x6f, 0xbf, 0x91, - 0x15, 0xd0, 0x65, 0x40, 0xd1, 0xca, 0x8a, 0xb2, 0xa3, 0x34, 0x94, 0xac, 0x88, 0x2e, 0xc1, 0x85, - 0x68, 0x7d, 0x79, 0x47, 0x29, 0xa9, 0xd9, 0x44, 0xa1, 0x0b, 0x99, 0x40, 0x09, 0xb4, 0x01, 0x12, - 0xa1, 0x32, 0xdf, 0x7d, 0x6e, 0xc4, 0xe8, 0x59, 0xac, 0xe8, 0xbe, 0xce, 0xb6, 0x46, 0x0a, 0xcd, - 0x7f, 0x15, 0xe4, 0xb0, 0xea, 0x79, 0x7e, 0x85, 0x15, 0x6a, 0xc4, 0xcc, 0xf0, 0x8d, 0xcc, 0xe0, - 0x43, 0x0c, 0x21, 0xee, 0x21, 0xc6, 0xe0, 0x53, 0x0e, 0x71, 0xe8, 0x29, 0x47, 0xe1, 0x47, 0x02, - 0xcc, 0x47, 0x2e, 0x09, 0xce, 0x76, 0x3f, 0x44, 0x5f, 0x84, 0x45, 0x17, 0x37, 0x75, 0x72, 0x20, - 0xd7, 0x38, 0x20, 0x41, 0x01, 0x0b, 0x41, 0xf5, 0x2e, 0xdb, 0x38, 0x0d, 0x80, 0x7e, 0xcf, 0xd1, - 0xc7, 0x23, 0xc2, 0xe8, 0xe3, 0x91, 0xeb, 0x20, 0x9b, 0xb8, 0x49, 0xce, 0xf9, 0xd8, 0x0d, 0x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, 0x4f, 0xaa, 0xa2, 0x64, 0xcf, 0xdf, 0xfa, 0x01, 0x9c, - 0x8b, 0xba, 0x02, 0xbd, 0x0a, 0xaf, 0x54, 0x76, 0xcb, 0x9a, 0xf2, 0x58, 0xa9, 0x35, 0x82, 0x29, - 0x28, 0xef, 0x3f, 0x22, 0x25, 0xb6, 0x40, 0xc9, 0xd2, 0x9e, 0x00, 0x7a, 0xaf, 0xd4, 0x28, 0x6f, - 0x2b, 0x95, 0xac, 0x80, 0x5e, 0x83, 0x9b, 0xe3, 0x40, 0xfb, 0xb5, 0x00, 0x26, 0x6e, 0xdd, 0xfe, - 0xed, 0xb3, 0x65, 0xe1, 0x93, 0x67, 0xcb, 0xc2, 0x9f, 0x9f, 0x2d, 0x0b, 0x3f, 0xfb, 0xcb, 0xf2, - 0x1c, 0x5c, 0x30, 0x71, 0x37, 0x60, 0x8a, 0xde, 0xb6, 0x8a, 0xdd, 0x8d, 0x3d, 0xe1, 0x7d, 0xa9, - 0x78, 0xb7, 0xbb, 0x71, 0x90, 0xa2, 0xb1, 0xf1, 0x2b, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x63, - 0xfc, 0xff, 0x26, 0x54, 0x28, 0x00, 0x00, + // 2620 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x5a, 0xdb, 0x6f, 0xdb, 0xc8, + 0xd5, 0x37, 0x29, 0xea, 0xc2, 0xe3, 0xc4, 0x56, 0xc6, 0xb9, 0x28, 0x4a, 0xe2, 0x4d, 0xb4, 0xdf, + 0xee, 0xe7, 0x4d, 0x5a, 0xf9, 0xb2, 0x97, 0x6e, 0x77, 0x9b, 0xb6, 0xb2, 0xc4, 0xc4, 0xca, 0x3a, + 0xb2, 0x4b, 0xc9, 0xd9, 0x66, 0xd1, 0x82, 0xa0, 0xc9, 0xb1, 0xcd, 0xb5, 0x44, 0x6a, 0x49, 0x4a, + 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f, 0xe2, 0x6e, 0x00, 0x52, 0x6c, 0xdf, 0xed, 0xa9, 0x7d, 0xa1, 0xfc, + 0x77, 0x60, 0x61, 0xb0, 0x11, 0x65, 0x21, 0x71, 0x8c, 0x7b, 0x74, 0x78, 0x59, 0x25, 0x9f, 0xe8, + 0x35, 0x48, 0x76, 0xf5, 0x66, 0x07, 0xe7, 0x44, 0xaa, 0xd2, 0x52, 0x64, 0x84, 0x40, 0x56, 0x65, + 0x88, 0x77, 0xc4, 0xb7, 0x85, 0xc2, 0xcf, 0x44, 0x80, 0xf2, 0x91, 0x6e, 0x1f, 0xe2, 0x5d, 0xdd, + 0x38, 0x46, 0xb7, 0xe0, 0x9c, 0xe9, 0x18, 0x1d, 0xa2, 0xb5, 0xd6, 0xef, 0x78, 0x3e, 0xa8, 0x7b, + 0x0f, 0xf7, 0xd0, 0x9b, 0x00, 0xc6, 0x11, 0x36, 0x8e, 0xdb, 0x8e, 0x65, 0xfb, 0x7c, 0x94, 0x4b, + 0x91, 0x51, 0xca, 0x61, 0xa3, 0x1a, 0x01, 0xa2, 0x3c, 0x64, 0x3c, 0x6e, 0x61, 0x2e, 0x71, 0x53, + 0x58, 0x39, 0xa7, 0x86, 0x65, 0x74, 0x07, 0xd2, 0x06, 0xd5, 0xc1, 0xcb, 0x49, 0x74, 0x5e, 0x2e, + 0x0c, 0xf4, 0x47, 0x5a, 0xd4, 0x00, 0x81, 0x4a, 0x70, 0xa1, 0x65, 0xd9, 0x9a, 0xd7, 0xb3, 0x0d, + 0x6c, 0x6a, 0xbe, 0x65, 0x1c, 0x63, 0x3f, 0x97, 0x1c, 0x51, 0xa3, 0x61, 0xb5, 0x70, 0x83, 0x36, + 0xaa, 0x8b, 0x2d, 0xcb, 0xae, 0x53, 0x38, 0xab, 0x40, 0x37, 0x00, 0x2c, 0x4f, 0x73, 0x71, 0xcb, + 0xe9, 0x62, 0x33, 0x97, 0xba, 0x29, 0xac, 0x64, 0x54, 0xd9, 0xf2, 0x54, 0x56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+ 0xcc, 0xf0, 0xb5, 0xcf, 0xe0, 0x93, 0x12, 0x21, 0xee, 0x49, 0xc9, 0xe0, 0xa3, 0x14, 0x71, 0xe8, + 0x51, 0x4a, 0xe1, 0xc7, 0x02, 0xcc, 0x47, 0xae, 0x3b, 0xce, 0x76, 0x3f, 0x44, 0xff, 0x0f, 0x8b, + 0x2e, 0x6e, 0xea, 0xe4, 0x40, 0xae, 0x71, 0x40, 0x82, 0x02, 0x16, 0x82, 0xea, 0x1d, 0xb6, 0x71, + 0x1a, 0x00, 0xfd, 0x9e, 0xa3, 0xcf, 0x60, 0x84, 0xd1, 0x67, 0x30, 0xd7, 0x41, 0x36, 0x71, 0x93, + 0x9c, 0xf3, 0xb1, 0x1b, 0x18, 0x14, 0x56, 0x0c, 0x3c, 0x92, 0x49, 0x0c, 0x3e, 0x92, 0xd9, 0x83, + 0x4c, 0xc5, 0x31, 0x94, 0x2e, 0xb6, 0x7d, 0x74, 0x67, 0x80, 0x99, 0x57, 0x22, 0x16, 0x06, 0x90, + 0x08, 0x19, 0xaf, 0x03, 0xdb, 0xa7, 0xbc, 0x23, 0x3e, 0x62, 0xb0, 0x71, 0x91, 0x8a, 0xdb, 0x9f, + 0x89, 0x20, 0x87, 0xe7, 0x52, 0x42, 0xae, 0x47, 0xa5, 0xed, 0x3d, 0x4e, 0x97, 0xda, 0xde, 0xf6, + 0x76, 0x76, 0x8e, 0x90, 0x2b, 0x52, 0xb9, 0xb9, 0xb3, 0xb3, 0xad, 0x94, 0x6a, 0x8c, 0x74, 0x91, + 0xfa, 0x6a, 0xad, 0xa1, 0xdc, 0x57, 0xd4, 0xac, 0x38, 0xd4, 0xc9, 0xf6, 0x4e, 0xed, 0x7e, 0x36, + 0x41, 0x98, 0x18, 0xa9, 0xac, 0xec, 0xec, 0x6d, 0x6e, 0x2b, 0x59, 0x69, 0xa8, 0xba, 0xde, 0x50, + 0xab, 0xb5, 0xfb, 0xd9, 0x24, 0xba, 0x08, 0xd9, 0xe8, 0x90, 0x8f, 0x1b, 0x4a, 0x3d, 0x9b, 0x1a, + 0xea, 0xb8, 0x52, 0x6a, 0x28, 0xd9, 0x34, 0xca, 0xc3, 0xe5, 0x48, 0x25, 0x39, 0x25, 0x69, 0x3b, + 0x9b, 0x0f, 0x94, 0x72, 0x23, 0x9b, 0x41, 0x57, 0xe1, 0xd2, 0x70, 0x5b, 0x49, 0x55, 0x4b, 0x8f, + 0xb3, 0xf2, 0x50, 0x5f, 0x0d, 0xe5, 0xbb, 0x8d, 0x2c, 0x0c, 0xf5, 0xc5, 0x2d, 0xd2, 0xca, 0xb5, + 0x46, 0x76, 0x1e, 0x5d, 0x81, 0xa5, 0x21, 0xab, 0x68, 0xc3, 0xb9, 0xe1, 0x9e, 0x54, 0x45, 0xc9, + 0x9e, 0xbf, 0xfd, 0x43, 0x38, 0x17, 0x75, 0x05, 0x7a, 0x19, 0x5e, 0xaa, 0xec, 0x94, 0x35, 0xe5, + 0x91, 0x52, 0x6b, 0x04, 0x53, 0x50, 0xde, 0x7b, 0x48, 0x4a, 0x2c, 0x40, 0x49, 0x68, 0x4f, 0x00, + 0xbd, 0x5f, 0x6a, 0x94, 0xb7, 0x94, 0x4a, 0x56, 0x40, 0xaf, 0xc0, 0xad, 0x71, 0xa0, 0xbd, 0x5a, + 0x00, 0x13, 0x37, 0xef, 0xfc, 0xee, 0xe9, 0xb2, 0xf0, 0xe9, 0xd3, 0x65, 0xe1, 0x2f, 0x4f, 0x97, + 0x85, 0x9f, 0x7f, 0xbe, 0x3c, 0x07, 0x17, 0x4c, 0xdc, 0x0d, 0x98, 0xa2, 0xb7, 0xad, 0x62, 0x77, + 0x7d, 0x57, 0xf8, 0x40, 0x2a, 0xbe, 0xdb, 0x5d, 0xdf, 0x4f, 0xd1, 0xb5, 0xf1, 0xf5, 0xff, 0x06, + 0x00, 0x00, 0xff, 0xff, 0xcd, 0x66, 0xbf, 0x7b, 0x1e, 0x29, 0x00, 0x00, } func (m *Snapshot) Marshal() (dAtA []byte, err error) { @@ -4578,6 +4588,32 @@ func (m *Operation_Style) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.CreatedAtMapByActor) > 0 { + for k := range m.CreatedAtMapByActor { + v := m.CreatedAtMapByActor[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResources(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintResources(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintResources(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } if m.ExecutedAt != nil { { size, err := m.ExecutedAt.MarshalToSizedBuffer(dAtA[:i]) @@ -7249,6 +7285,19 @@ func (m *Operation_Style) Size() (n int) { l = m.ExecutedAt.Size() n += 1 + l + sovResources(uint64(l)) } + if len(m.CreatedAtMapByActor) > 0 { + for k, v := range m.CreatedAtMapByActor { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovResources(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovResources(uint64(len(k))) + l + n += mapEntrySize + 1 + sovResources(uint64(mapEntrySize)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -11082,6 +11131,135 @@ func (m *Operation_Style) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAtMapByActor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResources + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResources + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAtMapByActor == nil { + m.CreatedAtMapByActor = make(map[string]*TimeTicket) + } + var mapkey string + var mapvalue *TimeTicket + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthResources + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthResources + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResources + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthResources + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthResources + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &TimeTicket{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipResources(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResources + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.CreatedAtMapByActor[mapkey] = mapvalue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipResources(dAtA[iNdEx:]) diff --git a/api/yorkie/v1/resources.proto b/api/yorkie/v1/resources.proto index 281b5906d..75947b1df 100644 --- a/api/yorkie/v1/resources.proto +++ b/api/yorkie/v1/resources.proto @@ -111,6 +111,7 @@ message Operation { TextNodePos to = 3; map attributes = 4; TimeTicket executed_at = 5; + map created_at_map_by_actor = 6; } message Increase { TimeTicket parent_created_at = 1; diff --git a/pkg/document/crdt/rga_tree_split.go b/pkg/document/crdt/rga_tree_split.go index cabb68b0d..54ab7306d 100644 --- a/pkg/document/crdt/rga_tree_split.go +++ b/pkg/document/crdt/rga_tree_split.go @@ -262,6 +262,12 @@ func (s *RGATreeSplitNode[V]) Remove(removedAt *time.Ticket, latestCreatedAt *ti return false } +// canStyle checks if node is able to set style. +func (s *RGATreeSplitNode[V]) canStyle(editedAt *time.Ticket, latestCreatedAt *time.Ticket) bool { + return !s.createdAt().After(latestCreatedAt) && + (s.removedAt == nil || editedAt.After(s.removedAt)) +} + // Value returns the value of this node. func (s *RGATreeSplitNode[V]) Value() V { return s.value diff --git a/pkg/document/crdt/text.go b/pkg/document/crdt/text.go index 148f3d959..be33ce9be 100644 --- a/pkg/document/crdt/text.go +++ b/pkg/document/crdt/text.go @@ -250,28 +250,58 @@ func (t *Text) Edit( func (t *Text) Style( from, to *RGATreeSplitNodePos, + latestCreatedAtMapByActor map[string]*time.Ticket, attributes map[string]string, executedAt *time.Ticket, -) error { +) (map[string]*time.Ticket, error) { // 01. Split nodes with from and to _, toRight, err := t.rgaTreeSplit.findNodeWithSplit(to, executedAt) if err != nil { - return err + return nil, err } _, fromRight, err := t.rgaTreeSplit.findNodeWithSplit(from, executedAt) if err != nil { - return err + return nil, err } // 02. style nodes between from and to nodes := t.rgaTreeSplit.findBetween(fromRight, toRight) + createdAtMapByActor := make(map[string]*time.Ticket) + var toBeStyled []*RGATreeSplitNode[*TextValue] + for _, node := range nodes { + actorIDHex := node.id.createdAt.ActorIDHex() + + var latestCreatedAt *time.Ticket + if len(latestCreatedAtMapByActor) == 0 { + latestCreatedAt = time.MaxTicket + } else { + createdAt, ok := latestCreatedAtMapByActor[actorIDHex] + if ok { + latestCreatedAt = createdAt + } else { + latestCreatedAt = time.InitialTicket + } + } + + if node.canStyle(executedAt, latestCreatedAt) { + latestCreatedAt = createdAtMapByActor[actorIDHex] + createdAt := node.id.createdAt + if latestCreatedAt == nil || createdAt.After(latestCreatedAt) { + createdAtMapByActor[actorIDHex] = createdAt + } + toBeStyled = append(toBeStyled, node) + } + } + + for _, node := range toBeStyled { val := node.value for key, value := range attributes { val.attrs.Set(key, value, executedAt) } } - return nil + + return createdAtMapByActor, nil } // Nodes returns the internal nodes of this Text. diff --git a/pkg/document/crdt/text_test.go b/pkg/document/crdt/text_test.go index e69ae829f..0b2ee5ed1 100644 --- a/pkg/document/crdt/text_test.go +++ b/pkg/document/crdt/text_test.go @@ -80,7 +80,7 @@ func TestText(t *testing.T) { assert.Equal(t, `[{"val":"Hello "},{"val":"Yorkie"}]`, text.Marshal()) fromPos, toPos, _ = text.CreateRange(0, 1) - err = text.Style(fromPos, toPos, map[string]string{"b": "1"}, ctx.IssueTimeTicket()) + _, err = text.Style(fromPos, toPos, nil, map[string]string{"b": "1"}, ctx.IssueTimeTicket()) assert.NoError(t, err) assert.Equal( t, diff --git a/pkg/document/json/text.go b/pkg/document/json/text.go index abac1becc..fc053e6f7 100644 --- a/pkg/document/json/text.go +++ b/pkg/document/json/text.go @@ -103,12 +103,14 @@ func (p *Text) Style(from, to int, attributes map[string]string) *Text { } ticket := p.context.IssueTimeTicket() - if err := p.Text.Style( + maxCreationMapByActor, err := p.Text.Style( fromPos, toPos, + nil, attributes, ticket, - ); err != nil { + ) + if err != nil { panic(err) } @@ -116,6 +118,7 @@ func (p *Text) Style(from, to int, attributes map[string]string) *Text { p.CreatedAt(), fromPos, toPos, + maxCreationMapByActor, attributes, ticket, )) diff --git a/pkg/document/operations/style.go b/pkg/document/operations/style.go index 069f8a4d1..5394bc9de 100644 --- a/pkg/document/operations/style.go +++ b/pkg/document/operations/style.go @@ -32,6 +32,10 @@ type Style struct { // to is the end point of the range to apply the style to. to *crdt.RGATreeSplitNodePos + // latestCreatedAtMapByActor is a map that stores the latest creation time + // by actor for the nodes included in the range to apply the style to. + latestCreatedAtMapByActor map[string]*time.Ticket + // attributes represents the text style. attributes map[string]string @@ -44,15 +48,17 @@ func NewStyle( parentCreatedAt *time.Ticket, from *crdt.RGATreeSplitNodePos, to *crdt.RGATreeSplitNodePos, + latestCreatedAtMapByActor map[string]*time.Ticket, attributes map[string]string, executedAt *time.Ticket, ) *Style { return &Style{ - parentCreatedAt: parentCreatedAt, - from: from, - to: to, - attributes: attributes, - executedAt: executedAt, + parentCreatedAt: parentCreatedAt, + from: from, + to: to, + latestCreatedAtMapByActor: latestCreatedAtMapByActor, + attributes: attributes, + executedAt: executedAt, } } @@ -64,7 +70,8 @@ func (e *Style) Execute(root *crdt.Root) error { return ErrNotApplicableDataType } - return obj.Style(e.from, e.to, e.attributes, e.executedAt) + _, err := obj.Style(e.from, e.to, e.latestCreatedAtMapByActor, e.attributes, e.executedAt) + return err } // From returns the start point of the editing range. @@ -96,3 +103,9 @@ func (e *Style) ParentCreatedAt() *time.Ticket { func (e *Style) Attributes() map[string]string { return e.attributes } + +// CreatedAtMapByActor returns the map that stores the latest creation time +// by actor for the nodes included in the range to apply the style to. +func (e *Style) CreatedAtMapByActor() map[string]*time.Ticket { + return e.latestCreatedAtMapByActor +} diff --git a/test/integration/text_test.go b/test/integration/text_test.go index 3d1e0287f..b85be27d4 100644 --- a/test/integration/text_test.go +++ b/test/integration/text_test.go @@ -96,6 +96,43 @@ func TestText(t *testing.T) { syncClientsThenAssertEqual(t, []clientAndDocPair{{c1, d1}, {c2, d2}}) }) + t.Run("concurrent insertion and deletion test", func(t *testing.T) { + ctx := context.Background() + d1 := document.New(helper.TestDocKey(t)) + err := c1.Attach(ctx, d1) + assert.NoError(t, err) + + err = d1.Update(func(root *json.Object, p *presence.Presence) error { + root.SetNewText("k1").Edit(0, 0, "AB") + return nil + }, "set a new text by c1") + assert.NoError(t, err) + err = c1.Sync(ctx) + assert.NoError(t, err) + + d2 := document.New(helper.TestDocKey(t)) + err = c2.Attach(ctx, d2) + assert.NoError(t, err) + assert.Equal(t, `{"k1":[{"val":"AB"}]}`, d2.Marshal()) + + err = d1.Update(func(root *json.Object, p *presence.Presence) error { + root.GetText("k1").Edit(0, 2, "") + return nil + }) + assert.NoError(t, err) + assert.Equal(t, `{"k1":[]}`, d1.Marshal()) + + err = d2.Update(func(root *json.Object, p *presence.Presence) error { + root.GetText("k1").Edit(1, 1, "C") + return nil + }) + assert.NoError(t, err) + assert.Equal(t, `{"k1":[{"val":"A"},{"val":"C"},{"val":"B"}]}`, d2.Marshal()) + + syncClientsThenAssertEqual(t, []clientAndDocPair{{c1, d1}, {c2, d2}}) + assert.Equal(t, `{"k1":[{"val":"C"}]}`, d1.Marshal()) + }) + t.Run("rich text test", func(t *testing.T) { ctx := context.Background() d1 := document.New(helper.TestDocKey(t)) @@ -226,4 +263,45 @@ func TestText(t *testing.T) { assert.True(t, d1.Root().GetText("k1").CheckWeight()) assert.True(t, d2.Root().GetText("k1").CheckWeight()) }) + + // Peritext test + t.Run("ex2. concurrent formatting and insertion test", func(t *testing.T) { + ctx := context.Background() + d1 := document.New(helper.TestDocKey(t)) + err := c1.Attach(ctx, d1) + assert.NoError(t, err) + + err = d1.Update(func(root *json.Object, p *presence.Presence) error { + root.SetNewText("k1").Edit(0, 0, "The fox jumped.", nil) + return nil + }) + assert.NoError(t, err) + err = c1.Sync(ctx) + assert.NoError(t, err) + + d2 := document.New(helper.TestDocKey(t)) + err = c2.Attach(ctx, d2) + assert.NoError(t, err) + assert.Equal(t, `{"k1":[{"val":"The fox jumped."}]}`, d2.Marshal()) + + err = d1.Update(func(root *json.Object, p *presence.Presence) error { + root.GetText("k1").Style(0, 15, map[string]string{"b": "1"}) + return nil + }) + assert.NoError(t, err) + assert.Equal(t, `{"k1":[{"attrs":{"b":"1"},"val":"The fox jumped."}]}`, d1.Marshal()) + + err = d2.Update(func(root *json.Object, p *presence.Presence) error { + root.GetText("k1").Edit(4, 4, "brown ") + return nil + }) + assert.NoError(t, err) + assert.Equal(t, `{"k1":[{"val":"The "},{"val":"brown "},{"val":"fox jumped."}]}`, d2.Marshal()) + + syncClientsThenAssertEqual(t, []clientAndDocPair{{c1, d1}, {c2, d2}}) + assert.Equal(t, `{"k1":[{"attrs":{"b":"1"},"val":"The "},{"val":"brown "},{"attrs":{"b":"1"},"val":"fox jumped."}]}`, d1.Marshal()) + + // TODO(MoonGyu1): d1 and d2 should have the result below after applying mark operation + // assert.Equal(t, `{"k1":[{"attrs":{"b":"1"},"val":"The "},{"attrs":{"b":"1"},"val":"brown "},{"attrs":{"b":"1"},"val":"fox jumped."}]}`, d1.Marshal()) + }) }