poco icon indicating copy to clipboard operation
poco copied to clipboard

Poco::MongoDB support for MongoDB 5.0?

Open brentd42 opened this issue 3 years ago • 6 comments

The MongoDB wire protocol opcodes used by the POCO MongoDB driver have been deprecated in MongoDB 5.0 (see [https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#std-label-wp-request-opcodes]). I stumbled across this when attempting to use Poco::MongoDB::InsertRequest to insert a document into a MongoDB 5.0 "time series" collection and it failed to work. These legacy opcodes have been replaced by the OP_MSG opcode introduced in MongoDB 3.6 with the associated wire transfer request and response changes.

Is the migration of the MongoDB driver from using legacy to modern protocols somewhere in the POCO roadmap?

brentd42 avatar Dec 22 '21 19:12 brentd42

I guess it will have to be done at some point. Contributions welcome.

obiltschnig avatar Dec 22 '21 19:12 obiltschnig

@matejk could you help with this?

aleks-f avatar May 24 '22 23:05 aleks-f

@aleks-f, we will transition to newer Linux distributions until end of this year and we'll also need this. Yes, I can help.

matejk avatar Aug 19 '22 07:08 matejk

Relevant obsolescence page:

https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#legacy-opcodes

matejk avatar Aug 19 '22 07:08 matejk

Mongo DB introduced OP_MSG that replaces other messages in version 3.6, current version is 6.0.

Versions older than 3.6 are not supported anymore.

@aleks-f, is it expected that Poco::MongoDB shall support legacy versions of MongoDB, older than 3.6?

If not, then legacy wire messages can be completely replaced with new wire protocol.

matejk avatar Aug 22 '22 07:08 matejk

I don't know

@obiltschnig @fbraem ?

aleks-f avatar Aug 22 '22 08:08 aleks-f

I started to work on this feature in the way that both old and new wire protocol are supported.

matejk avatar Nov 23 '22 21:11 matejk

I had planned to work on this as part of a project, but that project got postponed indefinitely unfortunately.

obiltschnig avatar Nov 24 '22 05:11 obiltschnig

First batch of changes is available on branch

https://github.com/matejk/poco/tree/gh-3484-mongodb-op_msg

in case that someone in interested in providing early feedback.

matejk avatar Nov 25 '22 12:11 matejk

Required functionality to support MongoDB 5.1 and newer is available on branch:

https://github.com/matejk/poco/tree/gh-3484-mongodb-op_msg

I tested it with MongoDB 6.0.

@obiltschnig , @fbraem: IMO it would be great if someone would take a look at the code and try it before I create a merge request.

matejk avatar Dec 02 '22 15:12 matejk