You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by gj...@apache.org on 2019/10/28 20:56:40 UTC

[phoenix] branch master updated: PHOENIX-5541 - Redundant Global Mutable Index Writes on Legacy Indexer

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 6ce24ab  PHOENIX-5541 - Redundant Global Mutable Index Writes on Legacy Indexer
6ce24ab is described below

commit 6ce24abf310ff1d0fb8976a02be5758a6d311ab2
Author: Geoffrey Jacoby <gj...@apache.org>
AuthorDate: Wed Oct 23 12:12:35 2019 -0500

    PHOENIX-5541 - Redundant Global Mutable Index Writes on Legacy Indexer
---
 .../org/apache/phoenix/hbase/index/Indexer.java    |  6 +++---
 .../phoenix/hbase/index/write/IndexWriter.java     | 22 ++--------------------
 2 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
index 2e7780d..7fc86c3 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java
@@ -610,7 +610,7 @@ public class Indexer implements RegionObserver, RegionCoprocessor {
           long start = EnvironmentEdgeManager.currentTimeMillis();
           
           current.addTimelineAnnotation("Actually doing index update for first time");
-          writer.writeAndKillYourselfOnFailure(context.indexUpdates, false, context.clientVersion);
+          writer.writeAndHandleFailure(context.indexUpdates, false, context.clientVersion);
 
           long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
           if (duration >= slowIndexWriteThreshold) {
@@ -664,7 +664,7 @@ public class Indexer implements RegionObserver, RegionCoprocessor {
         // do the usual writer stuff, killing the server again, if we can't manage to make the index
         // writes succeed again
         try {
-            writer.writeAndKillYourselfOnFailure(updates, true, ScanUtil.UNKNOWN_CLIENT_VERSION);
+            writer.writeAndHandleFailure(updates, true, ScanUtil.UNKNOWN_CLIENT_VERSION);
         } catch (IOException e) {
                 LOGGER.error("During WAL replay of outstanding index updates, "
                         + "Exception is thrown instead of killing server during index writing", e);
@@ -704,7 +704,7 @@ public class Indexer implements RegionObserver, RegionCoprocessor {
            * hopes they come up before the primary table finishes.
            */
           Collection<Pair<Mutation, byte[]>> indexUpdates = extractIndexUpdate(logEdit);
-          recoveryWriter.writeAndKillYourselfOnFailure(indexUpdates, true, ScanUtil.UNKNOWN_CLIENT_VERSION);
+          recoveryWriter.writeAndHandleFailure(indexUpdates, true, ScanUtil.UNKNOWN_CLIENT_VERSION);
       } finally {
           long duration = EnvironmentEdgeManager.currentTimeMillis() - start;
           if (duration >= slowPreWALRestoreThreshold) {
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriter.java b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriter.java
index fefcd9b..ca38e43 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriter.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriter.java
@@ -163,32 +163,14 @@ public class IndexWriter implements Stoppable {
    * @param clientVersion version of the client
    * @throws IOException
    */
-  public void writeAndKillYourselfOnFailure(Collection<Pair<Mutation, byte[]>> indexUpdates,
-                                            boolean allowLocalUpdates, int clientVersion) throws IOException {
+  public void writeAndHandleFailure(Collection<Pair<Mutation, byte[]>> indexUpdates,
+                                    boolean allowLocalUpdates, int clientVersion) throws IOException {
       // convert the strings to htableinterfaces to which we can talk and group by TABLE
       Multimap<HTableInterfaceReference, Mutation> toWrite = resolveTableReferences(indexUpdates);
-      writeAndKillYourselfOnFailure(toWrite, allowLocalUpdates, clientVersion);
       writeAndHandleFailure(toWrite, allowLocalUpdates, clientVersion);
   }
 
   /**
-   * see {@link #writeAndKillYourselfOnFailure(Collection)}.
-   * @param toWrite
-   * @throws IOException
-   */
-  public void writeAndKillYourselfOnFailure(Multimap<HTableInterfaceReference, Mutation> toWrite,
-                                            boolean allowLocalUpdates, int clientVersion) throws IOException {
-    try {
-      write(toWrite, allowLocalUpdates, clientVersion);
-      if (LOGGER.isTraceEnabled()) {
-        LOGGER.trace("Done writing all index updates!\n\t" + toWrite);
-      }
-    } catch (Exception e) {
-      this.failurePolicy.handleFailure(toWrite, e);
-    }
-  }
-
-  /**
    * Write the mutations to their respective table.
    * <p>
    * This method is blocking and could potentially cause the writer to block for a long time as we