{"record":{"id":"04d331e034713a70","repo":"microsoft/FASTER","slug":"uninitialized-page-found-during-scan-at-page-page","errorCode":null,"errorMessage":"Uninitialized page found during scan at page {page}","messagePattern":"Uninitialized page found during scan at page (.+?)","errorType":"exception","errorClass":"FasterException","httpStatus":null,"severity":"error","filePath":"cs/src/core/FasterLog/FasterLogIterator.cs","lineNumber":825,"sourceCode":"                {\n                    physicalAddress = allocator.GetPhysicalAddress(currentAddress);\n                }\n\n                // Get and check entry length\n                entryLength = fasterLog.GetLength((byte*)physicalAddress);\n\n                // We may encounter zeroed out bits at the end of page in a normal log, therefore, we need to check whether that is the case\n                if (entryLength == 0)\n                {\n                    // Zero-ed out bytes could be padding at the end of page, first jump to the start of next page. \n                    var  nextStart = (1 + (currentAddress >> allocator.LogPageSizeBits)) << allocator.LogPageSizeBits;\n                    if (Utility.MonotonicUpdate(ref nextAddress, nextStart, out _))\n                    {\n                        var pageOffset = currentAddress & ((1 << allocator.LogPageSizeBits) - 1);\n\n                        // If zeroed out field is at page start, we encountered an uninitialized page and should signal up\n                        if (pageOffset == 0)\n                            throw new FasterException(\"Uninitialized page found during scan at page \" + (currentAddress >> allocator.LogPageSizeBits));\n                    }\n                    continue;\n                }\n\n                // commit records have negative length fields\n                if (entryLength < 0)\n                {\n                    commitRecord = true;\n                    entryLength = -entryLength;\n                }\n\n                int recordSize = headerSize + Align(entryLength);\n                if (_currentOffset + recordSize > allocator.PageSize)\n                {\n                    currentAddress += headerSize;\n                    if (Utility.MonotonicUpdate(ref nextAddress, currentAddress, out _))\n                        throw new FasterException(\"Invalid length of record found: \" + entryLength + \" at address \" + currentAddress);\n                    continue;","sourceCodeStart":807,"sourceCodeEnd":843,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cs/src/core/FasterLog/FasterLogIterator.cs#L807-L843","documentation":"During GetNextInternal scanning, the iterator reached a page whose start is zeroed out — no valid record header — meaning the page was never initialized/committed (FasterLogIterator.cs:825). This surfaces corrupt or unwritten storage during recovery/tail scan rather than silently skipping data.","triggerScenarios":"Scanning into a page region beyond what was durably committed (e.g., iterating past the confirmed tail after a crash), damaged/truncated device backing store, or misconfigured log directory where the iterator head/tail metadata disagrees with on-disk pages.","commonSituations":"Crash mid-write leaving a partially flushed page; restoring a checkpoint without all log files; disk/data loss in the log directory; reading a replicated log while replication is incomplete.","solutions":["Restrict the scan to the log's committed range (use SafeTailAddress/CommittedUntilAddress as the scan end).","Verify the log directory contents match the checkpoint (all device files present, not truncated).","Recover from an earlier checkpoint if on-disk pages are damaged; investigate storage/device health.","If using replication, ensure the replica has caught up before iterating past the local committed tail."],"exampleFix":"// before\nusing var iter = log.Scan(beginAddress, long.MaxValue);\n\n// after\nusing var iter = log.Scan(beginAddress, log.CommittedUntilAddress);","handlingStrategy":"validation","validationCode":"if (endAddress > log.CommittedUntilAddress) endAddress = log.CommittedUntilAddress; // never scan past committed tail","typeGuard":null,"tryCatchPattern":"try { while (iter.GetNext(out var e, out var a)) Process(e, a); } catch (FasterException ex) when (ex.Message.StartsWith(\"Uninitialized page found\")) { /* stop scan; verify checkpoint/storage */ }","preventionTips":["Bound scans by CommittedUntilAddress/SafeTailAddress","Keep log directory and checkpoint backups in sync","Monitor storage health"],"tags":["fasterlog","iterator","corruption","recovery"],"backgroundTag":"checksum-mismatch","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}