Skip to content

Test parallel connected-app writes across two collab replicas #381

Description

@HMarzban

Parent

#328. Follow-up to #229.

Problem

The #229 fix serializes writes with a per-document lock and waits until the save commits (hocuspocusApply.ts withDocumentLock). The lock lives in one process. Production runs two hocuspocus-server replicas behind HOCUSPOCUS_INTERNAL_URL (docker-compose.prod.yml), so two parallel writes to one cold document can reach two appliers with two locks. The clean result in #229 was measured on one process only. Writes in sequence are safe, because a cold 200 waits for its row.

What to do

Measure before changing anything. Run two collab processes on two ports, the way #226 tested two replicas. Send five parallel edit_blocks calls to one section of a cold document with the same rev, split across both processes. Then read the document.

Acceptance

  • The result is posted here: the final text, and the answer each call got.
  • If exactly one write applies and the rest answer a conflict or busy, close this issue.
  • If text is lost or doubled, post the failure and propose the smallest fix here before building it.

Out of scope

Any change to the lock before the measurement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions