[SERVER-15406] Report write concern progress in currentOp Created: 25/Sep/14  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Admin, Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Backlog - Replication Team
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Replication
Participants:

 Description   

We only report that an op is "waiting for write concern" but not its progress. We should update the message as we wait to provide progress on steps completed and pending.

Example op wait for w:2 on a 1 node repica set:

 {
...			"opid" : 22,
			"active" : true,
			"secs_running" : 9,
			"op" : "query",
			"ns" : "", 
			"query" : {
				"insert" : "a",
				"documents" : [{"_id" : "ts1",}],
				"ordered" : true,
				"writeConcern" : {"w" : 2}
			},
			"msg" : "waiting for write concern",
			"lockStats" : {
				"timeLockedMicros" : {
					"r" : NumberLong(0),
					"w" : NumberLong(9)
				},
				"timeAcquiringMicros" : {
					"r" : NumberLong(0),
					"w" : NumberLong(0)
				}}}]}

Currently we set the status here:

src/mongo//db/commands/get_last_error.cpp:236:            txn->setMessage( "waiting for write concern" );
src/mongo//db/commands/write_commands/batch_executor.cpp:270:            _txn->getCurOp()->setMessage( "waiting for write concern" );



 Comments   
Comment by Scott Hernandez (Inactive) [ 08/Mar/16 ]

I was thinking local, but we can fill that out as needed and with what info we have.

The idea is that we can account for all write concern options, including replication – see even if "w" is not specified we can still see things waiting for local resources (the message kinda covers this now I think).

Comment by Eric Milkie [ 08/Mar/16 ]

That's a good start, although I'm not sure what "journal" means. Local, or across the cluster?

Comment by Scott Hernandez (Inactive) [ 08/Mar/16 ]

I'm open to any form of progress, but was thinking of something like this:

, WriteConcernStatus:{
   journal: pending/complete,
   acknowledgedMembers: {"host1":OpTime, "host2":"OpTime},
   timeWaitingMS: XXX,
...
}

Comment by Eric Milkie [ 08/Mar/16 ]

What kind of progress can we report; would you put the actual write concern being waited for, or the number of nodes remaining that haven't responded yet, or some other thing?

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