[SERVER-6071] Use command on local.slaves instead of cursor Created: 11/Jun/12  Updated: 10/Nov/15  Resolved: 22/Jul/13

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 2.5.2

Type: Bug Priority: Major - P3
Reporter: Kristina Chodorow (Inactive) Assignee: Matt Dannenberg
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-10111 buildbot-special: sharding/remove2.js... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

This requires changing code on the primary, so I don't think we can do this.

The primary uses a _slaves map to track where the slaves are synced to. This map is only updated by calling getMore() for registered oplog-tailing cursors. Upshot: _slaves isn't changed if you call local.slaves.update(), therefore w doesn't work.



 Comments   
Comment by auto [ 09/Aug/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-6071 sleep in SyncSourceFeedback loop, if connection failed
Branch: master
https://github.com/mongodb/mongo/commit/c4b3dd888d864923fe8ad51b0a89e95fd3d7d02c

Comment by auto [ 08/Aug/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-6071 add sleep on connection failure to avoid spinning
Branch: master
https://github.com/mongodb/mongo/commit/84c163bbbc6a0179ed02c16c3442edde39dff1f1

Comment by auto [ 08/Aug/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-6071 prevent spinning on primaries
Branch: master
https://github.com/mongodb/mongo/commit/a5c4978b510d24bfaa3a4b2ee6570fd747326e1e

Comment by auto [ 05/Aug/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-6071 pass 'me' object to oplogreader instead of getting from database in a way that causes a deadlock
Branch: master
https://github.com/mongodb/mongo/commit/4c1e37975ab551e02b1b3f6d9902302666f3b4af

Comment by auto [ 31/Jul/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-6071 stop unnecessary locking and deadlock in new SyncSourceFeedback

removed unnecessary fsyncLock and "local" lock from bgsync where it pertained to SyncSourceFeedback
Branch: master
https://github.com/mongodb/mongo/commit/9cd384edef1db23eb72544d8040a930014a7650f

Comment by auto [ 24/Jul/13 ]

Author:

{u'username': u'tadmarshall', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-6071 Visual Studio – add db/repl/sync_source_feedback.

{cpp,h}

Branch: master
https://github.com/mongodb/mongo/commit/9ba3ea135b9f8e13e32c737899e301c73eedf735

Comment by auto [ 22/Jul/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-6071 Use command on local.slaves instead of cursor

rearranged locking to prevent deadlocks
syncSourceFeedback methods use OIDs instead of BSONObj containing OIDs now
wrapped percolate so that it is not called when it is not needed
Branch: master
https://github.com/mongodb/mongo/commit/96c541693cc5b6954a5286788f7ef88f5c680bc6

Comment by auto [ 22/Jul/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: Revert "Revert "SERVER-6071 use command on local.slaves instead of cursor""

This reverts commit 6486b4035c5ac52679eb3e1a034c925ccdd20deb.
Branch: master
https://github.com/mongodb/mongo/commit/27c4e7fbd2ef6eeb04dccd1bcdecdb21b00522d1

Comment by auto [ 13/Jul/13 ]

Author:

{u'username': u'tadmarshall', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-6071 Visual Studio – remove db/repl/sync_source_feedback.

{cpp,h}

Branch: master
https://github.com/mongodb/mongo/commit/f204f7fdc3ab8a25f37e6700b9801a468417a7f2

Comment by auto [ 12/Jul/13 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: Revert "SERVER-6071 use command on local.slaves instead of cursor"

This reverts commit 2267744af0e972bceccb4ff4e9ed19a1ed639d2e.

Revert "SERVER-6071 correct assert code"

This reverts commit 85ca38c33e4aaebad539e78a05aed329b09c1208.

Conflicts:
src/mongo/db/repl/sync_source_feedback.cpp

Revert "SERVER-6071 use command on local.slaves instead of cursor"

This reverts commit 83ecb9775b7997dd5115c53f6ea30d2e368a4244.

Conflicts:
src/mongo/db/repl/replset_commands.cpp
src/mongo/db/repl/sync_source_feedback.cpp
Branch: master
https://github.com/mongodb/mongo/commit/6486b4035c5ac52679eb3e1a034c925ccdd20deb

Comment by auto [ 01/Jul/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-6071 use command on local.slaves instead of cursor

fixed a bug where we would have to wait for a command to timeout on a dead syncsource
now we check that the sync target hasnt changed before using the connection
Branch: master
https://github.com/mongodb/mongo/commit/2267744af0e972bceccb4ff4e9ed19a1ed639d2e

Comment by auto [ 30/Jun/13 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-6071 correct assert code
Branch: master
https://github.com/mongodb/mongo/commit/85ca38c33e4aaebad539e78a05aed329b09c1208

Comment by auto [ 30/Jun/13 ]

Author:

{u'username': u'dannenberg', u'name': u'Matt Dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-6071 use command on local.slaves instead of cursor
Branch: master
https://github.com/mongodb/mongo/commit/83ecb9775b7997dd5115c53f6ea30d2e368a4244

Comment by Eric Milkie [ 14/Jun/13 ]

backport possibly to 2.4.

Comment by Eliot Horowitz (Inactive) [ 17/May/13 ]

Command would be fine.

Comment by Eric Milkie [ 16/May/13 ]

How about using a command instead? Avoids locking the local database.
At connection initiation time, attempt to run the command the first time and if it returns an error (due to old mongod on sync source), then revert back to query-oplog.

Comment by Eric Milkie [ 05/Mar/13 ]

This will help write concern latency since secondaries will be more accurate/timely in reporting where they are in the oplog.

Comment by Kristina Chodorow (Inactive) [ 11/Jun/12 ]

Looks like this changed here: SERVER-5183

Generated at Thu Feb 08 03:10:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.