[DOCS-9823] Document maxTimeMS option for all CRUD commands Created: 25/Jan/17  Updated: 20/Jul/23  Resolved: 18/Jul/23

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v20170516

Type: Task Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Cory Bullinger
Resolution: Done Votes: 1
Labels: reopened, server-docs-bug-bash, triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates DOCS-10181 I thought count command supports maxT... Closed
is duplicated by DOCS-14789 [SERVER] Add maxTimeMS for cluster wr... Closed
Related
related to DOCS-10329 Inaccurate documentation for getMore ... Closed
related to DRIVERS-797 Support maxTimeMS for write operations Closed
related to DRIVERS-2071 Discuss maxTimeMS option for listColl... Backlog
is related to SERVER-27711 createIndexes command incorrectly rej... Closed
is related to SERVER-2212 Server automatically abort queries/co... Closed
is related to DOCS-9822 Document writeConcern option for all ... Closed
Participants:
Days since reply: 29 weeks, 5 days ago

 Description   

SERVER-2212 introduced the maxTimeMS option for commands and queries.

AFAIK, the option is only discussed in Terminate Running Operations. It would be helpful if the option appeared alongside other command options. For instance, it does show up in the find command docs, but is absent from aggregate.

We should check with the server team for a list of all commands where a maxTimeMS option is supported. As shown by SERVER-27711, support for this option is easy to overlook.



 Comments   
Comment by David Storch [ 14/Jul/23 ]

Adjusted the title, since I think we've narrowed the scope of this ticket to be just about documenting maxTimeMS for the CRUD commands:

  • aggregate
  • count
  • find
  • findAndModify
  • delete
  • insert
  • mapReduce

There should be followup work to document maxTimeMS for all of the remaining commands that support this option. cc cory.bullinger@mongodb.com

Comment by Sarah Olson [ 01/Nov/22 ]

Thanks jmikola@mongodb.com. Appreciate the additional details!

Comment by Jeremy Mikola [ 01/Nov/22 ]

I think this is still relevant. The option appears in docs for some commands but not others.

For example, aggregate lists maxTimeMS but update does not.

Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Comment by Ravind Kumar (Inactive) [ 17/Jan/20 ]

The commit for this work seems to have vanished into time and space, so the work needs to be redone. Unfortunately the patch wont apply cleanly as we've removed apiargs from the manual, so this needs a lot of manual handiwork. Adding back to queue for scheduling.

Comment by Ravind Kumar (Inactive) [ 06/Jul/17 ]

RFM pending final pass

Comment by David Storch [ 25/Jan/17 ]

ravind.kumar, maxTimeMS is handled generically for all commands in the command preprocessing layer:

https://github.com/mongodb/mongo/blob/r3.5.1/src/mongo/db/commands/dbcommands.cpp#L1393-L1406

This makes it a little bit hard to enumerate all of the commands which support maxTimeMS. At the very least, it should support the the main CRUD execution commands:

  • aggregate
  • count
  • delete
  • find
  • findAndModify
  • geoNear
  • group (deprecated)
  • insert
  • mapReduce
  • update

Other administration commands, like those related to index builds and management or sharding-related administration commands should also support maxTimeMS. Again, the design of maxTimeMS was for it to be supported in a generic way for all commands. It might make sense for the docs pages to also broadly mention that most commands accept a maxTimeMS parameter, with some additional documentation for common use cases (e.g. setting a maxTimeMS on a find or aggregate cursor).

Comment by Ravind Kumar (Inactive) [ 25/Jan/17 ]

ToDo:

Check with SERVER team for list of options supporting maxTimeMS - david.storch can you advise?

Use existing copy of https://docs.mongodb.com/manual/reference/command/find/

Some of the commands may not following the format of listing parameters (see the insert command). This is a good opportunity to resolve that as a part of this ticket.

Priority is getting list of options. Ticket cannot be properly estimated without that list.

Generated at Thu Feb 08 07:59:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.