> Gridfs stores the metadata in fs.files and the binary data in
> fs.chunks.
> How does atomicity work in this case ?
It doesn't. This is a file store, not a file system.
> 1. So is it possible that in 'kill -9' or similar unclean shutdown,
> only the fs.files is updated and not fs.chunks or vice-versa ? Also is
> it possible not all the fs.chunks related to a single binary object
> are written ?
That's certainly possible. Chunks are written first, followed by the
file object.
> 2. Incase of replica-sets, is it not possible that some binary objects
> can get corrupted then. Scenario : one of fs.chunks document or the
> fs.files document did not make to majority of server before the
> primary crashed. When the original primary comes up again as a
> secondary, those documents are rolled-back (to sync with the current
> primary). Now you have a case of some binaries being corrupted for
> ever, right ?
Yes, this is certainly possible.
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>