{"record":{"id":"55be89b36618d46c","repo":"microsoft/FASTER","slug":"insufficient-page-size-to-write-delta","errorCode":null,"errorMessage":"Insufficient page size to write delta","messagePattern":"Insufficient page size to write delta","errorType":"exception","errorClass":"FasterException","httpStatus":null,"severity":"error","filePath":"cs/src/core/Allocator/AllocatorBase.cs","lineNumber":521,"sourceCode":"                        {\n                            ref var info = ref GetInfo(physicalAddress);\n                            var (recordSize, alignedRecordSize) = GetRecordSize(physicalAddress);\n                            if (info.Dirty)\n                            {\n                                info.ClearDirtyAtomic(); // there may be read locks being taken, hence atomic\n                                int size = sizeof(long) + sizeof(int) + alignedRecordSize;\n                                if (destOffset + size > entryLength)\n                                {\n                                    deltaLog.Seal(destOffset);\n                                    deltaLog.Allocate(out entryLength, out destPhysicalAddress);\n                                    destOffset = 0;\n                                    if (destOffset + size > entryLength)\n                                    {\n                                        deltaLog.Seal(0);\n                                        deltaLog.Allocate(out entryLength, out destPhysicalAddress);\n                                    }\n                                    if (destOffset + size > entryLength)\n                                        throw new FasterException(\"Insufficient page size to write delta\");\n                                }\n                                *(long*)(destPhysicalAddress + destOffset) = logicalAddress;\n                                destOffset += sizeof(long);\n                                *(int*)(destPhysicalAddress + destOffset) = alignedRecordSize;\n                                destOffset += sizeof(int);\n                                Buffer.MemoryCopy((void*)physicalAddress, (void*)(destPhysicalAddress + destOffset), alignedRecordSize, alignedRecordSize);\n                                destOffset += alignedRecordSize;\n                            }\n                            physicalAddress += alignedRecordSize;\n                            logicalAddress += alignedRecordSize;\n                        }\n                        epoch.ProtectAndDrain();\n                    }\n                }\n                finally\n                {\n                    if (epochTaken)\n                        epoch.Suspend();","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cs/src/core/Allocator/AllocatorBase.cs#L503-L539","documentation":"During delta-log based recovery/write of page deltas, FASTER copies records into a delta log entry sized from the page size. After an Allocate still can't fit the record (destOffset + size > entryLength even after sealing and re-allocating), it throws \"Insufficient page size to write delta\" — the configured page size is too small for the delta entries being produced.","triggerScenarios":"Performing operations whose deltas (logicalAddress + alignedRecordSize + record bytes) exceed the available delta entry capacity derived from the log's page size — i.e. very large values/records relative to PageSize, or Update operations producing oversized deltas.","commonSituations":"Configuring a small hybrid log page size (e.g. 1KB) while storing values of comparable size; workloads with large RMW payloads where delta logs fill a whole page; tuning PageSize down to save memory without checking max record size.","solutions":["Increase the hybrid log PageSize (must remain a power of 2 and >= max record size with delta overhead).","Reduce record/value sizes so deltas fit comfortably within the page size.","Adjust the workload to use Read/Write instead of large Read-Modify-Write deltas where possible."],"exampleFix":"// before\nnew LogSettings { PageSizeBits = 10 } // 1KB pages, too small for big deltas\n// after\nnew LogSettings { PageSizeBits = 14 } // 16KB pages accommodate deltas","handlingStrategy":"validation","validationCode":"// ensure page size comfortably exceeds max record size\nclass MaxRecord { public byte[] Data; }\nif (maxRecordSizeBytes * 2 > (1 << logSettings.PageSizeBits))\n    throw new ArgumentException(\"Increase PageSizeBits: max record + delta overhead exceeds page size\");","typeGuard":null,"tryCatchPattern":"try { session.RMW(key, input, output); } catch (FasterException) { /* raise PageSizeBits and reopen store */ }","preventionTips":["Size PageSizeBits at least ~2x the largest record you store.","Re-validate page size whenever record schemas grow."],"tags":["csharp","faster","hybrid-log","page-size","config"],"backgroundTag":"invalid-config-value","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}