Skip to content

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

Open

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

  1. added
    bug
    on Sep 29, 2026
  2. HMarzban commented on Oct 15, 2026

    @HMarzban
    CollaboratorAuthor

    Related issues


    Cross-link review, 2026-10-15. Generated by Claude Code

  3. added this to the v2.4.0 milestone on Oct 24, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions