[SERVER-36831] LogicalSessionCache on mongos does not correctly report active operations Created: 23/Aug/18 Updated: 29/Oct/23 Resolved: 21/Sep/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.6.7, 4.0.1, 4.1.2 |
| Fix Version/s: | 3.6.9, 4.0.4, 4.1.3 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Esha Maharishi (Inactive) | Assignee: | Blake Oler |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Backport Requested: |
v4.0, v3.6
|
||||
| Sprint: | Sharding 2018-09-24 | ||||
| Participants: | |||||
| Description |
InvestigationGenerically speaking (on any node), the LogicalSessionCache on that node uses its ServiceLiaison's getActiveOpSessions() method to collect the set of currently active operations that are associated with a session. (This is to collect the set of long-running operations that have been active since the last time the LogicalSessionCache updated the sessions records. New operations that have come in since the last time the LogicalSessionCache updated the sessions records are collected through LogicalSessionCache::vivify() in each node's service entry point). The ServiceLiaison interface has a mongod and mongos implementation. ServiceLiaison*Mongod*::getActiveOpSessions() walks through all Clients currently on the ServiceContext to collection the currently active operations. However, the ServiceLiaison*Mongos*::getActiveOpSessions() simply looks at the open cursors currently in the CursorManager. As a result, even if there is no activity on these cursors, sessions with open cursors will not be reaped. It looks like this is a copy-paste error, and that the lines in ServiceLiaisonMongos::getActiveOpSessions() should instead be here in ServiceLiaisonMongos::getOpenCursorSessions(). But, I think it's worth taking a step back to examine the ServiceLiaison on mongos and mongod to make sure it is capturing the right information - why doesn't the ServiceLiaisonMongos walk through Clients on its ServiceContext to capture long-running operations on sessions (the way ServiceLiaisonMongod does) that are not associated with a cursor and do not touch any shards? This bug also affects 4.0.1 and 3.6.7. Proposed FixWe have agreed that the two service liaisons should behave in the same manner. We have also agreed that ServiceLiaison*Mongod has the correct implementation of both getActiveOpSessions() and getOpenCursorSessions().
|
| Comments |
| Comment by Githook User [ 04/Oct/18 ] |
|
Author: {'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}Message: (cherry picked from 19a5f8726fed990bd75d2a0426f53f691ee82b97) |
| Comment by Githook User [ 04/Oct/18 ] |
|
Author: {'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}Message: (cherry picked from 19a5f8726fed990bd75d2a0426f53f691ee82b97) |
| Comment by Githook User [ 21/Sep/18 ] |
|
Author: {'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}Message: |
| Comment by Misha Tyulenev [ 20/Sep/18 ] |
|
blake.oler ack the fix |
| Comment by Blake Oler [ 20/Sep/18 ] |
|
misha.tyulenev ack proposed fix? |
| Comment by Misha Tyulenev [ 19/Sep/18 ] |
|
I agree with esha.maharishi. mongos needs to kill cursors that are not running but handled by CursorManager. |