In a sharded collection, upserts resulting from a save() have different behaviors depending on the shape of the shard key. When the shard key is a simple key or a compound key composed of top-level fields, behavior is consistent with 2.4.10, i.e. upserts are targeted. However, with a compound shard key composed of fields from an embedded document, the upserts are broadcast to all shards.
In the insert case of upsert, the broadcast upsert inserts a document on all shards. In the update case of upsert, the broadcast upsert updates the document on the chunk-owning shard and generates a duplicate key error on all remaining shards.
Chunks must be distributed across multiple shards to observe the effect.