Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F04DD200BA6 for ; Tue, 4 Oct 2016 03:01:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EBD09160ADC; Tue, 4 Oct 2016 01:01:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3307B160AEC for ; Tue, 4 Oct 2016 03:01:14 +0200 (CEST) Received: (qmail 21573 invoked by uid 500); 4 Oct 2016 01:01:13 -0000 Mailing-List: contact commits-help@kudu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kudu.apache.org Delivered-To: mailing list commits@kudu.apache.org Received: (qmail 21501 invoked by uid 99); 4 Oct 2016 01:01:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2016 01:01:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1C526E009E; Tue, 4 Oct 2016 01:01:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: todd@apache.org To: commits@kudu.apache.org Date: Tue, 04 Oct 2016 01:01:15 -0000 Message-Id: <20acefd81d054a99bb867ec3733c7e34@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/3] kudu git commit: Remove newlines from raft_consensus.cc state logging archived-at: Tue, 04 Oct 2016 01:01:15 -0000 Remove newlines from raft_consensus.cc state logging Removes an explicit newline from ReplicaState::ToStringUnlocked, which was causing split log lines in raft_consensus.cc. Before: I0930 15:01:06.197114 292159488 raft_consensus.cc:505] T 00000000000000000000000000000000 P a65e9f463a254ae1a7e34a1a8e4cc7cc [term 0 FOLLOWER]: Becoming Follower/Learner. State: Replica: a65e9f463a254ae1a7e34a1a8e4cc7cc, State: 1, Role: FOLLOWER Watermarks: {Received: term: 0 index: 0 Committed: term: 0 index: 0} After: I0930 14:51:09.334908 360529920 raft_consensus.cc:505] T 00000000000000000000000000000000 P d2878bd460384b8ab58dd3aaf2c8f52d [term 0 FOLLOWER]: Becoming Follower/Learner. State: Replica: d2878bd460384b8ab58dd3aaf2c8f52d, State: 1, Role: FOLLOWER, Watermarks: {Received: term: 0 index: 0, Committed: term: 0 index: 0} Change-Id: If1f3db96ece79e81b42bce4db51d37f14df14f50 Reviewed-on: http://gerrit.cloudera.org:8080/4580 Tested-by: Kudu Jenkins Reviewed-by: David Ribeiro Alves Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/e0c6ced3 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/e0c6ced3 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/e0c6ced3 Branch: refs/heads/master Commit: e0c6ced3e848e490f24780488bebd0c46c6804a1 Parents: ddaf9b3 Author: Dan Burkert Authored: Fri Sep 30 14:59:25 2016 -0700 Committer: Todd Lipcon Committed: Tue Oct 4 00:59:19 2016 +0000 ---------------------------------------------------------------------- src/kudu/consensus/raft_consensus_state.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/e0c6ced3/src/kudu/consensus/raft_consensus_state.cc ---------------------------------------------------------------------- diff --git a/src/kudu/consensus/raft_consensus_state.cc b/src/kudu/consensus/raft_consensus_state.cc index 7763cb6..a212fad 100644 --- a/src/kudu/consensus/raft_consensus_state.cc +++ b/src/kudu/consensus/raft_consensus_state.cc @@ -696,15 +696,10 @@ string ReplicaState::ToString() const { string ReplicaState::ToStringUnlocked() const { DCHECK(update_lock_.is_locked()); - string ret; - SubstituteAndAppend(&ret, "Replica: $0, State: $1, Role: $2\n", - peer_uuid_, state_, - RaftPeerPB::Role_Name(GetActiveRoleUnlocked())); - - SubstituteAndAppend(&ret, "Watermarks: {Received: $0 Committed: $1}\n", - last_received_op_id_.ShortDebugString(), - last_committed_op_id_.ShortDebugString()); - return ret; + return Substitute("Replica: $0, State: $1, Role: $2, Watermarks: {Received: $3, Committed: $4}", + peer_uuid_, state_, RaftPeerPB::Role_Name(GetActiveRoleUnlocked()), + last_received_op_id_.ShortDebugString(), + last_committed_op_id_.ShortDebugString()); } Status ReplicaState::CheckOpInSequence(const OpId& previous, const OpId& current) {