cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jji...@apache.org
Subject [1/6] cassandra git commit: Handling partially written hint files
Date Tue, 18 Apr 2017 20:28:24 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 71d4f66d7 -> 3110d27dd
  refs/heads/cassandra-3.11 be49029c1 -> 65c1fddbc
  refs/heads/trunk 8f5f54fb1 -> e52420624


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.0
Commit: 3110d27dde2d518297e118c2f1f6b6bccfed7899
Parents: 71d4f66
Author: Jeff Jirsa <jeff@jeffjirsa.net>
Authored: Tue Apr 4 11:31:29 2017 -0700
Committer: Jeff Jirsa <jeff@jeffjirsa.net>
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<HintsReader.Page>
                 {
                     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<HintsReader.Page>
                 {
                     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);


Mime
View raw message