You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2014/01/23 00:09:08 UTC
[1/2] git commit: Added a logging message in log recover process.
Updated Branches:
refs/heads/bmahler_subprocess [created] de412dba1
Added a logging message in log recover process.
From: Jie Yu <yu...@gmail.com>
Review: https://reviews.apache.org/r/17202
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3960b209
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3960b209
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3960b209
Branch: refs/heads/bmahler_subprocess
Commit: 3960b2098d7882492dc855fe19667721214ff987
Parents: f7a9159
Author: Benjamin Mahler <bm...@twitter.com>
Authored: Wed Jan 22 15:08:14 2014 -0800
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Wed Jan 22 15:08:14 2014 -0800
----------------------------------------------------------------------
src/log/recover.cpp | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3960b209/src/log/recover.cpp
----------------------------------------------------------------------
diff --git a/src/log/recover.cpp b/src/log/recover.cpp
index 0f827d7..ee38acd 100644
--- a/src/log/recover.cpp
+++ b/src/log/recover.cpp
@@ -332,6 +332,10 @@ private:
uint64_t begin = lowestBeginPosition.get();
uint64_t end = highestEndPosition.get();
+ LOG(INFO) << "Starting catch-up from position "
+ << lowestBeginPosition.get() << " to "
+ << highestEndPosition.get();
+
set<uint64_t> positions;
for (uint64_t p = begin; p <= end; ++p) {
positions.insert(p);
[2/2] git commit: Added a test that verifies a non-voting replica
does not reply to promise/write requests.
Posted by bm...@apache.org.
Added a test that verifies a non-voting replica does not reply to
promise/write requests.
From: Jie Yu <yu...@gmail.com>
Review: https://reviews.apache.org/r/17203
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/de412dba
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/de412dba
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/de412dba
Branch: refs/heads/bmahler_subprocess
Commit: de412dba1b90dee3b1f55f6646120e008fadc793
Parents: 3960b20
Author: Benjamin Mahler <bm...@twitter.com>
Authored: Wed Jan 22 15:08:26 2014 -0800
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Wed Jan 22 15:08:26 2014 -0800
----------------------------------------------------------------------
src/tests/log_tests.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/de412dba/src/tests/log_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/log_tests.cpp b/src/tests/log_tests.cpp
index 046e96f..e493af4 100644
--- a/src/tests/log_tests.cpp
+++ b/src/tests/log_tests.cpp
@@ -323,6 +323,49 @@ TEST_F(ReplicaTest, Restore)
}
+// This test verifies that a non-VOTING replica does not reply to
+// promise or write requests.
+TEST_F(ReplicaTest, NonVoting)
+{
+ const string path = os::getcwd() + "/.log";
+
+ Replica replica(path);
+
+ PromiseRequest promiseRequest;
+ promiseRequest.set_proposal(2);
+
+ Future<PromiseResponse> promiseResponse =
+ protocol::promise(replica.pid(), promiseRequest);
+
+ // Flush the event queue to make sure that if the replica could
+ // reply to the promise request, the future 'promiseResponse' would
+ // be satisfied before the pending check below.
+ Clock::pause();
+ Clock::settle();
+ Clock::resume();
+
+ EXPECT_TRUE(promiseResponse.isPending());
+
+ WriteRequest writeRequest;
+ writeRequest.set_proposal(3);
+ writeRequest.set_position(1);
+ writeRequest.set_type(Action::APPEND);
+ writeRequest.mutable_append()->set_bytes("hello world");
+
+ Future<WriteResponse> writeResponse =
+ protocol::write(replica.pid(), writeRequest);
+
+ // Flush the event queue to make sure that if the replica could
+ // reply to the write request, the future 'writeResponse' would be
+ // satisfied before the pending check below.
+ Clock::pause();
+ Clock::settle();
+ Clock::resume();
+
+ EXPECT_TRUE(writeResponse.isPending());
+}
+
+
class CoordinatorTest : public TemporaryDirectoryTest
{
protected: