summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/master_slave.h
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2014-07-16 14:30:35 -0400
committerSpencer T Brody <spencer@mongodb.com>2014-07-18 14:47:11 -0400
commit7c9e21b95804fde5a4837c5aab47ab9c2e57a267 (patch)
treea5e712c0d5bc29f6f32f2f80e3f1833f115190b8 /src/mongo/db/repl/master_slave.h
parentf6cc85d06aaa39cea2baaf8771932bb8c5672cf7 (diff)
downloadmongo-7c9e21b95804fde5a4837c5aab47ab9c2e57a267.tar.gz
SERVER-14442 Make ReplicationCoordinator responsible for constructing ReplSetUpdatePosition commands
Diffstat (limited to 'src/mongo/db/repl/master_slave.h')
-rw-r--r--src/mongo/db/repl/master_slave.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/repl/master_slave.h b/src/mongo/db/repl/master_slave.h
index 65e9384732c..15fd74b2176 100644
--- a/src/mongo/db/repl/master_slave.h
+++ b/src/mongo/db/repl/master_slave.h
@@ -101,8 +101,6 @@ namespace repl {
BSONObj _me;
- ReplSource();
-
void resyncDrop( OperationContext* txn, const std::string& db );
// call without the db mutex
void syncToTailOfRemoteLog();
@@ -128,6 +126,9 @@ namespace repl {
public:
OplogReader oplogReader;
+ // Returns the RID for this process. ensureMe() must have been called before this can be.
+ OID getMyRID() const { return _me["_id"].OID(); }
+
void applyOperation(OperationContext* txn, Database* db, const BSONObj& op);
std::string hostName; // ip addr or hostname plus optionally, ":<port>"
std::string _sourceName; // a logical source name.
@@ -142,6 +143,10 @@ namespace repl {
typedef std::vector< shared_ptr< ReplSource > > SourceVector;
static void loadAll(OperationContext* txn, SourceVector&);
explicit ReplSource(BSONObj);
+ // This is not the constructor you are looking for. Always prefer the version that takes
+ // a BSONObj. This is public only as a hack so that the ReplicationCoordinator can find
+ // out the process's RID in master/slave setups.
+ ReplSource();
/* -1 = error */
int sync(int& nApplied);