[CDRIVER-2506] getMore doesn't always use same implicit session as find/aggregate/etc. Created: 13/Feb/18 Updated: 28/Oct/23 Resolved: 15/Feb/18 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.9.0 |
| Fix Version/s: | 1.9.3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
The sessions spec says:
mongoc_cursor_t does this when an explicit session is passed in "opts", but when it uses an implicit session this behavior isn't guaranteed. Our tests passed by accident, because the session pool is LIFO, and in the single-threaded case it usually only has one lsid anyway:
However, if another session were pushed into the pool between the initial "find" and the first "getMore", or between any pair of subsequence getMores, then its new lsid would be used for the next "getMore" instead. If auth is enabled, this will result in a server error code 13, "Cursor session id is not the same as the operation context's session id". |
| Comments |
| Comment by Githook User [ 02/Mar/18 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message: |
| Comment by Githook User [ 02/Mar/18 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message: |
| Comment by Githook User [ 15/Feb/18 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message: |
| Comment by Githook User [ 15/Feb/18 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message:
|
| Comment by Githook User [ 15/Feb/18 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message: |
| Comment by A. Jesse Jiryu Davis [ 13/Feb/18 ] |
|
Yes I think it will. |
| Comment by Jeremy Mikola [ 13/Feb/18 ] |
|
jesse: Will this be backported to 1.9.x? It seems like something we'd want to address in PHPC 1.4.1, since most users will be using implicit sessions on MongoDB 3.6. |