[SERVER-34903] Allow killCursors within a transaction Created: 08/May/18 Updated: 29/Oct/23 Resolved: 15/May/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | Tess Avitabile (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Sprint: | Repl 2018-05-21 | ||||
| Participants: | |||||
| Description |
|
Drivers will attach transaction options (lsid, txnNumber, autocommit) whenever they kill a cursor as part of an open transaction. The server needs to support this, thus killCursors needs to be in the transaction command whitelist. |
| Comments |
| Comment by Githook User [ 15/May/18 ] | ||||||||||||||
|
Author: {'email': 'tess.avitabile@mongodb.com', 'username': 'tessavitabile', 'name': 'Tess Avitabile'}Message: | ||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 09/May/18 ] | ||||||||||||||
|
Oh, sorry I went off half-cocked. Shane's got a great point as usual. Given that we don't even require drivers to use the cursor's original lsid for killCursors, we shouldn't now require the original txnNumber. | ||||||||||||||
| Comment by Tess Avitabile (Inactive) [ 09/May/18 ] | ||||||||||||||
|
Yes, that is the case we're discussing. I see, if drivers ignore errors from killCursors, then doing this validation on the server would not send any helpful feedback to drivers and would just potentially leave open cursors on the server unnecessarily. | ||||||||||||||
| Comment by Shane Harvey [ 09/May/18 ] | ||||||||||||||
|
Is this the case we're discussing?
This would silently leave open cursors on the server because driver ignores errors from killCursors. Perhaps drivers should not add txnNumber to getMore/killCursors commands that were created outside of a transaction? Jesse, do you think drivers should support this?
| ||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 09/May/18 ] | ||||||||||||||
|
SGTM2. cc shane.harvey | ||||||||||||||
| Comment by Spencer Brody (Inactive) [ 09/May/18 ] | ||||||||||||||
|
Makes sense to me! FYI jesse | ||||||||||||||
| Comment by Tess Avitabile (Inactive) [ 09/May/18 ] | ||||||||||||||
|
Should we require that a killCursors run in a transaction only kill cursors that were opened in that transaction? I don't think it's important for the server, but it would be easy to do, and it would be a check for drivers, if that is their expected behavior. |