Repository navigation
Closed
Copy link
Description
Grouped low-severity findings in the storage/WAL layer:
- WALFile.readLong/readInt (
WALFile.java:442-452) use shared instancebufferLong/bufferIntwith no sync and no short-read loop; a partialchannel.readyields stale garbage. Loop until full or use per-call stack buffers. - WALFile.append (
:454-457) issues a singlechannel.writewith nohasRemaining()loop; a partial write leaves a torn record that theWALFile.getTransactionreturns null on partial record, recovery abandons rest of WAL #4508 gap detector then flags as corruption.PaginatedComponentFileloops correctly - add a sharedwriteFully/readFullyhelper. - TransactionManager.getStats (
:354-369) adds each active WAL files cumulative counters into the stats accumulators on every call (double-counted at retirement), inflating numbers with polling frequency; also NPEs whenactiveWALFilePool==null` (read-only DBs). - activeWALFilePool array (
TransactionManager.java:55,190,769) elements written by the timer thread and read by committers with no volatile/fence; a JMM-stale element can stall a committer up toWRITE_WAL_TIMEOUT. UseAtomicReferenceArray/VarHandle. - PageManager.getCachedPage (
:567-592) returns beforecacheMiss.incrementAndGet(), so cache-miss stats are ~always zero (hit/miss ratio meaningless). - WALFile segment (
:200-226)deltaSizefrom the page header is unvalidated vs remaining file size; a corrupt header can trigger a transient ~2GB allocation during recovery. Clamp togetSize()-pos. - Preserved corrupt WAL on next open (
:331-346,:747-758)createWALFilePoolresetslogFileCounterto 0 and opens the preservedtxlog_0.walwithout truncation;appendwrites after corrupt content and old records replay again. Rename preserved files to.wal.corruptor seed the counter past existing files. - suspendFlushAndExecute (
:142-152) silently skips the callback when already suspended (nested backup/snapshot);waitAllPagesOfDatabaseAreFlushedloops forever if invoked while suspended. - LocalBucket stats (
:1160,2038,2052)changesFromLastStats/timeOfLastStatsmutated outside the monitor (lost increments delay stats);gatherPageStatisticscomputes free space vsgetPageSize()instead ofgetMaxContentSize()(overstates by header, validated before use).
Filed from an internal engine deep-audit (2026-07). Low-severity items grouped per subsystem; each checkbox is independently fixable.
Activity
fix(#4960,#4958): restore LSM mutable-pages counter on reload; .wal.c…
review(#5063, round 5): serialize HA snapshot suspend per database, l…
Merge pull request #5063 from ArcadeData/fix/4952-4957-4958-4960-pool…
lvca commentedon Jul 7, 2026
Fixed in #5063 (merged): 7 of 9 checkboxes (WAL read/write loops, delta clamp, .wal.corrupt preservation with REPLACE_EXISTING, pool counter seeding, cache-miss accounting, nested flush-suspend ownership - which also surfaced a real HA snapshot hazard, general follow-up in #5068 - and getStats snapshot reads). The 2 remaining low items are tracked in #5067.
fix(ArcadeData#4952,ArcadeData#4957,ArcadeData#4958,ArcadeData#4960):…
fix(ArcadeData#5068): refcount page-flush suspension so overlapping s…
fix(ArcadeData#5067): low-severity audit residuals (kill() lock symme…
fix(#4952,#4957,#4958,#4960): pool discipline, TS threading, storage/…
fix(#4960,#4958): restore LSM mutable-pages counter on reload; .wal.c…
review(#5063, round 5): serialize HA snapshot suspend per database, l…
fix(#5068): refcount page-flush suspension so overlapping suspenders …
fix(#5067): low-severity audit residuals (kill() lock symmetry, page-…
fix(#7479,#7502): guard createWALFilePool()'s cleanup against a null …