Skip to content

Issue with simultaneous Attachment to a new document leading to element coexistence without GC mapping #1300

@raararaara

Description

@raararaara

What happened:
When two clients simultaneously attach to a new document using Attach with InitialRoot, a scenario occurs where one element is not added to gcElementPairMap, resulting in two elements existing concurrently in root.ElementsMapByCreatedAt without the expected mapping in root.gcElementPairMap.

What you expected to happen:
Only one instance of the alive element should exist in Root.ElementsMapByCreatedAt, with proper mapping in root.gcElementPairMap.

How to reproduce it (as minimally and precisely as possible):

  1. Use two clients to simultaneously attach to a new document with Attach with InitialRoot. (codemirror example in yorkie-js-sdk, etc)
  2. Observe the root.ElementsMapByCreatedAt and root.gcElementPairMap post-attachment.

Anything else we need to know?:
This appears to be a concurrency handling issue, and further investigation is necessary to determine the root cause.

Environment:

  • Operating system:
  • Browser and version:
  • Yorkie version: v0.6.14
  • Yorkie JS SDK version: v0.6.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐞Something isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions