{"record":{"id":"905eb2ee12539a51","repo":"microsoft/FASTER","slug":"entry-does-not-fit-on-page-fasterlog","errorCode":null,"errorMessage":"Entry does not fit on page","messagePattern":"Entry does not fit on page","errorType":"exception","errorClass":"FasterException","httpStatus":null,"severity":"error","filePath":"cs/src/core/FasterLog/FasterLog.cs","lineNumber":2880,"sourceCode":"        {\n            // commit record has negative length field to differentiate from normal records\n            if (logChecksum == LogChecksumType.None)\n            {\n                *(int*)dest = -length;\n                return;\n            }\n            else if (logChecksum == LogChecksumType.PerEntry)\n            {\n                *(int*)(dest + 8) = -length;\n                *(ulong*)dest = Utility.XorBytes(dest + 8, length + 4);\n            }\n        }\n\n        [MethodImpl(MethodImplOptions.AggressiveInlining)]\n        private void ValidateAllocatedLength(int numSlots)\n        {\n            if (numSlots > allocator.PageSize)\n                throw new FasterException(\"Entry does not fit on page\");\n        }\n    }\n}\n","sourceCodeStart":2862,"sourceCodeEnd":2884,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cs/src/core/FasterLog/FasterLog.cs#L2862-L2884","documentation":"Append was called with a record whose serialized size requires more slots than fit on a single log page. FasterLog never splits a record across pages, so ValidateAllocatedLength (FasterLog.cs:2880) rejects any allocation exceeding the allocator page size.","triggerScenarios":"Enqueue/Append of a byte[]/IMemoryOwner payload whose length (plus record header and alignment) exceeds the log's page size (default 64 MB when unspecified but small when PageSize is configured explicitly).","commonSituations":"Configuring a small page size for testing and then writing production-sized payloads; appending images/blobs bigger than one page; forgetting that the limit applies to the serialized record, not the logical object.","solutions":["Increase FasterLogOptions.PageSize so it exceeds the maximum record size you append.","Split large payloads into multiple records or store large blobs externally and append a reference.","Validate payload size against page size before Enqueue and reject/split oversize records early.","Use the tryAppend pattern (TryEnqueue) to fail gracefully and log oversize payloads."],"exampleFix":"// before\nlog.Append(bigBuffer); // may exceed page\n\n// after\nif (bigBuffer.Length > options.PageSize - Unsafe.SizeOf<FasterLogHeader>())\n    throw new ArgumentException(\"Record larger than log page; use chunking\");\nlog.Append(bigBuffer);","handlingStrategy":"validation","validationCode":"const int HeaderOverhead = 20; // approximate serialized header size\nif (payload.Length + HeaderOverhead > options.PageSize)\n    throw new ArgumentException($\"Record of {payload.Length} bytes exceeds log page size {options.PageSize}\");","typeGuard":null,"tryCatchPattern":"try { log.Append(payload); } catch (FasterException ex) when (ex.Message == \"Entry does not fit on page\") { ChunkAndAppend(payload); }","preventionTips":["Size pages for the largest possible record","Chunk large payloads by design","Validate record size at the API boundary"],"tags":["fasterlog","append","page-size","argument"],"backgroundTag":"value-out-of-range","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}