Repository: mesos
Updated Branches:
  refs/heads/master 5058fac10 -> 575f3b352


Added source address to logging when we receive replicated log events.

Fixes MESOS-3417.

Review: https://reviews.apache.org/r/39104


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/575f3b35
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/575f3b35
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/575f3b35

Branch: refs/heads/master
Commit: 575f3b352f176c9801f51f0e6f61cf5c3a02167c
Parents: 5058fac
Author: Neil Conway <[email protected]>
Authored: Wed Oct 7 21:20:38 2015 -0700
Committer: Adam B <[email protected]>
Committed: Wed Oct 7 21:22:06 2015 -0700

----------------------------------------------------------------------
 src/log/replica.cpp | 40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/575f3b35/src/log/replica.cpp
----------------------------------------------------------------------
diff --git a/src/log/replica.cpp b/src/log/replica.cpp
index 2bfcc3e..75d39ff 100644
--- a/src/log/replica.cpp
+++ b/src/log/replica.cpp
@@ -105,16 +105,16 @@ public:
 private:
   // Handles a request from a proposer to promise not to accept writes
   // from any other proposer with lower proposal number.
-  void promise(const PromiseRequest& request);
+  void promise(const UPID& from, const PromiseRequest& request);
 
   // Handles a request from a proposer to write an action.
-  void write(const WriteRequest& request);
+  void write(const UPID& from, const WriteRequest& request);
 
   // Handles a request from a recover process.
-  void recover(const RecoverRequest& request);
+  void recover(const UPID& from, const RecoverRequest& request);
 
   // Handles a message notifying of a learned action.
-  void learned(const Action& action);
+  void learned(const UPID& from, const Action& action);
 
   // Helper routines that write a record corresponding to the
   // specified argument. Returns true on success and false otherwise.
@@ -365,18 +365,19 @@ bool ReplicaProcess::update(uint64_t promised)
 // procedure.
 
 
-void ReplicaProcess::promise(const PromiseRequest& request)
+void ReplicaProcess::promise(const UPID& from, const PromiseRequest& request)
 {
   // Ignore promise requests if this replica is not in VOTING status.
   if (status() != Metadata::VOTING) {
-    LOG(INFO) << "Replica ignoring promise request as it is in "
-              << status() << " status";
+    LOG(INFO) << "Replica ignoring promise request from " << from
+              << " as it is in " << status() << " status";
     return;
   }
 
   if (request.has_position()) {
-    LOG(INFO) << "Replica received explicit promise request for position "
-              << request.position() << " with proposal " << request.proposal();
+    LOG(INFO) << "Replica received explicit promise request from " << from
+              << " for position " << request.position()
+              << " with proposal " << request.proposal();
 
     // If the position has been truncated, tell the proposer that it's
     // a learned no-op. This can happen when a replica has missed some
@@ -474,8 +475,8 @@ void ReplicaProcess::promise(const PromiseRequest& request)
       }
     }
   } else {
-    LOG(INFO) << "Replica received implicit promise request with proposal "
-              << request.proposal();
+    LOG(INFO) << "Replica received implicit promise request from " << from
+              << " with proposal " << request.proposal();
 
     if (request.proposal() <= promised()) {
       // Only make an implicit promise once!
@@ -499,17 +500,17 @@ void ReplicaProcess::promise(const PromiseRequest& 
request)
 }
 
 
-void ReplicaProcess::write(const WriteRequest& request)
+void ReplicaProcess::write(const UPID& from, const WriteRequest& request)
 {
   // Ignore write requests if this replica is not in VOTING status.
   if (status() != Metadata::VOTING) {
-    LOG(INFO) << "Replica ignoring write request as it is in "
-              << status() << " status";
+    LOG(INFO) << "Replica ignoring write request from " << from
+              << " as it is in " << status() << " status";
     return;
   }
 
   LOG(INFO) << "Replica received write request for position "
-            << request.position();
+            << request.position() << " from " << from;
 
   Result<Action> result = read(request.position());
 
@@ -636,10 +637,11 @@ void ReplicaProcess::write(const WriteRequest& request)
 }
 
 
-void ReplicaProcess::recover(const RecoverRequest& request)
+void ReplicaProcess::recover(const UPID& from, const RecoverRequest& request)
 {
   LOG(INFO) << "Replica in " << status()
-            << " status received a broadcasted recover request";
+            << " status received a broadcasted recover request from "
+            << from;
 
   RecoverResponse response;
   response.set_status(status());
@@ -653,10 +655,10 @@ void ReplicaProcess::recover(const RecoverRequest& 
request)
 }
 
 
-void ReplicaProcess::learned(const Action& action)
+void ReplicaProcess::learned(const UPID& from, const Action& action)
 {
   LOG(INFO) << "Replica received learned notice for position "
-            << action.position();
+            << action.position() << " from " << from;
 
   CHECK(action.learned());
 

Reply via email to