{"record":{"id":"470a0032e75bfd75","repo":"nats-io/nats-server","slug":"partial-cache-seq-d-is-less-than-cache-fseq-d","errorCode":null,"errorMessage":"Partial cache: seq %d is less than cache fseq %d","messagePattern":"Partial cache: seq (.+?) is less than cache fseq (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/filestore.go","lineNumber":9130,"sourceCode":"\t\tvar reason string\n\t\tif mb.cache == nil {\n\t\t\treason = \"no cache\"\n\t\t} else if mb.cache.fseq == 0 {\n\t\t\treason = \"fseq is 0\"\n\t\t} else if len(mb.cache.idx) == 0 {\n\t\t\treason = \"no idx present\"\n\t\t} else {\n\t\t\treason = \"cache buf empty\"\n\t\t}\n\t\tmb.fs.warn(\"Cache lookup for sequence %d in block %d detected no cache: %s\", seq, mb.index, reason)\n\t\tif mb.cache != nil {\n\t\t\tmb.tryForceExpireCacheLocked()\n\t\t}\n\t\treturn nil, errNoCache\n\t}\n\t// Check partial cache status.\n\tif seq < mb.cache.fseq {\n\t\tmb.fs.warn(\"Partial cache: seq %d is less than cache fseq %d\", seq, mb.cache.fseq)\n\t\treturn nil, errPartialCache\n\t}\n\n\tbi, _, hashChecked, err := mb.slotInfo(int(seq - mb.cache.fseq))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Update cache activity.\n\tmb.llts = ats.AccessTime()\n\n\tli := int(bi)\n\tif li >= len(mb.cache.buf) {\n\t\tmb.fs.warn(\"Partial cache: slot index %d is less than cache buffer len %d\", li, len(mb.cache.buf))\n\t\treturn nil, errPartialCache\n\t}\n\tbuf := mb.cache.buf[li:]\n","sourceCodeStart":9112,"sourceCodeEnd":9148,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/filestore.go#L9112-L9148","documentation":"A warning logged when a cache lookup requests a sequence below the partial cache's first sequence (cache.fseq). The partial cache only covers sequences from fseq onward, so the request cannot be served from it and errPartialCache is returned; the caller then loads from disk.","triggerScenarios":"Thrown at server/filestore.go:9130 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Typically benign — caller falls back to disk reads for older sequences","If frequent, adjust cache start/expiry policy so needed sequences remain cached","Verify consumers are not repeatedly reading far older sequences (retention policy)"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}