Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B11B8200D04 for ; Mon, 11 Sep 2017 09:37:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AFA791609C4; Mon, 11 Sep 2017 07:37:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A74A11609C3 for ; Mon, 11 Sep 2017 09:37:04 +0200 (CEST) Received: (qmail 83600 invoked by uid 500); 11 Sep 2017 07:37:03 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 83589 invoked by uid 99); 11 Sep 2017 07:37:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Sep 2017 07:37:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 41FCCD246A for ; Mon, 11 Sep 2017 07:37:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id lZZki5dalUCV for ; Mon, 11 Sep 2017 07:37:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4B4745F640 for ; Mon, 11 Sep 2017 07:37:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8C448E099A for ; Mon, 11 Sep 2017 07:37:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4679B2414B for ; Mon, 11 Sep 2017 07:37:00 +0000 (UTC) Date: Mon, 11 Sep 2017 07:37:00 +0000 (UTC) From: "Samarth Jain (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (PHOENIX-4190) Salted local index failure is causing region server to abort MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 11 Sep 2017 07:37:05 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-4190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Samarth Jain updated PHOENIX-4190: ---------------------------------- Description: If you run just this case {code} { false, true, true, true, false, null} {code} in MutableIndexFailureIT on the 4.x-HBase-1.2 branch, [~rajeshbabu], you will see the following NPE in logs: {code} 2017-09-11 00:27:08,119 WARN [B.defaultRpcServer.handler=2,queue=0,port=63436] org.apache.phoenix.index.PhoenixIndexFailurePolicy(143): handleFailure failed java.lang.NullPointerException at org.apache.phoenix.util.SchemaUtil.getTableKeyFromFullName(SchemaUtil.java:707) at org.apache.phoenix.util.IndexUtil.updateIndexState(IndexUtil.java:717) at org.apache.phoenix.index.PhoenixIndexFailurePolicy.handleFailureWithExceptions(PhoenixIndexFailurePolicy.java:221) at org.apache.phoenix.index.PhoenixIndexFailurePolicy.handleFailure(PhoenixIndexFailurePolicy.java:140) at org.apache.phoenix.hbase.index.write.IndexWriter.writeAndKillYourselfOnFailure(IndexWriter.java:155) at org.apache.phoenix.hbase.index.write.IndexWriter.writeAndKillYourselfOnFailure(IndexWriter.java:139) at org.apache.phoenix.hbase.index.Indexer.doPostWithExceptions(Indexer.java:651) at org.apache.phoenix.hbase.index.Indexer.doPost(Indexer.java:608) at org.apache.phoenix.hbase.index.Indexer.postBatchMutateIndispensably(Indexer.java:591) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$37.call(RegionCoprocessorHost.java:1034) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$RegionOperation.call(RegionCoprocessorHost.java:1673) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperation(RegionCoprocessorHost.java:1749) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperation(RegionCoprocessorHost.java:1705) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.postBatchMutateIndispensably(RegionCoprocessorHost.java:1030) at org.apache.hadoop.hbase.regionserver.HRegion.doMiniBatchMutation(HRegion.java:3322) at org.apache.hadoop.hbase.regionserver.HRegion.batchMutate(HRegion.java:2881) at org.apache.hadoop.hbase.regionserver.HRegion.batchMutate(HRegion.java:2823) at org.apache.hadoop.hbase.regionserver.RSRpcServices.doBatchOp(RSRpcServices.java:758) at org.apache.hadoop.hbase.regionserver.RSRpcServices.doNonAtomicRegionMutation(RSRpcServices.java:720) at org.apache.hadoop.hbase.regionserver.RSRpcServices.multi(RSRpcServices.java:2168) at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:33656) at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2188) at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:112) at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:133) at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:108) at java.lang.Thread.run(Thread.java:745) {code} This happens only for salted local indexes. If I remove the SALT_BUCKETS from the table DDL, then the test passes fine. On looking closely at the code, it seems like something is wrong with the computation of offset and subsequent parsing of the index id from the row key here (in PhoenixIndexFailurePolicy): {code} int offset = regionInfo.getStartKey().length == 0 ? regionInfo.getEndKey().length : regionInfo.getStartKey().length; byte[] viewId = null; for (Mutation mutation : mutations) { viewId = indexMaintainer.getViewIndexIdFromIndexRowKey( new ImmutableBytesWritable(mutation.getRow(), offset, mutation.getRow().length - offset)); String indexTableName = localIndexNames.get(new ImmutableBytesWritable(viewId)); indexTableNames.add(indexTableName); } {code} Because of this NPE in PhoenixIndexFailurePolicy, we end up triggering the KillServerOnFailurePolicy which ends up causing the region server to abort. This region server abort is also the reason why our builds against the 4.x-HBase-1.2 branch are hanging. I also believe once we fix this, we can hopefully reenable back the parameters which were testing out rebuild of local indexes for the 4.x-HBase-0.98, 4.x-HBase-1.1 and 4.x-HBase-1.2 branches. On the master branch, because local index update is transactional with data table update, we won' run into such failure scenarios (I think). [~jamestaylor] - A bit orthogonal, but it seems like we can do better here. Wouldn't a better option here would be to let HBase black list the Indexer co-processor in cases of such bugs? Else, we run the risk of shutting down the entire HBase cluster which is what happened here. was: If you run just this case {code} { false, true, true, true, false, null} {code} in MutableIndexFailureIT on the 4.x-HBase-1.2 branch, [~rajeshbabu], you will see the following NPE in logs: {code} 2017-09-11 00:27:08,119 WARN [B.defaultRpcServer.handler=2,queue=0,port=63436] org.apache.phoenix.index.PhoenixIndexFailurePolicy(143): handleFailure failed java.lang.NullPointerException at org.apache.phoenix.util.SchemaUtil.getTableKeyFromFullName(SchemaUtil.java:707) at org.apache.phoenix.util.IndexUtil.updateIndexState(IndexUtil.java:717) at org.apache.phoenix.index.PhoenixIndexFailurePolicy.handleFailureWithExceptions(PhoenixIndexFailurePolicy.java:221) at org.apache.phoenix.index.PhoenixIndexFailurePolicy.handleFailure(PhoenixIndexFailurePolicy.java:140) at org.apache.phoenix.hbase.index.write.IndexWriter.writeAndKillYourselfOnFailure(IndexWriter.java:155) at org.apache.phoenix.hbase.index.write.IndexWriter.writeAndKillYourselfOnFailure(IndexWriter.java:139) at org.apache.phoenix.hbase.index.Indexer.doPostWithExceptions(Indexer.java:651) at org.apache.phoenix.hbase.index.Indexer.doPost(Indexer.java:608) at org.apache.phoenix.hbase.index.Indexer.postBatchMutateIndispensably(Indexer.java:591) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$37.call(RegionCoprocessorHost.java:1034) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$RegionOperation.call(RegionCoprocessorHost.java:1673) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperation(RegionCoprocessorHost.java:1749) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperation(RegionCoprocessorHost.java:1705) at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.postBatchMutateIndispensably(RegionCoprocessorHost.java:1030) at org.apache.hadoop.hbase.regionserver.HRegion.doMiniBatchMutation(HRegion.java:3322) at org.apache.hadoop.hbase.regionserver.HRegion.batchMutate(HRegion.java:2881) at org.apache.hadoop.hbase.regionserver.HRegion.batchMutate(HRegion.java:2823) at org.apache.hadoop.hbase.regionserver.RSRpcServices.doBatchOp(RSRpcServices.java:758) at org.apache.hadoop.hbase.regionserver.RSRpcServices.doNonAtomicRegionMutation(RSRpcServices.java:720) at org.apache.hadoop.hbase.regionserver.RSRpcServices.multi(RSRpcServices.java:2168) at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:33656) at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2188) at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:112) at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:133) at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:108) at java.lang.Thread.run(Thread.java:745) {code} This happens only for salted local indexes. If I remove the SALT_BUCKETS from the table DDL, then the test passes fine. On looking closely at the code, it seems like something is wrong with the computation of offset and subsequent parsing of the index id from the row key here (in PhoenixIndexFailurePolicy): {code} int offset = regionInfo.getStartKey().length == 0 ? regionInfo.getEndKey().length : regionInfo.getStartKey().length; byte[] viewId = null; for (Mutation mutation : mutations) { viewId = indexMaintainer.getViewIndexIdFromIndexRowKey( new ImmutableBytesWritable(mutation.getRow(), offset, mutation.getRow().length - offset)); String indexTableName = localIndexNames.get(new ImmutableBytesWritable(viewId)); indexTableNames.add(indexTableName); } {code} Because of this NPE in PhoenixIndexFailurePolicy, we end up triggering the KillServerOnFailurePolicy which ends up causing the region server to abort. This region server abort is also the reason why our builds against the 4.x-HBase-1.2 branch are hanging. I also believe once we fix this, we can reenable back the parameters which were testing out rebuild of local indexes for the 4.x-HBase-0.98, 4.x-HBase-1.1 and 4.x-HBase-1.2 branches. On the master branch, because local index update is transactional with data table update, we won' run into such failure scenarios (I think). [~jamestaylor] - A bit orthogonal, but it seems like we can do better here. Wouldn't a better option here would be to let HBase black list the Indexer co-processor in cases of such bugs? Else, we run the risk of shutting down the entire HBase cluster which is what happened here. > Salted local index failure is causing region server to abort > ------------------------------------------------------------ > > Key: PHOENIX-4190 > URL: https://issues.apache.org/jira/browse/PHOENIX-4190 > Project: Phoenix > Issue Type: Bug > Reporter: Samarth Jain > Assignee: Rajeshbabu Chintaguntla > > If you run just this case > {code} > { false, true, true, true, false, null} > {code} > in MutableIndexFailureIT on the 4.x-HBase-1.2 branch, [~rajeshbabu], you will see the following NPE in logs: > {code} > 2017-09-11 00:27:08,119 WARN [B.defaultRpcServer.handler=2,queue=0,port=63436] org.apache.phoenix.index.PhoenixIndexFailurePolicy(143): handleFailure failed > java.lang.NullPointerException > at org.apache.phoenix.util.SchemaUtil.getTableKeyFromFullName(SchemaUtil.java:707) > at org.apache.phoenix.util.IndexUtil.updateIndexState(IndexUtil.java:717) > at org.apache.phoenix.index.PhoenixIndexFailurePolicy.handleFailureWithExceptions(PhoenixIndexFailurePolicy.java:221) > at org.apache.phoenix.index.PhoenixIndexFailurePolicy.handleFailure(PhoenixIndexFailurePolicy.java:140) > at org.apache.phoenix.hbase.index.write.IndexWriter.writeAndKillYourselfOnFailure(IndexWriter.java:155) > at org.apache.phoenix.hbase.index.write.IndexWriter.writeAndKillYourselfOnFailure(IndexWriter.java:139) > at org.apache.phoenix.hbase.index.Indexer.doPostWithExceptions(Indexer.java:651) > at org.apache.phoenix.hbase.index.Indexer.doPost(Indexer.java:608) > at org.apache.phoenix.hbase.index.Indexer.postBatchMutateIndispensably(Indexer.java:591) > at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$37.call(RegionCoprocessorHost.java:1034) > at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$RegionOperation.call(RegionCoprocessorHost.java:1673) > at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperation(RegionCoprocessorHost.java:1749) > at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperation(RegionCoprocessorHost.java:1705) > at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.postBatchMutateIndispensably(RegionCoprocessorHost.java:1030) > at org.apache.hadoop.hbase.regionserver.HRegion.doMiniBatchMutation(HRegion.java:3322) > at org.apache.hadoop.hbase.regionserver.HRegion.batchMutate(HRegion.java:2881) > at org.apache.hadoop.hbase.regionserver.HRegion.batchMutate(HRegion.java:2823) > at org.apache.hadoop.hbase.regionserver.RSRpcServices.doBatchOp(RSRpcServices.java:758) > at org.apache.hadoop.hbase.regionserver.RSRpcServices.doNonAtomicRegionMutation(RSRpcServices.java:720) > at org.apache.hadoop.hbase.regionserver.RSRpcServices.multi(RSRpcServices.java:2168) > at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:33656) > at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2188) > at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:112) > at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:133) > at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:108) > at java.lang.Thread.run(Thread.java:745) > {code} > This happens only for salted local indexes. If I remove the SALT_BUCKETS from the table DDL, then the test passes fine. On looking closely at the code, it seems like something is wrong with the computation of offset and subsequent parsing of the index id from the row key here (in PhoenixIndexFailurePolicy): > {code} > int offset = > regionInfo.getStartKey().length == 0 ? regionInfo.getEndKey().length > : regionInfo.getStartKey().length; > byte[] viewId = null; > for (Mutation mutation : mutations) { > viewId = > indexMaintainer.getViewIndexIdFromIndexRowKey( > new ImmutableBytesWritable(mutation.getRow(), offset, > mutation.getRow().length - offset)); > String indexTableName = localIndexNames.get(new ImmutableBytesWritable(viewId)); > indexTableNames.add(indexTableName); > } > {code} > Because of this NPE in PhoenixIndexFailurePolicy, we end up triggering the KillServerOnFailurePolicy which ends up causing the region server to abort. > This region server abort is also the reason why our builds against the 4.x-HBase-1.2 branch are hanging. I also believe once we fix this, we can hopefully reenable back the parameters which were testing out rebuild of local indexes for the 4.x-HBase-0.98, 4.x-HBase-1.1 and 4.x-HBase-1.2 branches. On the master branch, because local index update is transactional with data table update, we won' run into such failure scenarios (I think). > [~jamestaylor] - A bit orthogonal, but it seems like we can do better here. Wouldn't a better option here would be to let HBase black list the Indexer co-processor in cases of such bugs? Else, we run the risk of shutting down the entire HBase cluster which is what happened here. -- This message was sent by Atlassian JIRA (v6.4.14#64029)