[SERVER-33158] Logical Session refresh batches are too large Created: 07/Feb/18  Updated: 29/Oct/23  Resolved: 08/Feb/18

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.6.3, 3.7.2

Type: Bug Priority: Critical - P2
Reporter: Mira Carey Assignee: Mira Carey
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Documented
is documented by DOCS-11320 Docs for SERVER-33158: Logical Sessio... Closed
Duplicate
Related
related to JAVA-2778 Implicit sessions are sometimes leaked Closed
is related to DRIVERS-453 Decrease likelihood of implicit sessi... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6
Sprint: Platforms 2018-02-12
Participants:
Case:

 Description   

The batches created by the LogicalSessionCache can exceed the 16mb bson size limit for bson on the wire. This will cause the refresh step to fail, preventing logical sessions from ever being synced to the global collection.

This happens because we don't explicitly size our batches (we were relying on the write_cmd item batch limit, rather than a byte limit). Previously the write_cmd batch limit had been 1000 items, which allowed for 16k per record. The new limit is 100k, which gives a 160 byte budget we can exceed with very large user names (as we sync the lsid + the user@db name).

By forcing a new 10k limit on username sizes used with logical sessions we can then ensure that a lower 1k limit will always be safe.



 Comments   
Comment by Githook User [ 09/Feb/18 ]

Author:

{'email': 'jcarey@argv.me', 'name': 'Jason Carey', 'username': 'hanumantmk'}

Message: SERVER-33158 Shrink LogicalSession refresh batches

The batches created by the LogicalSessionCache can exceed the 16mb bson
size limit for bson on the wire. This will cause the refresh step to
fail, preventing logical sessions from ever being synced to the global
collection.

This happens because we don't explicitly size our batches (we were
relying on the write_cmd item batch limit, rather than a byte limit).
Previously the write_cmd batch limit had been 1000 items, which allowed
for 16k per record. The new limit is 100k, which gives a 160 byte
budget we can exceed with very large user names (as we sync the lsid
+ the user@db name).

By forcing a new 10k limit on username sizes used with logical sessions
we can then ensure that a lower 1k limit will always be safe.

(cherry picked from commit 4ae174dd53adaea999715ffbe19c435d685bc412)
Branch: v3.6
https://github.com/mongodb/mongo/commit/e872183bb267ab7202bad421523f9ec96e12d933

Comment by Githook User [ 08/Feb/18 ]

Author:

{'email': 'jcarey@argv.me', 'name': 'Jason Carey', 'username': 'hanumantmk'}

Message: SERVER-33158 Shrink LogicalSession refresh batches

The batches created by the LogicalSessionCache can exceed the 16mb bson
size limit for bson on the wire. This will cause the refresh step to
fail, preventing logical sessions from ever being synced to the global
collection.

This happens because we don't explicitly size our batches (we were
relying on the write_cmd item batch limit, rather than a byte limit).
Previously the write_cmd batch limit had been 1000 items, which allowed
for 16k per record. The new limit is 100k, which gives a 160 byte
budget we can exceed with very large user names (as we sync the lsid
+ the user@db name).

By forcing a new 10k limit on username sizes used with logical sessions
we can then ensure that a lower 1k limit will always be safe.
Branch: master
https://github.com/mongodb/mongo/commit/4ae174dd53adaea999715ffbe19c435d685bc412

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