You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/08/07 11:40:00 UTC

[jira] [Commented] (HIVE-20264) Bootstrap repl dump with concurrent write and drop of ACID table makes target inconsistent.

    [ https://issues.apache.org/jira/browse/HIVE-20264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16571497#comment-16571497 ] 

ASF GitHub Bot commented on HIVE-20264:
---------------------------------------

GitHub user sankarh opened a pull request:

    https://github.com/apache/hive/pull/410

    HIVE-20264: Bootstrap repl dump with concurrent write and drop of ACID table makes target inconsistent.

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sankarh/hive HIVE-20264

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/hive/pull/410.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #410
    
----
commit 763463f961229a69f3e714c0f5613aaeca2ddabd
Author: Sankar Hariappan <ma...@...>
Date:   2018-08-07T11:38:14Z

    HIVE-20264: Bootstrap repl dump with concurrent write and drop of ACID table makes target inconsistent.

----


> Bootstrap repl dump with concurrent write and drop of ACID table makes target inconsistent.
> -------------------------------------------------------------------------------------------
>
>                 Key: HIVE-20264
>                 URL: https://issues.apache.org/jira/browse/HIVE-20264
>             Project: Hive
>          Issue Type: Sub-task
>          Components: HiveServer2, repl
>    Affects Versions: 4.0.0, 3.2.0
>            Reporter: Sankar Hariappan
>            Assignee: Sankar Hariappan
>            Priority: Major
>              Labels: DR, pull-request-available, replication
>
> During bootstrap dump of ACID tables, let's consider the below sequence.
>  - Get lastReplId = last event ID logged.
>  - Current session (Thread-1), REPL DUMP -> Open txn (Txn1) - Event-10
>  - Another session (Thread-2), Open txn (Txn2) - Event-11
>  - Thread-2 -> Insert data (T1.D1) to ACID table. - Event-12
>  - Thread-2 -> Commit Txn (Txn2) - Event-13
>  - Thread-2 -> Drop table (T1) - Event-14
>  - Thread-1 -> Dump ACID tables based on current list of tables. So, T1 will be missing.
>  - Thread-1 -> Commit Txn (Txn1)
>  - REPL LOAD from bootstrap dump will skip T1.
>  - Incremental REPL DUMP will start from Event-10 and hence allocate write id for table T1 and drop table(T1) is idempotent. So, at target, exist entries in TXN_TO_WRITE_ID and NEXT_WRITE_ID metastore tables.
>  - Now, when we create another table at source with same name T1 and replicate, then it may lead to incorrect data for readers at target on T1.
> Couple of proposals:
>  1. Make allocate write ID idempotent which is not possible as table doesn't exist and MM table import may lead to allocate write id before creating table. So, cannot differentiate these 2 cases.
>  2. Make Drop table event to drop entries from TXN_TO_WRITE_ID and NEXT_WRITE_ID tables irrespective of table exist or not at target.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)