-
Bug
-
Resolution: Done
-
Major
-
5.3.0.Final
-
None
When a MongoDB replicaset is used as binary storage than data can get corrupted when the replicaset changes the primary node. The corruption is caused in the org.modeshape.jcr.value.binary.MongodbBinaryStore file in the ChunkInputStream and ChunkOutputStream classes. The OutputStream creates small chunks from the bigger binary files. These chunks are stored and than read without any given sorting. If you don't give a sort than the order of the returned chunks is undefined. In my tests this was working for the primary node since MongoDB returned the chunks in the way they where written. However when we switched the primary node the former secondary returned the chunks in a different order and the files get corrupted.