[SERVER-27892] Clarify locking rules for _canAcceptNonLocalWrites and _canServeNonLocalReads Created: 02/Feb/17  Updated: 28/Jan/21  Resolved: 06/Oct/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.6.0-rc0

Type: Task Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-28544 Stepdown command must take global loc... Closed
Duplicate
is duplicated by SERVER-28103 ReplicationCoordinatorImpl::canAccept... Closed
Related
related to SERVER-27555 ReplicationCoordinatorImpl::_memberSt... Closed
related to SERVER-28097 add replset test command to wait for ... Closed
is related to SERVER-14601 All "not master" errors should use th... Closed
is related to SERVER-30852 Force reconfig that makes current pri... Closed
is related to SERVER-31431 Ensure that all state transitions in ... Closed
is related to SERVER-31432 Remove all callers of canAcceptWrites... Closed
is related to SERVER-27914 Verify canAcceptWritesForDatabase() i... Closed
is related to SERVER-27911 Merge all stepdown code paths Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2017-03-06, Repl 2017-03-27, Repl 2017-04-17, Repl 2017-05-08, Repl 2017-05-29, Repl 2017-06-19, Repl 2017-07-31, Repl 2017-08-21, Repl 2017-09-11, Repl 2017-10-02, Repl 2017-10-23
Participants:
Linked BF Score: 0

 Comments   
Comment by Shane Harvey [ 28/Jan/21 ]

I'm doing a bit of error code research for DRIVERS-1152 and discovered this change improved mapReduce error reporting when mistakenly executing a non-inline mapReduce command on a secondary. Before this change (on MongoDB <=3.4) the secondary would return this generic error without an error code:

{'ok': 0.0, 'errmsg': 'not master'}

After this change (on MongoDB >=3.6) the secondary returns PrimarySteppedDown with an error code:

{'ok': 0.0, 'errmsg': 'no longer primary while dropping temporary collection for mapReduce: test.tmp.mr.test_1', 'code': 189, 'codeName': 'PrimarySteppedDown'}

Comment by Githook User [ 06/Oct/17 ]

Author:

{'email': 'spencer@mongodb.com', 'name': 'Spencer T Brody', 'username': 'stbrody'}

Message: SERVER-27892 Clarify locking rules for _canAcceptNonLocalWrites
Branch: master
https://github.com/mongodb/mongo/commit/ce87416479155a9cf8e38a0f6b0c6bad194c9cfc

Comment by Githook User [ 04/Oct/17 ]

Author:

{'email': 'spencer@mongodb.com', 'name': 'Spencer T Brody', 'username': 'stbrody'}

Message: SERVER-27892 Fix find and getMore commands to only check whether they can run after acquiring locks
Branch: master
https://github.com/mongodb/mongo/commit/cea80793198c198fc2819808982ac3d5ef7c1105

Comment by Githook User [ 21/Mar/17 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-27892 Don't call canAcceptWritesFor in mapReduce until after grabing locks
Branch: master
https://github.com/mongodb/mongo/commit/7cd3934080fcf0a14e8133074cd77598285126a1

Comment by Spencer Brody (Inactive) [ 23/Feb/17 ]

Note, stepdown command currently takes global lock in S mode - this is needed in order to allow secondaries to continue catching up as the stepdown is pending.

Generated at Thu Feb 08 04:16:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.