phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "rajeshbabu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PHOENIX-1293) By default we should not disable wal for immutable indexes otherwise we end up in data loss on RS failure
Date Mon, 29 Sep 2014 01:44:33 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-1293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

rajeshbabu updated PHOENIX-1293:
--------------------------------
    Attachment: PHOENIX-1293_3.0.patch

Here is the patch for 3.0 branch.

> 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)

Mime
View raw message