[
https://issues.apache.org/jira/browse/PHOENIX-1293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14152133#comment-14152133
]
rajeshbabu commented on PHOENIX-1293:
-------------------------------------
I have observed possible NPE while closing SYSTEM.STATS table region from 3.0
build logs. I think it's related to PHOENIX-180
{code}
java.lang.RuntimeException: java.lang.NullPointerException
at
org.apache.hadoop.hbase.regionserver.handler.CloseRegionHandler.process(CloseRegionHandler.java:133)
at
org.apache.hadoop.hbase.executor.EventHandler.run(EventHandler.java:175)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.NullPointerException
at
org.apache.phoenix.schema.stat.StatisticsCollector.stop(StatisticsCollector.java:220)
at
org.apache.hadoop.hbase.coprocessor.CoprocessorHost$Environment.shutdown(CoprocessorHost.java:624)
at
org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$RegionEnvironment.shutdown(RegionCoprocessorHost.java:119)
at
org.apache.hadoop.hbase.coprocessor.CoprocessorHost.shutdown(CoprocessorHost.java:263)
at
org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.postClose(RegionCoprocessorHost.java:344)
at
org.apache.hadoop.hbase.regionserver.HRegion.doClose(HRegion.java:1144)
at org.apache.hadoop.hbase.regionserver.HRegion.close(HRegion.java:1024)
at
org.apache.hadoop.hbase.regionserver.handler.CloseRegionHandler.process(CloseRegionHandler.java:119)
{code}
> By default we should not disable wal for immutable indexes otherwise we end
> up in data loss on RS failure
> ---------------------------------------------------------------------------------------------------------
>
> Key: PHOENIX-1293
> URL: https://issues.apache.org/jira/browse/PHOENIX-1293
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 3.1, 4.1
> Reporter: rajeshbabu
> Assignee: rajeshbabu
> Priority: Critical
> Attachments: PHOENIX-1293.patch, PHOENIX-1293_3.0.patch
>
>
> Currently we are disabling wal for the indexes on table with immutable rows,
> which user may not aware.
> {code}
> boolean disableWAL = false;
> Boolean disableWALProp = (Boolean)
> tableProps.remove(PhoenixDatabaseMetaData.DISABLE_WAL);
> if (disableWALProp == null) {
> disableWAL = isParentImmutableRows; // By default, disable
> WAL for immutable indexes
> } else {
> disableWAL = disableWALProp;
> }
> {code}
> Let's suppose region server holding the indexes regions restarted after
> writes happened successfully, then index table entries in memstore will be
> lost and finally end up with inconsistencies.
> {code}
> Here is the example:
> 0: jdbc:phoenix:10.18.40.169> create table t(a integer not null primary key,b
> integer,c integer);
> No rows affected (0.714 seconds)
> 0: jdbc:phoenix:10.18.40.169> alter table t set immutable_rows=true;
> No rows affected (0.024 seconds)
> 0: jdbc:phoenix:10.18.40.169> create index t_idx on t(b);
> No rows affected (0.685 seconds)
> 0: jdbc:phoenix:10.18.40.169> upsert into t values(1,2,3);
> 1 row affected (0.086 seconds)
> 0: jdbc:phoenix:10.18.40.169> upsert into t values(2,3,4);
> 1 row affected (0.012 seconds)
> 0: jdbc:phoenix:10.18.40.169> upsert into t values(3,4,5);
> 1 row affected (0.012 seconds)
> 0: jdbc:phoenix:10.18.40.169> select count(*) from t;
> +------------+
> | COUNT(1) |
> +------------+
> | 3 |
> +------------+
> 1 row selected (0.083 seconds)
> 0: jdbc:phoenix:10.18.40.169> select count(*) from t_idx;
> +------------+
> | COUNT(1) |
> +------------+
> | 3 |
> +------------+
> 1 row selected (8.367 seconds)
> {code}
> Restarted the region server here. Now the results are as below.here index
> entries in the memstore are lost.
> {code}
> 0: jdbc:phoenix:10.18.40.169> select count(*) from t;
> +------------+
> | COUNT(1) |
> +------------+
> | 3 |
> +------------+
> 1 row selected (0.083 seconds)
> 0: jdbc:phoenix:10.18.40.169> select count(*) from t_idx;
> +------------+
> | COUNT(1) |
> +------------+
> | 0 |
> +------------+
> 1 row selected (8.367 seconds)
> {code}
> So we need not disable wal by default until unless user specify explicitly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)