{"record":{"id":"e24e156e0d985ff3","repo":"prestodb/presto","slug":"invalid-dwrf-stripe-cache-length-s","errorCode":null,"errorMessage":"Invalid DWRF stripe cache length %s","messagePattern":"Invalid DWRF stripe cache length (.+?)","errorType":"exception","errorClass":"OrcCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/cache/StorageOrcFileTailSource.java","lineNumber":221,"sourceCode":"\n    /**\n     * ORC metadata and DWRF stripe cache sizes are mutually exclusive because\n     * only ORC files have metadata, and only DWRF files have stripe cache.\n     * <p>\n     * Let's check that either both sizes are 0, or only one of them is\n     * greater than 0.\n     */\n    private static void checkSizes(OrcDataSource orcDataSource, int metadataSize, int dwrfStripeCacheSize)\n    {\n        if (metadataSize > 0 && dwrfStripeCacheSize > 0) {\n            throw new OrcCorruptionException(orcDataSource.getId(),\n                    \"Invalid ORC metadata %s or DWRF stripe cache size %s\",\n                    metadataSize,\n                    dwrfStripeCacheSize);\n        }\n\n        if (dwrfStripeCacheSize < 0) {\n            throw new OrcCorruptionException(orcDataSource.getId(), \"Invalid DWRF stripe cache length %s\", dwrfStripeCacheSize);\n        }\n    }\n}\n","sourceCodeStart":203,"sourceCodeEnd":225,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/cache/StorageOrcFileTailSource.java#L203-L225","documentation":"ORC tail-source sanity check: the DWRF stripe cache length read from the file's postscript is implausible (negative or exceeding the stripe size). A corruption sentinel for DWRF files — the postscript values for stripe cache are inconsistent with the file layout.","triggerScenarios":"getOrcFileTail parses a postscript where dwrfStripeCacheLength is negative (e.g. large unsigned value decoded as negative toIntExact result, or corrupt bytes).","commonSituations":"Corruption in the last bytes of the file, or a writer version emitting incompatible postscript fields.","solutions":["Restore or regenerate the file; tail corruption is not fixable in place.","Verify with a metadata dump tool what dwrfStripeCacheLength the postscript encodes.","Check the writer version compatibility (DWRF feature flags) of the producing job.","Enable end-to-end checksums on the storage layer to catch corruption early."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { tail = source.getOrcFileTail(ds, reader, validation, false, time); }\ncatch (OrcCorruptionException e) { reportWriterInconsistency(ds.getId(), e); }","preventionTips":["Pin DWRF writer versions in producing pipelines","Check postscript integrity before long-term archival","Enable end-to-end checksums"],"tags":["orc","dwrf","stripe-cache","corrupt-file"],"backgroundTag":"orc-file-corruption","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"}