Page deallocation can permanently lose pages
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Akiban Persistit |
Fix Released
|
Medium
|
Peter Beaman |
Bug Description
Persistit r369
When removing records causes deallocation of chain of pages configured in a particular way, a garbage page, and possibly many pages linked to it, may be stranded in a volume. The result is irrecoverable loss of space in the volume file.
This phenomenon was discovered while reviewing code in the com.persistit.
Required pre-conditions:
- the chain of pages being deallocated must contain long records (records stored in long-record chains)
- the volume must have no garbage root page, or the garbage root page must be full so that the attempt to add the new garbage chain will cause overflow.
The mechanism is that the first page of the chain being deallocated is converted to a garbage page and linked to the original garbage page. However, before the linkage is completed, the long record chains in the about-to-be garbage page are themselves deallocated. The calls are nested, and so by the time the original deallocation process continues, the garbage root has changed. This leaves the original garbage root stranded.
For now I am marking this MEDIUM since the likelihood of these conditions converging is fairly low and we have no installations in the field in which this causes evident problems. However, we need to fix this to avoid the possibility of major debris in active volumes.
Related branches
- Akiban Build User: Needs Fixing
- Nathan Williams: Approve
-
Diff: 965 lines (+391/-134)18 files modifiedsrc/main/java/com/persistit/Buffer.java (+43/-11)
src/main/java/com/persistit/BufferPool.java (+41/-29)
src/main/java/com/persistit/CleanupManager.java (+1/-1)
src/main/java/com/persistit/Exchange.java (+3/-1)
src/main/java/com/persistit/IOTaskRunnable.java (+14/-5)
src/main/java/com/persistit/JournalManager.java (+1/-1)
src/main/java/com/persistit/MVV.java (+1/-2)
src/main/java/com/persistit/SessionId.java (+9/-0)
src/main/java/com/persistit/SharedResource.java (+7/-2)
src/main/java/com/persistit/Tree.java (+1/-1)
src/main/java/com/persistit/Value.java (+2/-2)
src/main/java/com/persistit/VolumeStorageV2.java (+1/-2)
src/main/java/com/persistit/VolumeStructure.java (+127/-68)
src/test/java/com/persistit/FastIndexTest.java (+1/-1)
src/test/java/com/persistit/MVCCPruneBufferTest.java (+27/-6)
src/test/java/com/persistit/VolumeStructureTest.java (+104/-0)
src/test/java/com/persistit/stress/unit/Stress2txn.java (+7/-1)
src/test/java/com/persistit/stress/unit/Stress6.java (+1/-1)
Changed in akiban-persistit: | |
assignee: | nobody → Peter Beaman (pbeaman) |
milestone: | none → 3.1.8 |
Changed in akiban-persistit: | |
status: | Confirmed → Fix Committed |
Changed in akiban-persistit: | |
status: | Fix Committed → Fix Released |