Skip to content

Commit

Permalink
Merge pull request juju#15726 from nvinuesa/juju-3935-3
Browse files Browse the repository at this point in the history
juju#15726

_Note: This is a backport of juju#15723 on 3.1_

Having the fullDocumentBeforeChange value set to 'off' in the mongodb watcher results in this silent error:
```
BSON field '$changeStream.fullDocumentBeforeChange' is an unknown field
```
because this field is added on mongodb 6.0.

Since we are setting it to 'off' which is also the default value on mongodb >= 6.0, it's safe to simply remove it.

## Checklist

*If an item is not applicable, use `~strikethrough~`.*

- [ ] ~Code style: imports ordered, good names, simple structure, etc~
- [ ] ~Comments saying why design decisions were made~
- [ ] ~Go unit tests, with comments saying what you're testing~
- [ ] ~[Integration tests](https://github.com/juju/juju/tree/main/tests), with comments saying what you're testing~
- [ ] ~[doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages~
  • Loading branch information
jujubot authored Jun 13, 2023
2 parents 2d99718 + 1e59f4b commit 348d90d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions state/watcher/txnwatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,7 @@ func (w *TxnWatcher) init() (bool, error) {
db := w.session.DB(w.jujuDBName)

cs := bson.M{
"fullDocument": "updateLookup",
"fullDocumentBeforeChange": "off",
"fullDocument": "updateLookup",
}
if len(w.resumeToken.Data) > 0 {
cs["resumeAfter"] = w.resumeToken
Expand Down

0 comments on commit 348d90d

Please sign in to comment.