cypherean commented on issue #19576: URL: https://github.com/apache/pinot/issues/19576#issuecomment-7307654334
Update on root cause: The corruption is in the page cache, not on disk. The earlier storage-layer fault hypothesis in the description is ruled out. ### Evidence - The original byte-diff read the local replica through buffered I/O, so it compared the page cache. Disk was never compared. - On two affected segments, a buffered read of `columns.psf` and an `O_DIRECT` read of the same file give different SHA-256 hashes. Both hashes are stable across repeats. - A fresh read-only `MAP_SHARED` mapping in another process matches the buffered bytes. The bad bytes are in the shared page cache. - The `O_DIRECT` read is correct. In each bad 128 KiB window, the cache holds one 4 KiB page repeated 32 times. Disk holds 32 distinct pages. - Both bad windows are in the `start_time` range index. - The affected hosts ran Linux 6.15 to 6.18.44. ### Likely cause A kernel bug in `__filemap_add_folio()`. Under cgroup memory pressure, a failed xarray node allocation during a folio split can leave stale index state. A retry can then store one order-0 folio across 32 sibling slots. - Fix: [`86da3f7e1e60`](https://git.kernel.org/linus/86da3f7e1e60), in 6.18.45. - Tracked as [CVE-2026-74591](https://nvd.nist.gov/vuln/detail/CVE-2026-74591). ### What this means for Pinot - fsync and msync would not catch this. Disk was correct, and the bad page was a clean read-side page. - Pinot v3 has no integrity check on `columns.psf` at read time. The range index fails loudly because RoaringBitmap throws `Unknown type N`. The same corruption in a forward index returns wrong values silently. - The bad cache page persists while the JVM keeps the file mapped. Reloading releases the mapping. ### Suggested direction - Keep #19577 and #20263 as separate crash-safety hardening. They do not fix this issue. - For detection, compare buffered reads against `O_DIRECT` reads, or add a per-buffer checksum over `columns.psf` that is verified on first touch. - A commit-time or download-time check will not catch this. The cache went bad later, during query-time reads. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
