{
  "slug": "clay-code",
  "term": "CLAY code",
  "aliases": [
    "coupled-layer code",
    "Clay codes"
  ],
  "definition": "A CLAY code is a vector MDS erasure code that couples layers of scalar codes to support exact repair with partial-fragment reads.",
  "note": "The construction separates recoverability from its efficient repair path. When d is below n-1, the selected helpers must include the surviving nodes in the failed node's construction group; arbitrary d survivors need not support that path. This is a coding group, not a rack-placement rule. [clay]\n\nFor n=k+m and q=d-k+1, Ceph v18.2.7 pads the construction to the next multiple of q, then omits the added zero-valued data nodes. The sub-chunk count is q^ceil(n/q). With k=10, m=4 and d=13, two virtual nodes give 256 sub-chunks, not 4^3.5=128. The real layout still stores 14 fragments for 10 data fragments. [ceph-clay-source]\n\nThe single-loss helper-byte budget dS/q assumes S bytes per lost fragment and an eligible repair path. It excludes forwarding the rebuilt fragment. Separate logical helper bytes, network transfers and physical reads. [clay]\n\nCeph's development manual marks the plugin deprecated since Umbrella, with removal planned for Vampire. That release policy is separate from the code's mathematical properties. [ceph-clay-manual]",
  "status": "limited",
  "advantages": [],
  "limitations": [
    {
      "text": "Sub-chunk alignment, helper availability and the implementation's repair path can prevent theoretical byte savings from becoming faster recovery.",
      "citationIds": [
        "clay"
      ]
    }
  ],
  "related": [
    "minimum-storage-regenerating-code",
    "subpacketization",
    "maximum-distance-separable-code",
    "repair-locality",
    "erasure-coding"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "clay",
      "title": "Vajha et al. Clay Codes: Moulding MDS Codes to Yield an MSR Code. FAST 2018, sections 3-5 and Appendix A.",
      "url": "https://www.usenix.org/system/files/conference/fast18/fast18-vajha.pdf",
      "accessed": "2026-11-22"
    },
    {
      "id": "ceph-clay-source",
      "title": "Ceph v18.2.7: ErasureCodeClay::parse, shortening and sub-chunk count.",
      "url": "https://github.com/ceph/ceph/blob/v18.2.7/src/erasure-code/clay/ErasureCodeClay.cc",
      "accessed": "2026-11-22"
    },
    {
      "id": "ceph-clay-manual",
      "title": "Ceph development documentation: CLAY plugin lifecycle and profile guidance; accessed 2026-11-22.",
      "url": "https://docs.ceph.com/en/latest/rados/operations/erasure-code-clay/",
      "accessed": "2026-11-22"
    },
    {
      "id": "hesela-accounting",
      "title": "Hesela: CLAY shortening examples and repair accounting",
      "url": "https://hesela.com/analyses/lrc-repair-costs-locality/#clay-shortening",
      "accessed": "2026-11-22"
    }
  ],
  "updated": "2026-11-22",
  "provenance": [
    "Primary-source synthesis of FAST 2018 sections 3-5 and Appendix A; Ceph v18.2.7 parse and repair-selection source inspected. No codec or cluster benchmark was executed.",
    "Shortening and byte arithmetic are reproduced by /research/clay-shortening.mjs and its tests; the parameter helper is not a Ceph profile validator."
  ]
}
