Set shardSize according to the total size if not explicitly specified. Closes #2729