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 851D6200C3B for ; Sat, 11 Feb 2017 00:56:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 83E58160B5C; Fri, 10 Feb 2017 23:56:01 +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 B0664160B69 for ; Sat, 11 Feb 2017 00:56:00 +0100 (CET) Received: (qmail 43167 invoked by uid 500); 10 Feb 2017 23:55:59 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 43121 invoked by uid 99); 10 Feb 2017 23:55:59 -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; Fri, 10 Feb 2017 23:55:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9B525E001C; Fri, 10 Feb 2017 23:55:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jjirsa@apache.org To: commits@cassandra.apache.org Date: Fri, 10 Feb 2017 23:56:00 -0000 Message-Id: In-Reply-To: <081192d4257f491d85ebc4589a1a2fe5@git.apache.org> References: <081192d4257f491d85ebc4589a1a2fe5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/6] cassandra git commit: CASSANDRA-13205: Hint message should also include IP address of the destination archived-at: Fri, 10 Feb 2017 23:56:01 -0000 CASSANDRA-13205: Hint message should also include IP address of the destination Patch by Jeff Jirsa; Reviewed by Blake Eggleston for CASSANDRA-13205 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/0cc1c1b2 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0cc1c1b2 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0cc1c1b2 Branch: refs/heads/cassandra-3.11 Commit: 0cc1c1b2a8e66905d3f672645e820664d2220e10 Parents: 4e669cf Author: Jeff Jirsa Authored: Wed Feb 8 09:53:36 2017 -0800 Committer: Jeff Jirsa Committed: Fri Feb 10 15:52:49 2017 -0800 ---------------------------------------------------------------------- CHANGES.txt | 2 ++ .../org/apache/cassandra/hints/HintVerbHandler.java | 6 ++++-- .../apache/cassandra/hints/HintsDispatchExecutor.java | 13 +++++++------ src/java/org/apache/cassandra/hints/HintsReader.java | 7 +++++-- 4 files changed, 18 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/0cc1c1b2/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 91bfe12..007d06c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,6 @@ 3.0.11 + * Hint related logging should include the IP address of the destination in addition to + host ID (CASSANDRA-13205) * Reloading logback.xml does not work (CASSANDRA-13173) * Lightweight transactions temporarily fail after upgrade from 2.1 to 3.0 (CASSANDRA-13109) * Duplicate rows after upgrading from 2.1.16 to 3.0.10/3.9 (CASSANDRA-13125) http://git-wip-us.apache.org/repos/asf/cassandra/blob/0cc1c1b2/src/java/org/apache/cassandra/hints/HintVerbHandler.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/hints/HintVerbHandler.java b/src/java/org/apache/cassandra/hints/HintVerbHandler.java index 1fa479c..2b92a42 100644 --- a/src/java/org/apache/cassandra/hints/HintVerbHandler.java +++ b/src/java/org/apache/cassandra/hints/HintVerbHandler.java @@ -47,6 +47,7 @@ public final class HintVerbHandler implements IVerbHandler { UUID hostId = message.payload.hostId; Hint hint = message.payload.hint; + InetAddress address = StorageService.instance.getEndpointForHostId(hostId); // If we see an unknown table id, it means the table, or one of the tables in the mutation, had been dropped. // In that case there is nothing we can really do, or should do, other than log it go on. @@ -54,7 +55,8 @@ public final class HintVerbHandler implements IVerbHandler // is schema agreement between the sender and the receiver. if (hint == null) { - logger.trace("Failed to decode and apply a hint for {} - table with id {} is unknown", + logger.trace("Failed to decode and apply a hint for {}: {} - table with id {} is unknown", + address, hostId, message.payload.unknownTableID); reply(id, message.from); @@ -68,7 +70,7 @@ public final class HintVerbHandler implements IVerbHandler } catch (MarshalException e) { - logger.warn("Failed to validate a hint for {} (table id {}) - skipped", hostId); + logger.warn("Failed to validate a hint for {}: {} - skipped", address, hostId); reply(id, message.from); return; } http://git-wip-us.apache.org/repos/asf/cassandra/blob/0cc1c1b2/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java b/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java index 5292dc1..333232d 100644 --- a/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java +++ b/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java @@ -137,11 +137,12 @@ final class HintsDispatchExecutor public void run() { UUID hostId = hostIdSupplier.get(); - logger.info("Transferring all hints to {}", hostId); + InetAddress address = StorageService.instance.getEndpointForHostId(hostId); + logger.info("Transferring all hints to {}: {}", address, hostId); if (transfer(hostId)) return; - logger.warn("Failed to transfer all hints to {}; will retry in {} seconds", hostId, 10); + logger.warn("Failed to transfer all hints to {}: {}; will retry in {} seconds", address, hostId, 10); try { @@ -153,10 +154,10 @@ final class HintsDispatchExecutor } hostId = hostIdSupplier.get(); - logger.info("Transferring all hints to {}", hostId); + logger.info("Transferring all hints to {}: {}", address, hostId); if (!transfer(hostId)) { - logger.error("Failed to transfer all hints to {}", hostId); + logger.error("Failed to transfer all hints to {}: {}", address, hostId); throw new RuntimeException("Failed to transfer all hints to " + hostId); } } @@ -260,14 +261,14 @@ final class HintsDispatchExecutor { store.delete(descriptor); store.cleanUp(descriptor); - logger.info("Finished hinted handoff of file {} to endpoint {}", descriptor.fileName(), hostId); + logger.info("Finished hinted handoff of file {} to endpoint {}: {}", descriptor.fileName(), address, hostId); return true; } else { store.markDispatchOffset(descriptor, dispatcher.dispatchOffset()); store.offerFirst(descriptor); - logger.info("Finished hinted handoff of file {} to endpoint {}, partially", descriptor.fileName(), hostId); + logger.info("Finished hinted handoff of file {} to endpoint {}: {}, partially", descriptor.fileName(), address, hostId); return false; } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/0cc1c1b2/src/java/org/apache/cassandra/hints/HintsReader.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/hints/HintsReader.java b/src/java/org/apache/cassandra/hints/HintsReader.java index fe2b57a..ef24aca 100644 --- a/src/java/org/apache/cassandra/hints/HintsReader.java +++ b/src/java/org/apache/cassandra/hints/HintsReader.java @@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory; import org.apache.cassandra.db.UnknownColumnFamilyException; import org.apache.cassandra.io.FSReadError; +import org.apache.cassandra.service.StorageService; import org.apache.cassandra.utils.AbstractIterator; import org.apache.cassandra.utils.ByteBufferUtil; import org.apache.cassandra.utils.CLibrary; @@ -225,7 +226,8 @@ class HintsReader implements AutoCloseable, Iterable } catch (UnknownColumnFamilyException e) { - logger.warn("Failed to read a hint for {} - table with id {} is unknown in file {}", + logger.warn("Failed to read a hint for {}: {} - table with id {} is unknown in file {}", + StorageService.instance.getEndpointForHostId(descriptor.hostId), descriptor.hostId, e.cfId, descriptor.fileName()); @@ -238,7 +240,8 @@ class HintsReader implements AutoCloseable, Iterable return hint; // log a warning and skip the corrupted entry - logger.warn("Failed to read a hint for {} - digest mismatch for hint at position {} in file {}", + logger.warn("Failed to read a hint for {}: {} - digest mismatch for hint at position {} in file {}", + StorageService.instance.getEndpointForHostId(descriptor.hostId), descriptor.hostId, input.getPosition() - size - 4, descriptor.fileName());