You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix MVV marked-version corruption after interrupted prune
MVV.prune's finally-block safety net used the wrong loop bound
(index < length instead of index < offset + length), so a prune that
exited via an exception - e.g. PersistitInterruptedException while
resolving a commit status under interrupt - left mark bits set in the
live buffer page whenever the MVV sat at a non-zero in-page offset.
The fetch paths (visitAllVersions, fetchVersion, fetchVersionByOffset)
then read the version length signed and with the mark bit included,
driving the scan offset negative and crashing with
ArrayIndexOutOfBoundsException, as seen in
TransactionTest2.transactionsWithInterrupts on Windows JDK 11.
- Make the finally-block unmark loop in MVV.prune mirror the first
pass exactly - same advance, same guard, with the array-end bound
covering the unguarded first iteration - and remove its early break
on zero-length versions (a legal undefined value)
- Tighten the first pass's corruption guard so a misaligned traversal
throws CorruptValueException before it can read or mark outside the
MVV region
- Read version lengths unsigned with the mark bit stripped in
visitAllVersions, fetchVersion and fetchVersionByOffset
- Throw CorruptValueException instead of AIOOBE when a version header
or value extends past the MVV bounds
- Fix storeVersion reading target[0] instead of target[targetOffset]
and exactRequiredLength's loop bound ignoring targetOffset when the
MVV sits at a non-zero offset
- Add deterministic regression tests for marked-version reads and for
the interrupted-prune unmark safety net; make
transactionsWithInterrupts assert no worker died with an unexpected
exception, reporting the first failure, with shared counters reset
in @beforeFixes#286
0 commit comments