[SERVER-15268] Write Commands should return replication information (writtenTo) Created: 16/Sep/14  Updated: 06/Dec/22  Resolved: 23/Nov/16

Status: Closed
Project: Core Server
Component/s: Replication, Sharding, Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-15267 Add more information to writeconcern ... Closed
Related
is related to SERVER-4073 getLastError should return the member... Closed
Assigned Teams:
Sharding
Participants:

 Description   

Much like getLastError (SERVER-4073) the write commands should return back information about the write, even if there is no error.

This information could be made optional based on a flag for the write command like:

> runCommand({write-command:"ns", args:{}, replicationStats:true});
{
	"ok" : 1,
	"n" : 1,
        "replication" : { "writtenTo": {...}, 
                                "lastOp" : Timestamp(1410874677, 2),        
                                "electionId" : ObjectId("54183d104e7e3b1d24ab296a")}
}

Note: lastOp and electionId are already returned in the response at the top.



 Comments   
Comment by Andy Schwerin [ 19/Oct/15 ]

I wonder if milkie effectively did this as part of making waitForReplication wait for the latest optime on write failures? scotthernandez, do you know?

Generated at Thu Feb 08 03:37:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.