When I use safe mode (journaling only) on a batch insert on a sharded cluster, the result comes back as a List of SafeModeResult on the C# driver (I assume it is similar on other drivers too). What does each result in the list mean?
Is it per item in the batch or is it per shard or is it per message sent to the sever?
Is batch insert atomic or not specially on a sharded environment? if not, how can do I know which portion of my batch has failed?
The InsertBatch method in the C# driver does in fact attempt to send all the documents to the server in one message. However, there is a limit to the message length, which is approximately 16MB. So if the batch you provide InsertBatch is very large then InsertBatch might have to break it up into sub-batches in order to not exceed the maximum message length. When that happens you will get a separate SafeModeResult for each sub-batch, but normally you would expect the list of SafeModeResults returned to contain only one SafeModeResult.