Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2427

Server description on 4.4+ servers flips between having compression on & off

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.16.3, 2.17.2
    • Affects Version/s: 2.13.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      MongoDB 4.4.1 in RS, mongo gem 2.13.1 and mongoid 7.1.2.
    • Fully Compatible

      Similar to RUBY-1223, I had the problem in past and it's back again. I'm using MongoDB 4.4.1 in RS, mongo gem 2.13.1 and mongoid 7.1.2.

      The mongo logger is spammed with this every 10 seconds:

      D, [2020-10-12T15:18:03.840198 #6169] DEBUG -- : MONGODB | Server description for db1.updn.io:27017 changed from 'secondary' to 'secondary'.
      D, [2020-10-12T15:18:03.840335 #6169] DEBUG -- : MONGODB | There was a change in the members of the 'ReplicaSetWithPrimary' topology.
      D, [2020-10-12T15:18:06.814294 #6169] DEBUG -- : MONGODB | Server description for db3.updn.io:27017 changed from 'primary' to 'primary'.
      D, [2020-10-12T15:18:06.814499 #6169] DEBUG -- : MONGODB | There was a change in the members of the 'ReplicaSetWithPrimary' topology.
      D, [2020-10-12T15:18:07.357489 #6169] DEBUG -- : MONGODB | Server description for db3.updn.io:27017 changed from 'primary' to 'primary' [awaited].
      D, [2020-10-12T15:18:07.357692 #6169] DEBUG -- : MONGODB | There was a change in the members of the 'ReplicaSetWithPrimary' topology.
      D, [2020-10-12T15:18:07.382790 #6169] DEBUG -- : MONGODB | Server description for db2.updn.io:27017 changed from 'secondary' to 'secondary' [awaited].
      D, [2020-10-12T15:18:07.382927 #6169] DEBUG -- : MONGODB | There was a change in the members of the 'ReplicaSetWithPrimary' topology.
      D, [2020-10-12T15:18:07.717933 #6169] DEBUG -- : MONGODB | Server description for db1.updn.io:27017 changed from 'secondary' to 'secondary' [awaited].
      D, [2020-10-12T15:18:07.718082 #6169] DEBUG -- : MONGODB | There was a change in the members of the 'ReplicaSetWithPrimary' topology.
      D, [2020-10-12T15:18:07.748347 #6169] DEBUG -- : MONGODB | Server description for db2.updn.io:27017 changed from 'secondary' to 'secondary'.
      D, [2020-10-12T15:18:07.748459 #6169] DEBUG -- : MONGODB | There was a change in the members of the 'ReplicaSetWithPrimary' topology.
      D, [2020-10-12T15:18:13.938602 #6169] DEBUG -- : MONGODB | Server description for db1.updn.io:27017 changed from 'secondary' to 'secondary'.
      D, [2020-10-12T15:18:13.938721 #6169] DEBUG -- : MONGODB | There was a change in the members of the 'ReplicaSetWithPrimary' topology.
      

      The mongoid config is the following:

      production:
        clients:
          default:
            database: updown
            hosts:
              - db1.updn.io
              - db2.updn.io
              - db3.updn.io
            options:
              user: updown
              password: <%= Rails.application.credentials.dig(:mongodb, :production) %>
              compressors: [zlib]
              retry_writes: true
              max_read_retries: 3
              read:
                mode: :primary_preferred
              max_pool_size: 100
              wait_queue_timeout: 5
              socket_timeout: 20
      

      The the RS config is the following:

      rs0:PRIMARY> rs.config()
      {
      	"_id" : "rs0",
      	"version" : 71319,
      	"protocolVersion" : NumberLong(1),
      	"writeConcernMajorityJournalDefault" : true,
      	"members" : [
      		{
      			"_id" : 14,
      			"host" : "db2.updn.io:27017",
      			"arbiterOnly" : false,
      			"buildIndexes" : true,
      			"hidden" : false,
      			"priority" : 2,
      			"tags" : {
      				
      			},
      			"slaveDelay" : NumberLong(0),
      			"votes" : 1
      		},
      		{
      			"_id" : 16,
      			"host" : "db1.updn.io:27017",
      			"arbiterOnly" : false,
      			"buildIndexes" : true,
      			"hidden" : false,
      			"priority" : 1,
      			"tags" : {
      				
      			},
      			"slaveDelay" : NumberLong(0),
      			"votes" : 1
      		},
      		{
      			"_id" : 17,
      			"host" : "db3.updn.io:27017",
      			"arbiterOnly" : false,
      			"buildIndexes" : true,
      			"hidden" : false,
      			"priority" : 2,
      			"tags" : {
      				
      			},
      			"slaveDelay" : NumberLong(0),
      			"votes" : 1
      		}
      	],
      	"settings" : {
      		"chainingAllowed" : true,
      		"heartbeatIntervalMillis" : 2000,
      		"heartbeatTimeoutSecs" : 10,
      		"electionTimeoutMillis" : 30000,
      		"catchUpTimeoutMillis" : 2000,
      		"catchUpTakeoverDelayMillis" : 30000,
      		"getLastErrorModes" : {
      			
      		},
      		"getLastErrorDefaults" : {
      			"w" : 1,
      			"wtimeout" : 10000
      		}
      	}
      }
      

      Look like a bug again in the detection of changes in mongo driver (because there's no changes) but if there's anything I'm doing wrong please let me know

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            bigbourin@gmail.com Adrien Jarthon
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: