{"record":{"id":"30958e6d15de4664","repo":"nats-io/nats-server","slug":"partial-cache-offset-slot-index-d-is-greater-tha","errorCode":null,"errorMessage":"Partial cache: offset slot index %d is greater than index len %d","messagePattern":"Partial cache: offset slot index (.+?) is greater than index len (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/filestore.go","lineNumber":6615,"sourceCode":"\tif wasLoaded {\n\t\tif err := mb.loadMsgsWithLock(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Grab info from a slot.\n// Lock should be held.\nfunc (mb *msgBlock) slotInfo(slot int) (uint32, uint32, bool, error) {\n\tswitch {\n\tcase mb.cache == nil: // Shouldn't be possible, but check it anyway.\n\t\treturn 0, 0, false, errNoCache\n\tcase slot < 0:\n\t\tmb.fs.warn(\"Partial cache: offset slot index %d is less zero\", slot)\n\t\treturn 0, 0, false, errPartialCache\n\tcase slot >= len(mb.cache.idx):\n\t\tmb.fs.warn(\"Partial cache: offset slot index %d is greater than index len %d\", slot, len(mb.cache.idx))\n\t\treturn 0, 0, false, errPartialCache\n\t}\n\n\tbi := mb.cache.idx[slot]\n\tri, hashChecked := (bi &^ cbit), (bi&cbit) != 0\n\n\t// If this is a deleted slot return here.\n\tif bi == dbit {\n\t\treturn 0, 0, false, errDeletedMsg\n\t}\n\n\t// Determine record length\n\tvar rl uint32\n\t// Need to account for dbit markers in idx.\n\t// So we will walk until we find valid idx slot to calculate rl.\n\tfor i := 1; slot+i < len(mb.cache.idx); i++ {\n\t\tni := mb.cache.idx[slot+i] &^ cbit\n\t\tif ni == dbit {","sourceCodeStart":6597,"sourceCodeEnd":6633,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/filestore.go#L6597-L6633","documentation":"A warning logged by msgBlock.slotInfo() when the requested slot index is beyond the partial cache's index length. The sequence maps to a slot outside the currently cached range, so the lookup cannot be served and errPartialCache is returned, prompting the caller to fall back to loading the full block.","triggerScenarios":"Thrown at server/filestore.go:6615 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No operator action usually needed: the caller falls back to loading the block from disk","If frequent, tune cache limits/expiry so the relevant block stays cached","Check for concurrent cache eviction racing lookups"],"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-08T15:18:49.778Z"}