Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A876518CE3 for ; Mon, 1 Jun 2015 17:46:40 +0000 (UTC) Received: (qmail 82537 invoked by uid 500); 1 Jun 2015 17:46:40 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 82516 invoked by uid 500); 1 Jun 2015 17:46:40 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 82503 invoked by uid 99); 1 Jun 2015 17:46:40 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2015 17:46:40 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id F0D391DDDE6; Mon, 1 Jun 2015 17:46:37 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============3960639412799811011==" MIME-Version: 1.0 Subject: Re: Review Request 34646: Redirect to the leader master when current master is not a leader. From: "Adam B" To: "Adam B" Cc: "haosdent huang" , "mesos" Date: Mon, 01 Jun 2015 17:46:37 -0000 Message-ID: <20150601174637.3246.31391@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Adam B" X-ReviewGroup: mesos X-ReviewRequest-URL: https://reviews.apache.org/r/34646/ X-Sender: "Adam B" References: <20150601083434.3246.65393@reviews.apache.org> In-Reply-To: <20150601083434.3246.65393@reviews.apache.org> Reply-To: "Adam B" X-ReviewRequest-Repository: mesos --===============3960639412799811011== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On June 1, 2015, 1:34 a.m., Adam B wrote: > > src/master/http.cpp, line 1038 > > > > > > Could I ask you to write a quick unit test for this? > > haosdent huang wrote: > yes > > haosdent huang wrote: > @adam-mesos, I have a newbie problem. In the unit test, do I start a multi-masters cluster to verify this? I search the exist unit tests, could not find a exist snippet to start a multi-masters cluster. Good question. Our unit test macros are not well documented, so I usually find a couple of example tests to copy from. Check out MasterAllocatorTest.FrameworkReregistersFirst and MasterAllocatorTest.SlaveReregistersFirst, which actually do failover and leader-election between two masters. https://github.com/apache/mesos/blob/0.22.1/src/tests/master_allocator_tests.cpp#L1295 - Adam ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/34646/#review85955 ----------------------------------------------------------- On June 1, 2015, 8:07 a.m., haosdent huang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/34646/ > ----------------------------------------------------------- > > (Updated June 1, 2015, 8:07 a.m.) > > > Review request for mesos and Adam B. > > > Bugs: MESOS-1865 > https://issues.apache.org/jira/browse/MESOS-1865 > > > Repository: mesos > > > Description > ------- > > Return empty task list when current master is not a leader. > > > Diffs > ----- > > src/master/http.cpp 01dbdad9720a9cd30505683ae1117970cda918a0 > src/master/master.hpp c0cc2933a2cc094401f633df12356bda3d294564 > > Diff: https://reviews.apache.org/r/34646/diff/ > > > Testing > ------- > > make check > > when current master is not a leader, it would redirect to the leader master. > > ``` > $ curl -i http://master1:5050/master/tasks.json > HTTP/1.1 307 Temporary Redirect > Date: Mon, 01 Jun 2015 06:30:08 GMT > Location: http://master2:5050//master/tasks.json > Content-Length: 0 > ``` > > > Thanks, > > haosdent huang > > --===============3960639412799811011==--