accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ibe...@apache.org
Subject [accumulo] 01/01: Merge branch '1.8'
Date Thu, 25 Jan 2018 22:31:06 GMT
This is an automated email from the ASF dual-hosted git repository.

ibella pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit d99de2cbf3d2d44cb83e78aaa53a2073df1a6912
Merge: 8477d93 d46dd16
Author: Ivan Bella <ivan@bella.name>
AuthorDate: Thu Jan 25 17:29:53 2018 -0500

    Merge branch '1.8'
    
    Conflicts:
    	core/src/main/java/org/apache/accumulo/core/conf/Property.java
    	server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java

 .../org/apache/accumulo/core/conf/Property.java    |   8 +-
 .../org/apache/accumulo/fate/zookeeper/Retry.java  |  22 ++++-
 .../accumulo/fate/zookeeper/RetryFactory.java      |  29 ++++++
 .../accumulo/fate/zookeeper/RetryFactoryTest.java  |  12 +++
 .../apache/accumulo/fate/zookeeper/RetryTest.java  |  23 +++++
 .../org/apache/accumulo/tserver/TabletServer.java  |  18 ++--
 .../accumulo/tserver/log/TabletServerLogger.java   | 109 +++++++++++----------
 7 files changed, 155 insertions(+), 66 deletions(-)

diff --cc core/src/main/java/org/apache/accumulo/core/conf/Property.java
index 0dfb372,26762fb..2fd28a7
--- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
@@@ -280,13 -263,13 +280,13 @@@ public enum Property 
        "The maximum size for each write-ahead log. See comment for property tserver.memory.maps.max"),
    TSERV_WALOG_MAX_AGE("tserver.walog.max.age", "24h", PropertyType.TIMEDURATION, "The maximum
age for each write-ahead log."),
    TSERV_WALOG_TOLERATED_CREATION_FAILURES("tserver.walog.tolerated.creation.failures", "50",
PropertyType.COUNT,
-       "The maximum number of failures tolerated when creating a new write-ahead log within
the period specified by tserver.walog.failures.period."
-           + " Exceeding this number of failures in the period causes the TabletServer to
exit."),
 -      "The maximum number of failures tolerated when creating a new WAL file.  Values <
0 will allow unlimited creation failures."
 -          + " Exceeding this number of failures consecutively trying to create a new WAL
causes the TabletServer to exit."),
++      "The maximum number of failures tolerated when creating a new write-ahead log.  Values
< 0 will allow unlimited creation failures."
++          + " Exceeding this number of failures consecutively trying to create a new write-ahead
log causes the TabletServer to exit."),
    TSERV_WALOG_TOLERATED_WAIT_INCREMENT("tserver.walog.tolerated.wait.increment", "1000ms",
PropertyType.TIMEDURATION,
-       "The amount of time to wait between failures to create a WALog."),
 -      "The amount of time to wait between failures to create or write a WALog."),
++      "The amount of time to wait between failures to create or write a write-ahead log."),
    // Never wait longer than 5 mins for a retry
    TSERV_WALOG_TOLERATED_MAXIMUM_WAIT_DURATION("tserver.walog.maximum.wait.duration", "5m",
PropertyType.TIMEDURATION,
-       "The maximum amount of time to wait after a failure to create a write-ahead log."),
 -      "The maximum amount of time to wait after a failure to create or write a WAL file."),
++      "The maximum amount of time to wait after a failure to create or write a write-ahead
log."),
    TSERV_MAJC_DELAY("tserver.compaction.major.delay", "30s", PropertyType.TIMEDURATION,
        "Time a tablet server will sleep between checking which tablets need compaction."),
    TSERV_MAJC_THREAD_MAXOPEN("tserver.compaction.major.thread.files.open.max", "10", PropertyType.COUNT,
diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
index 32999fb,da3ef0b..c9445c0
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
@@@ -221,11 -221,11 +221,11 @@@ public class TabletServerLogger 
        if (next instanceof DfsLogger) {
          currentLog = (DfsLogger) next;
          logId.incrementAndGet();
 -        log.info("Using next log " + currentLog.getFileName());
 +        log.info("Using next log {}", currentLog.getFileName());
  
          // When we successfully create a WAL, make sure to reset the Retry.
-         if (null != retry) {
-           retry = null;
+         if (null != createRetry) {
+           createRetry = null;
          }
  
          this.createTime = System.currentTimeMillis();
@@@ -410,14 -413,19 +413,19 @@@
            success = (currentLogId == logId.get());
          }
        } catch (DfsLogger.LogClosedException ex) {
-         log.debug("Logs closed while writing, retrying {}", attempt);
 -        log.debug("Logs closed while writing, retrying attempt " + writeRetry.retriesCompleted());
++        log.debug("Logs closed while writing, retrying attempt {}", writeRetry.retriesCompleted());
        } catch (Exception t) {
-         if (attempt != 1) {
-           log.error("Unexpected error writing to log, retrying attempt " + attempt, t);
+         log.warn("Failed to write to WAL, retrying attempt " + writeRetry.retriesCompleted(),
t);
+ 
+         try {
+           // Backoff
+           writeRetry.waitForNextAttempt();
+         } catch (InterruptedException e) {
+           Thread.currentThread().interrupt();
+           throw new RuntimeException(e);
          }
-         sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
        } finally {
-         attempt++;
+         writeRetry.useRetry();
        }
        // Some sort of write failure occurred. Grab the write lock and reset the logs.
        // But since multiple threads will attempt it, only attempt the reset when

-- 
To stop receiving notification emails like this one, please contact
ibella@apache.org.

Mime
View raw message