{"record":{"id":"42d2493eed3ba5d3","repo":"prestodb/presto","slug":"storage-error-42d249","errorCode":"STORAGE_ERROR","errorMessage":"Disk page checksum does not match. Data seems to be corrupted on disk for file ","messagePattern":"Disk page checksum does not match\\. Data seems to be corrupted on disk for file ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"critical","filePath":"presto-spark-base/src/main/java/com/facebook/presto/spark/execution/PrestoSparkDiskPageInput.java","lineNumber":170,"sourceCode":"                checksum.reset();\n                PrestoSparkStorageHandle prestoSparkStorageHandle = (PrestoSparkStorageHandle) taskFileInfo;\n                TempStorageHandle tempStorageHandle = tempStorage.deserialize(prestoSparkStorageHandle.getSerializedStorageHandle());\n                log.info(\"Reading path: \" + tempStorageHandle.toString());\n                try (InputStream inputStream = tempStorage.open(tempDataOperationContext, tempStorageHandle);\n                        InputStreamSliceInput inputStreamSliceInput = new InputStreamSliceInput(inputStream)) {\n                    Iterator<SerializedPage> pagesIterator = readSerializedPages(inputStreamSliceInput);\n                    while (pagesIterator.hasNext()) {\n                        SerializedPage serializedPage = pagesIterator.next();\n                        checksum.update(serializedPage.getSlice().byteArray(), serializedPage.getSlice().byteArrayOffset(), serializedPage.getSlice().length());\n                        Page deserializedPage = pagesSerde.deserialize(serializedPage);\n                        pages.add(deserializedPage);\n                        stagingBroadcastTableSizeInBytes += deserializedPage.getRetainedSizeInBytes();\n                    }\n                    updateMemory.update();\n                }\n\n                if (checksum.getValue() != prestoSparkStorageHandle.getChecksum()) {\n                    throw new PrestoException(STORAGE_ERROR, \"Disk page checksum does not match. \" +\n                            \"Data seems to be corrupted on disk for file \" + tempStorageHandle.toString());\n                }\n            }\n            return pages.build();\n        }\n        catch (UncheckedIOException | IOException e) {\n            throw new PrestoException(STORAGE_ERROR, \"Unable to read data from disk: \", e);\n        }\n    }\n\n    public long getRetainedSizeInBytes()\n    {\n        return prestoSparkBroadcastTableCacheManager.getBroadcastTableSizeInBytes(stageId, planNodeId);\n    }\n\n    public long getStagingBroadcastTableSizeInBytes()\n    {\n        return stagingBroadcastTableSizeInBytes;","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spark-base/src/main/java/com/facebook/presto/spark/execution/PrestoSparkDiskPageInput.java#L152-L188","documentation":"Thrown from PrestoSparkDiskPageInput.loadBroadcastTable() when the checksum computed after deserializing a broadcast table page from temp storage does not match the checksum recorded in the PrestoSparkStorageHandle. This means the spilled file's bytes changed between write and read — data corruption on the storage layer.","triggerScenarios":"getPages() -> loadBroadcastTable() reads a broadcast spill file, computes a checksum, and compares it against prestoSparkStorageHandle.getChecksum(); any mismatch throws immediately.","commonSituations":"Bit rot or truncated files on disk/HDFS/S3; external modification of temp storage files; faulty disks or network corruption during remote read; files overwritten by a colliding temp path.","solutions":["Re-run the query — the spill file may need regeneration","Investigate the underlying temp storage health (disk SMART, HDFS/S3 integrity) for the specific file in the message","Ensure nothing external reads/writes or cleans the temp storage directory while queries run","Verify checksums/stability of the storage backend and consider a different storage medium"],"exampleFix":"// no caller-side fix; diagnose via the storage handle in the message\n// check the file at the temp storage location referenced by tempStorageHandle\n// before retrying: clear stale broadcast spill files for the stage\n// then re-run the affected query","handlingStrategy":"retry","validationCode":"// pre-flight storage integrity check\nChecksum c = computeChecksum(tempStorage.get(ctx, handle));\nif (c.getValue() != prestoSparkStorageHandle.getChecksum()) {\n    throw new IllegalStateException(\"spill file corrupted before read: \" + handle);\n}","typeGuard":"null","tryCatchPattern":"try {\n    return diskPageInput.getPages();\n}\ncatch (PrestoException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"checksum does not match\")) {\n        // do NOT retry blindly: corruption is deterministic; invalidate spill data and re-broadcast\n        throw new IllegalStateException(\"re-run query to regenerate broadcast spill\", e);\n    }\n    throw e;\n}","preventionTips":["Monitor storage media health (disk errors, ECC, S3/HDFS integrity reports)","Never let external processes modify temp storage files","Use storage backends with end-to-end integrity verification","Treat a checksum error as deterministic corruption: regenerate data, don't loop retries"],"tags":["data-corruption","checksum","temp-storage","broadcast-join","spark"],"backgroundTag":"data-corruption-on-disk","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}