Hi,
Am having an intermittent write issue on a MongoDB replicaset setup. Here's the error:
[document:MongoWriteConcernException:private] => Array
(
[err] => not master
[code] => 10054
[n] => 0
[lastOp] => MongoTimestamp Object
(
[sec] => 0
[inc] => 0
)
[connectionId] => 632889
[ok] => 1
)
[host] => 192.168.1.2:27017I've got this replicaset:
dragonfly:PRIMARY> rs.status();
{
"set" : "myreplicaset",
"date" : ISODate("2015-08-01T09:52:53Z"),
"myState" : 1,
"members" : [
{
"_id" : 0,
"name" : "
192.168.1.1:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 80496,
"optime" : Timestamp(1438422773, 1),
"optimeDate" : ISODate("2015-08-01T09:52:53Z"),
"self" : true
},
{
"_id" : 1,
"name" : "
192.168.1.2:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 80496,
"optime" : Timestamp(1438422772, 5),
"optimeDate" : ISODate("2015-08-01T09:52:52Z"),
"lastHeartbeat" : ISODate("2015-08-01T09:52:52Z"),
"lastHeartbeatRecv" : ISODate("2015-08-01T09:52:51Z"),
"pingMs" : 0,
"syncingTo" : "
192.168.100.1:27017"
},
{
"_id" : 2,
"name" : "
192.168.1.3:27018",
"health" : 1,
"state" : 7,
"stateStr" : "ARBITER",
"uptime" : 80496,
"lastHeartbeat" : ISODate("2015-08-01T09:52:53Z"),
"lastHeartbeatRecv" : ISODate("2015-08-01T09:52:51Z"),
"pingMs" : 0
}
],
"ok" : 1
}
The issue I encounter during an update as such:
$mymongoObj->update(array( 'trans_id' => 'XXXXX',
'location' => 'mylocation'),
$transaction,
array('upsert' => true,
'w' => 1)
);
Sometimes it works, sometimes it doesn't.
Mongo Server is v.2.4.10
PHP Mongo Driver is v.1.6.6
PHP Version is v.5.5.24
Does anyone encountered the same issue and had a fix for such?
Thanks.
Ed