I just upgraded to mongodb 4.4.1 and the console is flooded with these messages, every other second:
D, [2020-11-03T03:28:32.885772 #24798] DEBUG -- : MONGODB | There was a change in the members of the 'Single' topology.
D, [2020-11-03T03:28:42.875739 #24798] DEBUG -- : MONGODB | Server description for localhost:27017 changed from 'standalone' to 'standalone' [awaited].
D, [2020-11-03T03:28:42.876668 #24798] DEBUG -- : MONGODB | There was a change in the members of the 'Single' topology.
D, [2020-11-03T03:28:42.888517 #24798] DEBUG -- : MONGODB | Server description for localhost:27017 changed from 'standalone' to 'standalone'.
Anyone know why this is happening, if it's bad, and how to stop?
I’ve recently experienced similar behaviour with a Rails 6 application which uses Mongoid 7.1 to connect to a standalone (non-clustered) MongoDB 4.4 instance. The following makes a big assumption that you are also seeing this behaviour in the context of a Rails application which uses Mongoid.
The cause of this excessive logging seemed to be in the MongoDB Ruby Driver version which Mongoid relies upon. Specifically the default logging level in MongoDB Ruby Driver was set to Debug
. When combined with the default logging behaviours of Rails and Mongoid this caused excessive logging of MongoDb topology events in non-production environments. See the public MongoDB Jira tickets below for more details.
https://jira.mongodb.org/browse/RUBY-2419
https://jira.mongodb.org/browse/RUBY-2356
Version 2.14 of MongoDB Ruby Driver introduced a fix to set the default logging level to be info
. This driver version itself was later introduced to Mongoid.
Upgrading the Mongoid version used in the application seems to have resolved this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With