diff --git a/db/repl/health.cpp b/db/repl/health.cpp index afadff77cb7..bce57873aa9 100644 --- a/db/repl/health.cpp +++ b/db/repl/health.cpp @@ -41,6 +41,7 @@ namespace mongo { } } cmdReplSetHeartbeat; + /* poll every other set member to check its status */ class FeedbackThread : public BackgroundJob { public: ReplSet::MemberInfo *m; @@ -51,6 +52,9 @@ namespace mongo { BSONObj info; bool ok = conn.simpleCommand("admin", &info, "replSetHeartbeat"); log() << "TEMP heartbeat " << ok << ' ' << info.toString() << endl; + if( ok ) { + m->lastHeartbeat = time(0); + } } catch(...) { log() << "TEMP heartbeat not ok" << endl; diff --git a/db/repl/replset.h b/db/repl/replset.h index 42d8fa2f64c..88e9112b8c4 100644 --- a/db/repl/replset.h +++ b/db/repl/replset.h @@ -59,8 +59,9 @@ namespace mongo { const char *host; int port; - int lastHeartbeat; + time_t lastHeartbeat; }; + /* all members of the set EXCEPT SELF. */ List1 _members; void startHealthThreads();