[SERVER-4984] make it possible to interrupt operations in mongos Created: 16/Feb/12  Updated: 06/Dec/22  Resolved: 02/Apr/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Daniel Pasette (Inactive) Assignee: Backlog - Query Team (Inactive)
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-7210 Consolidate internal mongos interfaces Closed
Duplicate
is duplicated by SERVER-22827 Weird behaviour of currentOp()/killOp... Closed
Related
related to SERVER-21004 Implement wait objects that support o... Closed
is related to SERVER-4844 can't killop an aggregation operation Closed
is related to SERVER-6496 provide a way to kill a sharded query... Closed
is related to SERVER-18094 currentOp on a mongoS should also sho... Closed
is related to SERVER-32307 Make AsyncResultsMerger kill sequence... Closed
is related to SERVER-33462 Allow killop on a mongos op id Closed
Assigned Teams:
Query
Sprint: Query 2018-01-29
Participants:

 Description   

The aggregation framework pipeline components can run in either mongod or mongos, depending on whether they operate on grouped (or sorted) documents. For SERVER-4844, code was added that would enable interruption of aggregation operations via currentOp/killOp. However, this doesn't work in mongos, because there's no provision for doing that there. Something needs to be created that can be used in the implementation of the InterruptStatusMongos class (in interrupt_status_mongos.cpp).



 Comments   
Comment by David Storch [ 02/Apr/18 ]

Hi all,

This work is completed and will first be available in the 3.7.4 development release, which will evolve into the 4.0 stable release series.

Related ticket SERVER-18094 made it possible to list all sharded operations which are being executed on a particular mongos, using the localOps flag to the $currentOp aggregation metadata source. For example, you can run the following command against mongos in the shell:

mongos> use admin;
mongos> db.aggregate([{$currentOp: {localOps: true}}]);

Furthermore, mongos operation IDs are now killable due to the changes in SERVER-33462. That is, The opid field for each operation is valid for passing to mongos in a killOp command. Doing so will cause the entire sharded query, including sub-ops on each involved shard, to be terminated in a timely fashion. For instance, to kill a particular sharded operation matching <filter>:

mongos> use admin;
mongos> let opToKill = db.aggregate([{$currentOp: {localOps: true}}, {$match: <filter>}]).toArray()[0];
mongos> let opid = opToKill.opid;
mongos> db.killOp(opid)

Finally, 3.7.4 contains related enhancements which will cause sharded queries to quickly clean themselves up on all shards in the case of an error (e.g. SERVER-32307). Due to the enhancements listed above, this ticket can be closed as "Gone Away".

Comment by Ian Boros [ 29/Jan/18 ]

Once the sharded kill project is complete, we should close this (perhaps as "gone away").

Comment by Kaloian Manassiev [ 10/Jan/18 ]

No problem with me.

Comment by David Storch [ 10/Jan/18 ]

kaloian.manassiev can we move this onto the query team backlog? It's related to a project we're running about improving sharded kill.

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