mySize made volatile: there is a memory visibility issue in constructor initialization and first readBytes or appendBytes: all other readBytes / appendBytes are guarded with synchronized in PersistentHashMap.
Also mySize is read during force(), start of appendBytes() and dispose() and written at constructor / end of appendBytes
related problem e.g. http://youtrack.jetbrains.com/issue/IDEA-97174
I would be extremely lucky if reordering of first marker record with first data record (IDEA-102694, IDEA-103296, IDEA-97174
http://youtrack.jetbrains.com/_persistent/FilenameIndex_inputs.zip?file=74-112070&v=1&c=true
http://youtrack.jetbrains.com/_persistent/js.index.zip?file=74-112745&v=1&c=true,
http://youtrack.jetbrains.com/_persistent/filetypes.values?file=74-99801&v=0&c=true
) also fixes by this change