Skip to content

Bump mongo-go-driver: v1.17.9 -> v2.6.0#1314

Merged
boris-ilijic merged 7 commits intodevfrom
PBM-1592-bump-go-driver
May 7, 2026
Merged

Bump mongo-go-driver: v1.17.9 -> v2.6.0#1314
boris-ilijic merged 7 commits intodevfrom
PBM-1592-bump-go-driver

Conversation

@boris-ilijic
Copy link
Copy Markdown
Member

@boris-ilijic boris-ilijic commented May 1, 2026

PR for https://perconadev.atlassian.net/browse/PBM-1592

PR migrates from go.mongodb.org/mongo-driver v1 to v2 (v2.6.0) and bumps the related mongo-tools dependency to latest.
Follow up tasks related mongo-tools will be part of: https://perconadev.atlassian.net/browse/PBM-1682.

Comment thread pbm/backup/chunk.go
@boris-ilijic boris-ilijic force-pushed the PBM-1592-bump-go-driver branch from df96cee to 36a5792 Compare May 1, 2026 11:33
@boris-ilijic boris-ilijic force-pushed the PBM-1592-bump-go-driver branch from 36a5792 to 7f9ca88 Compare May 1, 2026 13:27
... the server

In v1.x mongo-driver returns: "socket was unexpectedly closed", while
in v2.6 it returns "connection closed unexpectedly by the other side".
@boris-ilijic boris-ilijic force-pushed the PBM-1592-bump-go-driver branch from 7f9ca88 to 3cf04d6 Compare May 1, 2026 14:52
@boris-ilijic boris-ilijic force-pushed the PBM-1592-bump-go-driver branch from 4392686 to de4bcbf Compare May 7, 2026 08:13
@boris-ilijic boris-ilijic marked this pull request as ready for review May 7, 2026 08:35
@boris-ilijic boris-ilijic requested a review from jcechace as a code owner May 7, 2026 08:35
Copy link
Copy Markdown
Collaborator

@jcechace jcechace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left few questions, mostly just out of curiosity.

Comment thread pbm/connect/connect.go
Comment on lines +371 to +375
if wc := l.options.WriteConcern; wc != nil && wc.W != nil {
cmd = append(cmd, bson.E{
Key: "writeConcern",
Value: bson.D{{Key: "w", Value: wc.W}},
})
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentionally ignoring ignoring wc.Journal?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not connection object, this is create command that also has writeConcern property.
See here: https://www.mongodb.com/docs/manual/reference/command/create/#syntax
So j is not relevant here.

Comment thread pbm/archive/archive.go
Comment on lines +227 to +228
// migration mongo-driver v1->v2: fix this in PBM-1682
CRC: uint64(ns.CRC), //nolint:gosec
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for information. What needs to be fixed here? On binary level this should be safe and it looks like we are using crc64.ECMA for CRC calculations.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll double check as part of PBM-1682

Comment thread pbm/oplog/restore.go
Comment on lines +918 to +919
// migration mongo-driver v1->v2: fix this in PBM-1682
// op.Hash = txnOp.Hash
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for info. What are the implications of dropping this? Seems that field was last useful in MongoDB 4.0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, agree, this is obsolete but I'll double check impact.

@boris-ilijic boris-ilijic merged commit ba2c0a8 into dev May 7, 2026
25 checks passed
@boris-ilijic boris-ilijic deleted the PBM-1592-bump-go-driver branch May 7, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants