When getlasterror is called with w:3 the number 3 represents the total number of nodes that have the write when getlasterror returns null err.
However, implementation of
SERVER-4073 returns just replicatedTo members, omitting the primary which also has the write.
Aside from it being difficult to later track if application logs have the full writeResult but no information about which node was primary (and also has the write) it also feels unintuitive.
I think it would be less confusing to end user if w:3 returns a structure with writtenTo: [node list] that on success is greater-than or equal the "w" value and on failure or timeout writtenTo.length will be shorter than "w".
Here's an example: