{
  "status": "shipping",
  "advantages": [
    {
      "text": "Because the resource itself enforces ordering, safety does not depend on bounded process pauses, bounded network delay or accurate clocks at the lock holder.",
      "citationIds": [
        "fencing-essay"
      ]
    }
  ],
  "limitations": [
    {
      "text": "The token source must be strictly monotonic across its own failures: a unique random value lacks ordering, a single-node counter can be lost and independent counters on several nodes drift apart, which points toward consensus.",
      "citationIds": [
        "fencing-essay"
      ]
    },
    {
      "text": "Protection covers only resources that check tokens, so services unable to validate sequencers remain exposed to stale operations.",
      "citationIds": [
        "lock-service-osdi06"
      ]
    },
    {
      "text": "Rejecting obsolete requests does not by itself provide multi-resource transaction atomicity. Minuet keeps per-resource session state at the target and adds a separate transaction and log-recovery protocol.",
      "citationIds": [
        "minuet-fast09"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-30",
  "slug": "fencing-token",
  "term": "Fencing token",
  "aliases": [],
  "definition": "A fencing token identifies an ownership generation that a receiving service checks to reject operations from an obsolete owner.",
  "note": "In one lock-service design, a holder can request a sequencer, an opaque byte string recording the lock name, the acquisition mode (exclusive or shared) and the lock generation number. A receiving server checks it against the lock service or against the most recent sequencer it has observed, and rejects stale requests. Merely issuing or attaching a token does not enforce exclusion. The 2006 design caps lock-delay at 1 minute for failed or unreachable holders; normal release makes the lock immediately available. This is not a current default or an I/O completion guarantee. [lock-service-osdi06]\n\nIn a worked example, a client holding token 33 pauses while its lease expires, a second client obtains token 34 and writes, and storage then rejects the delayed write carrying 33 because it has already processed a higher number. Stop-the-world garbage collection pauses of several minutes and a recorded network packet delay of 90 seconds show that such pauses outlast realistic leases. [fencing-essay]",
  "related": [
    "minuet-san",
    "io-fencing",
    "scsi-persistent-reservations",
    "shared-disk-filesystem",
    "lock-delay"
  ],
  "citations": [
    {
      "id": "lock-service-osdi06",
      "title": "Mike Burrows. The Chubby lock service for loosely-coupled distributed systems. OSDI 2006, sections 2.1 and 2.4.",
      "url": "https://www.usenix.org/legacy/event/osdi06/tech/full_papers/burrows/burrows.pdf",
      "accessed": "2026-10-23"
    },
    {
      "id": "hesela-fencing",
      "title": "Storage fencing: why a lost heartbeat does not stop writes",
      "url": "https://hesela.com/analyses/storage-fencing-stale-writes/",
      "accessed": "2026-10-11"
    },
    {
      "id": "fencing-essay",
      "title": "Martin Kleppmann. How to do distributed locking. Essay, 8 February 2016, sections on fencing and synchrony assumptions.",
      "url": "https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html",
      "accessed": "2026-10-23"
    },
    {
      "id": "minuet-fast09",
      "title": "Ermolinskiy, Moon, Chun and Shenker. Minuet: Rethinking Concurrency Control in Storage Area Networks. FAST 2009, sections 3.2 and 3.4.2.",
      "url": "https://www.usenix.org/legacy/event/fast09/tech/full_papers/ermolinskiy/ermolinskiy_html/index.html",
      "accessed": "2026-10-24"
    }
  ],
  "provenance": [
    "lock-service-osdi06 read 2026-10-23, section 2.4, for sequencer contents, server-side checking and the lock-delay bound.",
    "fencing-essay read 2026-10-23, sections on fencing and timing assumptions, for the 33 and 34 token example, pause durations and token-source requirements.",
    "A companion analysis on stale storage writes is listed but not used in prose.",
    "Section 2.4 rechecked 2026-10-23: the delay follows loss of a holder, not ordinary release; the historical cap does not bound delayed I/O."
  ]
}
