-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
ALL
-
Repl 2022-11-14
hello:
i read doc,mongo 5.0 PSA default writeConcern is w:1. so i test it ok on PSA replication after second is shutdown.but i test write hangs on cluster.so defaultwriteconcern on mongos cluster is not w:1,on psa replication is w:1.please is it bug for mongos?
if [ (#arbiters > 0) AND (#non-arbiters <= majority(#voting-nodes)) ]
defaultWriteConcern =
else
defaultWriteConcern =
To reproduce on psa replication:
shard2:PRIMARY> version()
5.0.2
shard2:PRIMARY> status.members.length
shard2:PRIMARY> status.members[0].stateStr
PRIMARY
shard2:PRIMARY> status.members[1].stateStr
(not reachable/healthy)
shard2:PRIMARY> status.members[2].stateStr
ARBITER
shard2:PRIMARY> db.xiaoxu.insert(
)
WriteResult(
)
To reproduce using mongos on single psa shard,it not wok.
mongo cluster has one mongos,single psa shard,and one member config,when psa with secondary is shutdown.it write hangs.
mongos> db.testWriteConcern.insert({_id:10,name:"xiaoxu"},
{w:1})
WriteResult(
)
it is not nerver timeout when no timeout
mongos> db.testWriteConcern.insert({_id:3,name:"xiaoxu"}).
.....
anon@127.0.0.1:31002:PRIMARY:[db]test> rs.status();
{
"set" : "shard2",
"date" : ISODate("2022-05-16T06:09:18.876Z"),
"myState" : 1,
"term" : NumberLong(5),
"syncSourceHost" : "",
"syncSourceId" : -1,
"heartbeatIntervalMillis" : NumberLong(2000),
"majorityVoteCount" : 2,
"writeMajorityCount" : 2,
"votingMembersCount" : 3,
"writableVotingMembersCount" : 2,
"optimes" : {
"lastCommittedOpTime" :
,
"lastCommittedWallTime" : ISODate("2022-05-16T03:29:34.156Z"),
"readConcernMajorityOpTime" :
,
"appliedOpTime" :
,
"durableOpTime" :
,
"lastAppliedWallTime" : ISODate("2022-05-16T06:09:14.351Z"),
"lastDurableWallTime" : ISODate("2022-05-16T06:09:14.351Z")
},
"lastStableRecoveryTimestamp" : Timestamp(1652671774, 1),
"electionCandidateMetrics" : {
"lastElectionReason" : "electionTimeout",
"lastElectionDate" : ISODate("2022-05-16T03:17:24.137Z"),
"electionTerm" : NumberLong(5),
"lastCommittedOpTimeAtElection" :
,
"lastSeenOpTimeAtElection" :
,
"numVotesNeeded" : 2,
"priorityAtElection" : 1,
"electionTimeoutMillis" : NumberLong(10000),
"numCatchUpOps" : NumberLong(0),
"newTermStartDate" : ISODate("2022-05-16T03:17:24.143Z"),
"wMajorityWriteAvailabilityDate" : ISODate("2022-05-16T03:17:24.780Z")
},
"electionParticipantMetrics" : {
"votedForCandidate" : true,
"electionTerm" : NumberLong(3),
"lastVoteDate" : ISODate("2022-05-16T03:15:47.936Z"),
"electionCandidateMemberId" : 0,
"voteReason" : "",
"lastAppliedOpTimeAtElection" :
,
"maxAppliedOpTimeInSet" :
,
"priorityAtElection" : 1
},
"members" : [
{
"_id" : 0,
"name" : "10.230.10.150:31002",
"health" : 0,
"state" : 8,
"stateStr" : "(not reachable/healthy)",
"uptime" : 0,
"optime" :
,
"optimeDurable" :
,
"optimeDate" : ISODate("1970-01-01T00:00:00Z"),
"optimeDurableDate" : ISODate("1970-01-01T00:00:00Z"),
"lastHeartbeat" : ISODate("2022-05-16T06:09:18.627Z"),
"lastHeartbeatRecv" : ISODate("2022-05-16T03:29:34.936Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "Error connecting to 10.130.10.150:31002 :: caused by :: Connection refused",
"syncSourceHost" : "",
"syncSourceId" : -1,
"infoMessage" : "",
"configVersion" : 4,
"configTerm" : 5
},
{
"_id" : 1,
"name" : "10.230.10.149:31002",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 10413,
"optime" :
,
"optimeDate" : ISODate("2022-05-16T06:09:14Z"),
"syncSourceHost" : "",
"syncSourceId" : -1,
"infoMessage" : "",
"electionTime" : Timestamp(1652671044, 1),
"electionDate" : ISODate("2022-05-16T03:17:24Z"),
"configVersion" : 4,
"configTerm" : 5,
"self" : true,
"lastHeartbeatMessage" : ""
},
],
"ok" : 1,