5

I have a simple replica set configured as follows:

  • mongo1 (primary)
  • mongo2 (secondary)
  • mongo3 (arbiter)

It functioned correctly for around a month and then we started seeing intermittent exceptions along the lines of:

Moped::Errors::ReplicaSetReconfigured: The operation: #<Moped::Protocol::Command 
@length=179 @request_id=1400 @response...>{:order=>"SwimSet"}, :update=>{"$inc"=>
{:next=>1}}, :new=>true, :upsert=>true} @fields=nil> failed with error "not master"

They key bit being "failed with error not master. This happens sporadically when trying to write to a collection. This is not during or immediately after a failover. Shutting the secondary down but leaving the arbiter running resolves the error but leaves us without any redundancy.

What we've tried:

  • Rebuilding the secondary and re-adding it to the cluster
  • Failing over to the newly built node, then rebuilding the old primary
  • Upgrading to Mongo 2.6.4

Current Versions:

  • Mongo Server: 2.6.4
  • Mongoid: 3.1.6
  • Moped: 1.5.2

Any suggestions very much appreciated as been battling with this on and off for nearly a month now.

TalkingQuickly
  • 538
  • 5
  • 15
  • Can you post the output of rs.status()? And your connection string? – Markus W Mahlberg Oct 16 '14 at 19:09
  • Also, are you using secondary write concern at any point? You could be using a write concern like secondary, secondaryPreferred, or primaryPreferred that may send operations to a secondary, and the secondary hasn't been cleared to respond with slaveOk. This causes the operations to fail, giving those errors. – wdberkeley Oct 20 '14 at 15:16
  • Have you had any success in finding the cause? – Cmag Jun 25 '15 at 15:41
  • Still no luck on this one, are you also seeing the same error? If so we could potentially compare configurations to try and work out what the common element is? – TalkingQuickly Jul 08 '15 at 09:03
  • Seeing a similar issue with mongo 3.0.4, use secondaryPreferred and when calling a collection "drop" action. – JAR.JAR.beans Aug 09 '15 at 10:06
  • 1
    Did this ever get resolved? I am having the same issue. – moesef Feb 11 '16 at 19:03
  • 1
    @moesef I am next in line with error, did you resolve this ? – sonic Aug 31 '18 at 13:23

0 Answers0