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:42:39 UTC
[phoenix] branch 4.14-HBase-1.3 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 4.14-HBase-1.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.14-HBase-1.3 by this push:
new 747dfdd PHOENIX-5541 - Redundant Global Mutable Index Writes on Legacy Indexer
747dfdd is described below
commit 747dfdd22f1504d8b4e77dc161453dd9c50360d9
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 ff8b555..89980ac 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
@@ -615,7 +615,7 @@ public class Indexer extends BaseRegionObserver {
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) {
@@ -685,7 +685,7 @@ public class Indexer extends BaseRegionObserver {
// 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);
@@ -723,7 +723,7 @@ public class Indexer extends BaseRegionObserver {
* 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