Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
None
-
Fully Compatible
Description
Most (all?) GridFS drivers offer some sort of validation where they compare the driver's computed MD5 with the MD5 returned by the filemd5 mongodb command. I've found that sometimes this validation can report a md5 mismatch (indicating corrupt contents) if done immediately after the write operation without ACKNOWLEDGED write concern or higher.
I understand that this is in a sense due to the nature of what the write concern means, however I think an MD5 mismatch is a vague / misleading type of exception to throw in this case. Is there any way to indicate to the application / user that the reason the MD5 does not match due to the write being incomplete?
Why is it possible to call filemd5 before writes are complete since it doesn't really mean anything useful?
I also understand that the default write concern under the 3+ drivers won't encounter this issue, but perhaps there is something that can be done to improve the error reporting here?
See my original question and answer in this stackoverflow:
http://stackoverflow.com/questions/29101248/what-causes-a-mongodb-gridfs-md5-hash-mismatch/
I wasn't sure whether to file this as a core bug (being able to call filemd5 commands on incomplete data and receive a seemingly valid response) or a driver improvement for throwing more meaningful exceptions in this case. I think a reasonable solution could also be to just provide documentation on this (either for the server or drivers, or both).