You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/08/27 16:41:47 UTC

[GitHub] [hbase] shahrs87 commented on a change in pull request #3636: HBASE-26106 AbstractFSWALProvider#getArchivedLogPath doesn't look for wal file in all oldWALs directory.

shahrs87 commented on a change in pull request #3636:
URL: https://github.com/apache/hbase/pull/3636#discussion_r697579396



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java
##########
@@ -536,74 +536,6 @@ public static Path findArchivedLog(Path path, Configuration conf) throws IOExcep
     return null;
   }
 
-  /**
-   * Opens WAL reader with retries and additional exception handling
-   * @param path path to WAL file
-   * @param conf configuration
-   * @return WAL Reader instance
-   */
-  public static org.apache.hadoop.hbase.wal.WAL.Reader openReader(Path path, Configuration conf)

Review comment:
       This method is not called anywhere so removing it.

##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java
##########
@@ -536,74 +536,6 @@ public static Path findArchivedLog(Path path, Configuration conf) throws IOExcep
     return null;
   }
 
-  /**
-   * Opens WAL reader with retries and additional exception handling
-   * @param path path to WAL file
-   * @param conf configuration
-   * @return WAL Reader instance
-   */
-  public static org.apache.hadoop.hbase.wal.WAL.Reader openReader(Path path, Configuration conf)
-      throws IOException {
-    long retryInterval = 2000; // 2 sec
-    int maxAttempts = 30;
-    int attempt = 0;
-    Exception ee = null;
-    org.apache.hadoop.hbase.wal.WAL.Reader reader = null;
-    while (reader == null && attempt++ < maxAttempts) {
-      try {
-        // Detect if this is a new file, if so get a new reader else
-        // reset the current reader so that we see the new data
-        reader = WALFactory.createReader(path.getFileSystem(conf), path, conf);
-        return reader;
-      } catch (FileNotFoundException fnfe) {
-        // If the log was archived, continue reading from there
-        Path archivedLog = AbstractFSWALProvider.getArchivedLogPath(path, conf);
-        if (!Objects.equals(path, archivedLog)) {
-          return openReader(archivedLog, conf);
-        } else {
-          throw fnfe;
-        }
-      } catch (LeaseNotRecoveredException lnre) {
-        // HBASE-15019 the WAL was not closed due to some hiccup.
-        LOG.warn("Try to recover the WAL lease " + path, lnre);
-        recoverLease(conf, path);
-        reader = null;
-        ee = lnre;
-      } catch (NullPointerException npe) {
-        // Workaround for race condition in HDFS-4380
-        // which throws a NPE if we open a file before any data node has the most recent block
-        // Just sleep and retry. Will require re-reading compressed WALs for compressionContext.
-        LOG.warn("Got NPE opening reader, will retry.");
-        reader = null;
-        ee = npe;
-      }
-      if (reader == null) {
-        // sleep before next attempt
-        try {
-          Thread.sleep(retryInterval);
-        } catch (InterruptedException e) {
-        }
-      }
-    }
-    throw new IOException("Could not open reader", ee);
-  }
-
-  // For HBASE-15019
-  private static void recoverLease(final Configuration conf, final Path path) {

Review comment:
       This method is not called anywhere so removing it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org