[SERVER-24418] Make it possible to get owned BSONObjs off network buffer w/o copying Created: 06/Jun/16  Updated: 05/Jul/16  Resolved: 22/Jun/16

Status: Closed
Project: Core Server
Component/s: Internal Code, Networking, Performance
Affects Version/s: None
Fix Version/s: 3.3.9

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-24242 Improve replication performance Closed
Backwards Compatibility: Fully Compatible
Sprint: Integrate+Tuning 16 (06/24/16)
Participants:

 Description   

Currently the only way to get an owned BSONObj off the network is to copy it out of the network buffer. This will make it possible to get a BSONObj that shares ownership with the network buffer to avoid copying. The initial work will focus on the path used by replication to ship the oplog to downstream nodes, but it should be simple to use this elsewhere.



 Comments   
Comment by Githook User [ 22/Jun/16 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-24418 Make Message and BufBuilder use SharedBuffer for memory management

This makes it possible to get owned BSONObj out of a Message without copying.

Hooked up to the following places:

  • Anything using the Fetcher (including oplog fetching on secondaries)
  • Anything using DBClientInterface::findOne()
  • Anything using CursorResponse (including Sharded queries)

As a simplification, Messages no longer support non-contiguous buffers, or
non-owning buffers. The former wasn't used by anything, and the latter was
only used by mongosniff only for messages that fit in a single packet.
Branch: master
https://github.com/mongodb/mongo/commit/e508ddcb51eec941ae50d9c2efb06b601811dc19

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