Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

monbodb flooding the console with change from standalone to standalone

Tags:

mongodb

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?

like image 905
user1130176 Avatar asked Nov 16 '22 03:11

user1130176


1 Answers

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.

like image 130
Andrew January Avatar answered Apr 06 '23 00:04

Andrew January