Structures

SharedDirectory

The flat field map has grown into folders for each trail. Alice and Bob both create an Eagle Creek folder before either sees the other operation.

A path name is not enough identity

A SharedDirectory gives each folder instance stable identity. Concurrent creates of the same name converge on one folder. If that folder is deleted and recreated, stale operations for the old instance do not attach to the replacement.

HikerOperationMerged tree
AliceCreate /eagle-creekOne /eagle-creek folder
BobCreate /eagle-creek
The shared path resolves to one folder identity on every replica.

Three field maps

Merge two creates of the same folder

Alice and Bob create /eagle-creek concurrently. The sequenced directory resolves both operations to one shared path.

Conflict rule Retain stable folder identities across concurrent create, delete, and recreate operations.

Alice

Empty map

No entries

Map-edit slip Create /eagle-creek stable folder identity A:eagle-creek

Bob

Empty map

No entries

Map-edit slip Create /eagle-creek stable folder identity B:eagle-creek

Carol

Empty map

No entries

Map-edit slip No slip in this race Carol observes delivery

Trail exchange Identity metadata retained after merge 0 operations shared

Mechanism evidenceNo race delivered yet.

  1. No operations shared yet.

Enable JavaScript to run the demo. The race and expected result remain in the lesson.

Run the authored race, or let any hiker edit a local map.

Reusing a name does not reuse an instance

A later folder may use the same path text, but it has a different identity. This prevents a delayed key write for a deleted folder from appearing inside its replacement.

Sources and implementation

The demo runs Watershed's SharedDirectory kernel through a three-client Sluice room.