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 6233C200C68 for ; Tue, 18 Apr 2017 22:28:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 60A29160B87; Tue, 18 Apr 2017 20:28:26 +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 AA419160BA1 for ; Tue, 18 Apr 2017 22:28:25 +0200 (CEST) Received: (qmail 24326 invoked by uid 500); 18 Apr 2017 20:28:24 -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 24045 invoked by uid 99); 18 Apr 2017 20:28:24 -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, 18 Apr 2017 20:28:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6F048DFDAC; Tue, 18 Apr 2017 20:28:24 +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: Tue, 18 Apr 2017 20:28:25 -0000 Message-Id: <47f4de43634b4e7093592461777f7f7a@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/6] cassandra git commit: Handling partially written hint files archived-at: Tue, 18 Apr 2017 20:28:26 -0000 Handling partially written hint files Patch by Garvit Juniwal; Reviewed by Aleksey Yeschenko for CASSANDRA-12728 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3110d27d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3110d27d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3110d27d Branch: refs/heads/cassandra-3.11 Commit: 3110d27dde2d518297e118c2f1f6b6bccfed7899 Parents: 71d4f66 Author: Jeff Jirsa Authored: Tue Apr 4 11:31:29 2017 -0700 Committer: Jeff Jirsa Committed: Tue Apr 18 13:25:54 2017 -0700 ---------------------------------------------------------------------- CHANGES.txt | 2 +- src/java/org/apache/cassandra/hints/HintsReader.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/3110d27d/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index e46abcd..918c46b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ 3.0.14 - * + * Handling partially written hint files (CASSANDRA-12728) 3.0.13 * Make reading of range tombstones more reliable (CASSANDRA-12811) http://git-wip-us.apache.org/repos/asf/cassandra/blob/3110d27d/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 d88c4f5..8104051 100644 --- a/src/java/org/apache/cassandra/hints/HintsReader.java +++ b/src/java/org/apache/cassandra/hints/HintsReader.java @@ -17,6 +17,7 @@ */ package org.apache.cassandra.hints; +import java.io.EOFException; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; @@ -188,6 +189,11 @@ class HintsReader implements AutoCloseable, Iterable { hint = computeNextInternal(); } + catch (EOFException e) + { + logger.warn("Unexpected EOF replaying hints ({}), likely due to unflushed hint file on shutdown; continuing", descriptor.fileName(), e); + return endOfData(); + } catch (IOException e) { throw new FSReadError(e, file); @@ -280,6 +286,11 @@ class HintsReader implements AutoCloseable, Iterable { buffer = computeNextInternal(); } + catch (EOFException e) + { + logger.warn("Unexpected EOF replaying hints ({}), likely due to unflushed hint file on shutdown; continuing", descriptor.fileName(), e); + return endOfData(); + } catch (IOException e) { throw new FSReadError(e, file);