This is an automated email from the ASF dual-hosted git repository.
gjacoby pushed a commit to branch 4.x-HBase-1.5
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.5 by this push:
new 16dcb75 PHOENIX-5541 - Redundant Global Mutable Index Writes on
Legacy Indexer
16dcb75 is described below
commit 16dcb753aabe6a05516d4be285e1cbf6ca47d82c
Author: Geoffrey Jacoby <[email protected]>
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 a3a5874..2ad3a32 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
@@ -617,7 +617,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) {
@@ -672,7 +672,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);
@@ -710,7 +710,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