You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "rajeshbabu (JIRA)" <ji...@apache.org> on 2014/09/29 20:52:34 UTC
[jira] [Resolved] (PHOENIX-1293) By default we should not disable
wal for immutable indexes otherwise we end up in data loss on RS failure
[ https://issues.apache.org/jira/browse/PHOENIX-1293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
rajeshbabu resolved PHOENIX-1293.
---------------------------------
Resolution: Fixed
Pushed to 3.0,4.0 and master branches. Thanks for review [~jamestaylor].
> 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)