[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-30 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Resolution: Fixed
Status: Resolved  (was: Patch Available)

HIVE-21886.05.patch committed to master. Thanks [~sankarh] for review.

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch, HIVE-21886.04.patch, HIVE-21886.04.patch, 
> HIVE-21886.05.patch
>
>  Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>        3. If the old table does not match the old policy drop it, even if the 
> table is not present at target.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>        2. If the new policy does not match the table name, then ignore the 
> event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-28 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Status: Patch Available  (was: Open)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch, HIVE-21886.04.patch, HIVE-21886.04.patch, 
> HIVE-21886.05.patch
>
>  Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>        3. If the old table does not match the old policy drop it, even if the 
> table is not present at target.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>        2. If the new policy does not match the table name, then ignore the 
> event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermitten

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-28 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Status: Open  (was: Patch Available)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch, HIVE-21886.04.patch, HIVE-21886.04.patch, 
> HIVE-21886.05.patch
>
>  Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>        3. If the old table does not match the old policy drop it, even if the 
> table is not present at target.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>        2. If the new policy does not match the table name, then ignore the 
> event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermitten

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-28 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Attachment: HIVE-21886.05.patch

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch, HIVE-21886.04.patch, HIVE-21886.04.patch, 
> HIVE-21886.05.patch
>
>  Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>        3. If the old table does not match the old policy drop it, even if the 
> table is not present at target.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>        2. If the new policy does not match the table name, then ignore the 
> event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-27 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Status: Patch Available  (was: Open)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch, HIVE-21886.04.patch, HIVE-21886.04.patch
>
>  Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>        3. If the old table does not match the old policy drop it, even if the 
> table is not present at target.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>        2. If the new policy does not match the table name, then ignore the 
> event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> 

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-27 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Attachment: HIVE-21886.04.patch

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch, HIVE-21886.04.patch, HIVE-21886.04.patch
>
>  Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>        3. If the old table does not match the old policy drop it, even if the 
> table is not present at target.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>        2. If the new policy does not match the table name, then ignore the 
> event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be pr

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-27 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Status: Open  (was: Patch Available)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch, HIVE-21886.04.patch, HIVE-21886.04.patch
>
>  Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>        3. If the old table does not match the old policy drop it, even if the 
> table is not present at target.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>        2. If the new policy does not match the table name, then ignore the 
> event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> 

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-27 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Attachment: HIVE-21886.04.patch

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch, HIVE-21886.04.patch
>
>  Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>        3. If the old table does not match the old policy drop it, even if the 
> table is not present at target.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>        2. If the new policy does not match the table name, then ignore the 
> event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus replac

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-27 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Status: Patch Available  (was: Open)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch, HIVE-21886.04.patch
>
>  Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>        3. If the old table does not match the old policy drop it, even if the 
> table is not present at target.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>        2. If the new policy does not match the table name, then ignore the 
> event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus r

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-27 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Status: Open  (was: Patch Available)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch, HIVE-21886.04.patch
>
>  Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>        3. If the old table does not match the old policy drop it, even if the 
> table is not present at target.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>        2. If the new policy does not match the table name, then ignore the 
> event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus r

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-26 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Description: 
If some rename events are found to be dumped and replayed while replace policy 
is getting executed, it needs to take care of the policy inclusion in both the 
policy for each table name.

 1. Create a list of tables to be bootstrapped. 

  2. During handling of alter table, if the alter type is rename 

      1. If the old table name is present in the list of table to be 
bootstrapped, remove it.

       2. If the new table name, matches the new policy, add it to the list of 
tables to be bootstrapped.

       3. If the old table does not match the old policy drop it, even if the 
table is not present at target.

  3. During handling of drop table

       1. if the table is in the list of tables to be bootstrapped, then remove 
it and ignore the event.

  4. During other event handling 

       1. if the table is there in the list of tables to be bootstrapped, then 
ignore the event.

       2. If the new policy does not match the table name, then ignore the 
event.

 

Rename handling during replace policy
 # Old name not matching old policy – The old table will not be there at the 
target cluster. The table will not be returned by get-all-table.
 ## Old name is not matching new policy
 ### New name not matching old policy
  New name not matching new policy
 * Ignore the event, no need to do anything.
  New name matching new policy
 * The table will be returned by get-all-table. Replace policy handler will 
bootstrap this table as its matching new policy and not matching old policy.
 * All the future events will be ignored as part of check added by replace 
policy handling.
 * All the event with old table name will anyways be ignored as the old 
name is not matching the new policy.
 ### New name matching old policy
  New name not matching new policy
 * As the new name is not matching the new policy, the table need not be 
replicated.
 * As the old name is not matching the new policy, the rename events will 
be ignored.
 * So nothing to be done for this scenario.
  New name matching new policy
 * As the new name is matching both old and new policy, replace handler 
will not bootstrap the table.
 * Add the table to the list of tables to be bootstrapped.
 * Ignore all the events with new name.
 * If there is a drop event for the table (with new name), then remove the 
table from the the list of table to be bootstrapped.
 * In case of rename event (double rename)
 ** If the new name satisfies the table pattern, then add the new name to 
the list of tables to be bootstrapped and remove the old name from the list of 
tables to be bootstrapped.
 ** If the new name does not satisfies then just removed the table name 
from the list of tables to be bootstrapped.
 ## Old name is matching new policy – As per replace policy handler, which 
checks based on old table, the table should be bootstrapped and event should be 
ignored. But rename handler should decide based on new name.The old table name 
will not be returned by get-all-table, so replace handler will not d anything 
for the old table.
 ### New name not matching old policy
  New name not matching new policy
 * As the old table is not there at target and new name is not matching new 
policy. Ignore the event.
 * No need to add the table to the list of tables to be bootstrapped.
 * All the subsequent events will be ignored as the new name is not 
matching the new policy.
  New name matching new policy
 * As the new name is not matching old policy but matching new policy, the 
table will be bootstrapped by replace policy handler. So rename event need not 
add this table to list of table to be bootstrapped.
 * All the future events will be ignored by replace policy handler.
 * For rename event (double rename)
 ** If there is a rename, the table (with intermittent new name) will not 
be present and thus replace handler will not bootstrap the table.
 ** So if the new name (the latest one) is matching the new policy, then 
add it to the list of table to be bootstrapped.
 ** And If the new name (the latest one)  is not matching the new policy, 
then just ignore the event as the  intermittent new name would not have added 
to the list of table to be bootstrapped.
 ### New name matching old policy
  New name not matching new policy
 * Dump the event. The table will be dropped by repl load at the target.
  New name matching new policy
 * Replace handler will not bootstrap this table as the new name is 
matching both policies.
 * As old name is not matching the old policy, the table will not be there 
at target. The rename event should add the new name to the list of table to be 
bootstrapped.
 * Subsequent eve

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-26 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Description: 
If some rename events are found to be dumped and replayed while replace policy 
is getting executed, it needs to take care of the policy inclusion in both the 
policy for each table name.

 1. Create a list of tables to be bootstrapped. 

  2. During handling of alter table, if the alter type is rename 

      1. If the old table name is present in the list of table to be 
bootstrapped, remove it.

       2. If the new table name, matches the new policy, add it to the list of 
tables to be bootstrapped.

       3. If the old table does not match the old policy drop it, even if the 
table is not present at target.

  3. During handling of drop table

       1. if the table is in the list of tables to be bootstrapped, then remove 
it and ignore the event.

  4. During other event handling 

       1. if the table is there in the list of tables to be bootstrapped, then 
ignore the event.

 

Rename handling during replace policy
 # Old name not matching old policy – The old table will not be there at the 
target cluster. The table will not be returned by get-all-table.
 ## Old name is not matching new policy
 ### New name not matching old policy
  New name not matching new policy
 * Ignore the event, no need to do anything.
  New name matching new policy
 * The table will be returned by get-all-table. Replace policy handler will 
bootstrap this table as its matching new policy and not matching old policy.
 * All the future events will be ignored as part of check added by replace 
policy handling.
 * All the event with old table name will anyways be ignored as the old 
name is not matching the new policy.
 ### New name matching old policy
  New name not matching new policy
 * As the new name is not matching the new policy, the table need not be 
replicated.
 * As the old name is not matching the new policy, the rename events will 
be ignored.
 * So nothing to be done for this scenario.
  New name matching new policy
 * As the new name is matching both old and new policy, replace handler 
will not bootstrap the table.
 * Add the table to the list of tables to be bootstrapped.
 * Ignore all the events with new name.
 * If there is a drop event for the table (with new name), then remove the 
table from the the list of table to be bootstrapped.
 * In case of rename event (double rename)
 ** If the new name satisfies the table pattern, then add the new name to 
the list of tables to be bootstrapped and remove the old name from the list of 
tables to be bootstrapped.
 ** If the new name does not satisfies then just removed the table name 
from the list of tables to be bootstrapped.
 ## Old name is matching new policy – As per replace policy handler, which 
checks based on old table, the table should be bootstrapped and event should be 
ignored. But rename handler should decide based on new name.The old table name 
will not be returned by get-all-table, so replace handler will not d anything 
for the old table.
 ### New name not matching old policy
  New name not matching new policy
 * As the old table is not there at target and new name is not matching new 
policy. Ignore the event.
 * No need to add the table to the list of tables to be bootstrapped.
 * All the subsequent events will be ignored as the new name is not 
matching the new policy.
  New name matching new policy
 * As the new name is not matching old policy but matching new policy, the 
table will be bootstrapped by replace policy handler. So rename event need not 
add this table to list of table to be bootstrapped.
 * All the future events will be ignored by replace policy handler.
 * For rename event (double rename)
 ** If there is a rename, the table (with intermittent new name) will not 
be present and thus replace handler will not bootstrap the table.
 ** So if the new name (the latest one) is matching the new policy, then 
add it to the list of table to be bootstrapped.
 ** And If the new name (the latest one)  is not matching the new policy, 
then just ignore the event as the  intermittent new name would not have added 
to the list of table to be bootstrapped.
 ### New name matching old policy
  New name not matching new policy
 * Dump the event. The table will be dropped by repl load at the target.
  New name matching new policy
 * Replace handler will not bootstrap this table as the new name is 
matching both policies.
 * As old name is not matching the old policy, the table will not be there 
at target. The rename event should add the new name to the list of table to be 
bootstrapped.
 * Subsequent events with new table name should be ignored.
 * Drop events should not be ignored 

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-26 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Status: Patch Available  (was: Open)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch
>
>  Time Spent: 10h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus replace handler will not bootstrap the table.
>  ** So if the new name (the latest one) is matching the new policy, then 
> add it to the list of table to be bootstrapped.
>  ** And If the new name (the latest one)  

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-26 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Attachment: HIVE-21886.03.patch

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch, 
> HIVE-21886.03.patch
>
>  Time Spent: 10h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus replace handler will not bootstrap the table.
>  ** So if the new name (the latest one) is matching the new policy, then 
> add it to the list of table to be bootstrapped.
>  ** And If the new name (the latest one)  is no

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-26 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Status: Open  (was: Patch Available)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch
>
>  Time Spent: 10h 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus replace handler will not bootstrap the table.
>  ** So if the new name (the latest one) is matching the new policy, then 
> add it to the list of table to be bootstrapped.
>  ** And If the new name (the latest one)  is not matching the new 

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-26 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Status: Patch Available  (was: Open)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus replace handler will not bootstrap the table.
>  ** So if the new name (the latest one) is matching the new policy, then 
> add it to the list of table to be bootstrapped.
>  ** And If the new name (the latest one)  is not matching the new poli

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-26 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Attachment: HIVE-21886.02.patch

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus replace handler will not bootstrap the table.
>  ** So if the new name (the latest one) is matching the new policy, then 
> add it to the list of table to be bootstrapped.
>  ** And If the new name (the latest one)  is not matching the new policy, 

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-26 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Status: Open  (was: Patch Available)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch, HIVE-21886.02.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus replace handler will not bootstrap the table.
>  ** So if the new name (the latest one) is matching the new policy, then 
> add it to the list of table to be bootstrapped.
>  ** And If the new name (the latest one)  is not matching the new poli

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-25 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot updated HIVE-21886:
--
Labels: DR Replication pull-request-available  (was: DR Replication)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication, pull-request-available
> Attachments: HIVE-21886.01.patch
>
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus replace handler will not bootstrap the table.
>  ** So if the new name (the latest one) is matching the new policy, then 
> add it to the list of table to be bootstrapped.
>  ** And If the new name (the latest one)  is not matching the new policy, 
> then just ignore the event as the  intermitte

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-25 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Status: Patch Available  (was: Open)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication
> Attachments: HIVE-21886.01.patch
>
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus replace handler will not bootstrap the table.
>  ** So if the new name (the latest one) is matching the new policy, then 
> add it to the list of table to be bootstrapped.
>  ** And If the new name (the latest one)  is not matching the new policy, 
> then just ignore the event as the  intermittent new name would not have added 
> to the lis

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-25 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Attachment: HIVE-21886.01.patch

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication
> Attachments: HIVE-21886.01.patch
>
>
> If some rename events are found to be dumped and replayed while replace 
> policy is getting executed, it needs to take care of the policy inclusion in 
> both the policy for each table name.
>  1. Create a list of tables to be bootstrapped. 
>   2. During handling of alter table, if the alter type is rename 
>       1. If the old table name is present in the list of table to be 
> bootstrapped, remove it.
>        2. If the new table name, matches the new policy, add it to the list 
> of tables to be bootstrapped.
>   3. During handling of drop table
>        1. if the table is in the list of tables to be bootstrapped, then 
> remove it and ignore the event.
>   4. During other event handling 
>        1. if the table is there in the list of tables to be bootstrapped, 
> then ignore the event.
>  
> Rename handling during replace policy
>  # Old name not matching old policy – The old table will not be there at the 
> target cluster. The table will not be returned by get-all-table.
>  ## Old name is not matching new policy
>  ### New name not matching old policy
>   New name not matching new policy
>  * Ignore the event, no need to do anything.
>   New name matching new policy
>  * The table will be returned by get-all-table. Replace policy handler 
> will bootstrap this table as its matching new policy and not matching old 
> policy.
>  * All the future events will be ignored as part of check added by 
> replace policy handling.
>  * All the event with old table name will anyways be ignored as the old 
> name is not matching the new policy.
>  ### New name matching old policy
>   New name not matching new policy
>  * As the new name is not matching the new policy, the table need not be 
> replicated.
>  * As the old name is not matching the new policy, the rename events will 
> be ignored.
>  * So nothing to be done for this scenario.
>   New name matching new policy
>  * As the new name is matching both old and new policy, replace handler 
> will not bootstrap the table.
>  * Add the table to the list of tables to be bootstrapped.
>  * Ignore all the events with new name.
>  * If there is a drop event for the table (with new name), then remove 
> the table from the the list of table to be bootstrapped.
>  * In case of rename event (double rename)
>  ** If the new name satisfies the table pattern, then add the new name to 
> the list of tables to be bootstrapped and remove the old name from the list 
> of tables to be bootstrapped.
>  ** If the new name does not satisfies then just removed the table name 
> from the list of tables to be bootstrapped.
>  ## Old name is matching new policy – As per replace policy handler, which 
> checks based on old table, the table should be bootstrapped and event should 
> be ignored. But rename handler should decide based on new name.The old table 
> name will not be returned by get-all-table, so replace handler will not d 
> anything for the old table.
>  ### New name not matching old policy
>   New name not matching new policy
>  * As the old table is not there at target and new name is not matching 
> new policy. Ignore the event.
>  * No need to add the table to the list of tables to be bootstrapped.
>  * All the subsequent events will be ignored as the new name is not 
> matching the new policy.
>   New name matching new policy
>  * As the new name is not matching old policy but matching new policy, 
> the table will be bootstrapped by replace policy handler. So rename event 
> need not add this table to list of table to be bootstrapped.
>  * All the future events will be ignored by replace policy handler.
>  * For rename event (double rename)
>  ** If there is a rename, the table (with intermittent new name) will not 
> be present and thus replace handler will not bootstrap the table.
>  ** So if the new name (the latest one) is matching the new policy, then 
> add it to the list of table to be bootstrapped.
>  ** And If the new name (the latest one)  is not matching the new policy, 
> then just ignore the event as the  intermittent new name would not have added 
> to the list of 

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-18 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Description: 
If some rename events are found to be dumped and replayed while replace policy 
is getting executed, it needs to take care of the policy inclusion in both the 
policy for each table name.

 1. Create a list of tables to be bootstrapped. 

  2. During handling of alter table, if the alter type is rename 

      1. If the old table name is present in the list of table to be 
bootstrapped, remove it.

       2. If the new table name, matches the new policy, add it to the list of 
tables to be bootstrapped.

  3. During handling of drop table

       1. if the table is in the list of tables to be bootstrapped, then remove 
it and ignore the event.

  4. During other event handling 

       1. if the table is there in the list of tables to be bootstrapped, then 
ignore the event.

 

Rename handling during replace policy
 # Old name not matching old policy – The old table will not be there at the 
target cluster. The table will not be returned by get-all-table.
 ## Old name is not matching new policy
 ### New name not matching old policy
  New name not matching new policy
 * Ignore the event, no need to do anything.
  New name matching new policy
 * The table will be returned by get-all-table. Replace policy handler will 
bootstrap this table as its matching new policy and not matching old policy.
 * All the future events will be ignored as part of check added by replace 
policy handling.
 * All the event with old table name will anyways be ignored as the old 
name is not matching the new policy.
 ### New name matching old policy
  New name not matching new policy
 * As the new name is not matching the new policy, the table need not be 
replicated.
 * As the old name is not matching the new policy, the rename events will 
be ignored.
 * So nothing to be done for this scenario.
  New name matching new policy
 * As the new name is matching both old and new policy, replace handler 
will not bootstrap the table.
 * Add the table to the list of tables to be bootstrapped.
 * Ignore all the events with new name.
 * If there is a drop event for the table (with new name), then remove the 
table from the the list of table to be bootstrapped.
 * In case of rename event (double rename)
 ** If the new name satisfies the table pattern, then add the new name to 
the list of tables to be bootstrapped and remove the old name from the list of 
tables to be bootstrapped.
 ** If the new name does not satisfies then just removed the table name 
from the list of tables to be bootstrapped.
 ## Old name is matching new policy – As per replace policy handler, which 
checks based on old table, the table should be bootstrapped and event should be 
ignored. But rename handler should decide based on new name.The old table name 
will not be returned by get-all-table, so replace handler will not d anything 
for the old table.
 ### New name not matching old policy
  New name not matching new policy
 * As the old table is not there at target and new name is not matching new 
policy. Ignore the event.
 * No need to add the table to the list of tables to be bootstrapped.
 * All the subsequent events will be ignored as the new name is not 
matching the new policy.
  New name matching new policy
 * As the new name is not matching old policy but matching new policy, the 
table will be bootstrapped by replace policy handler. So rename event need not 
add this table to list of table to be bootstrapped.
 * All the future events will be ignored by replace policy handler.
 * For rename event (double rename)
 ** If there is a rename, the table (with intermittent new name) will not 
be present and thus replace handler will not bootstrap the table.
 ** So if the new name (the latest one) is matching the new policy, then 
add it to the list of table to be bootstrapped.
 ** And If the new name (the latest one)  is not matching the new policy, 
then just ignore the event as the  intermittent new name would not have added 
to the list of table to be bootstrapped.
 ### New name matching old policy
  New name not matching new policy
 * Dump the event. The table will be dropped by repl load at the target.
  New name matching new policy
 * Replace handler will not bootstrap this table as the new name is 
matching both policies.
 * As old name is not matching the old policy, the table will not be there 
at target. The rename event should add the new name to the list of table to be 
bootstrapped.
 * Subsequent events with new table name should be ignored.
 * Drop events should not be ignored as if the table is present during 
bootstrapped, then its a new table and thus should be dropped.
 * In case

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-18 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Description: 
If some rename events are found to be dumped and replayed while replace policy 
is getting executed, it needs to take care of the policy inclusion in both the 
policy for each table name.

 

Rename handling during replace policy
 # Old name not matching old policy – The old table will not be there at the 
target cluster. The table will not be returned by get-all-table.
 # Old name is not matching new policy
 # New name not matching old policy
 # New name not matching new policy
 # Ignore the event, no need to do anything.


 # New name matching new policy
 # The table will be returned by get-all-table. Replace policy handler will 
bootstrap this table as its matching new policy and not matching old policy.
 # All the future events will be ignored as part of check added by replace 
policy handling.
 # All the event with old table name will anyways be ignored as the old name is 
not matching the new policy.


 # New name matching old policy
 # New name not matching new policy
 # As the new name is not matching the new policy, the table need not be 
replicated.
 # As the old name is not matching the new policy, the rename events will be 
ignored.
 # So nothing to be done for this scenario.


 # New name matching new policy
 # As the new name is matching both old and new policy, replace handler will 
not bootstrap the table.
 # Add the table to the list of tables to be bootstrapped.
 # Ignore all the events with new name.
 # If there is a drop event for the table (with new name), then remove the 
table from the the list of table to be bootstrapped.
 # In case of rename event (double rename)
 # If the new name satisfies the table pattern, then add the new name to the 
list of tables to be bootstrapped and remove the old name from the list of 
tables to be bootstrapped.
 # If the new name does not satisfies then just removed the table name from the 
list of tables to be bootstrapped.


 # Old name is matching new policy – As per replace policy handler, which 
checks based on old table, the table should be bootstrapped and event should be 
ignored. But rename handler should decide based on new name.The old table name 
will not be returned by get-all-table, so replace handler will not d anything 
for the old table.
 # New name not matching old policy
 # New name not matching new policy
 # As the old table is not there at target and new name is not matching new 
policy. Ignore the event.
 # No need to add the table to the list of tables to be bootstrapped.
 # All the subsequent events will be ignored as the new name is not matching 
the new policy.


 # New name matching new policy
 # As the new name is not matching old policy but matching new policy, the 
table will be bootstrapped by replace policy handler. So rename event need not 
add this table to list of table to be bootstrapped.
 # All the future events will be ignored by replace policy handler.
 # For rename event (double rename)
 # If there is a rename, the table (with intermittent new name) will not be 
present and thus replace handler will not bootstrap the table.
 # So if the new name (the latest one) is matching the new policy, then add it 
to the list of table to be bootstrapped.
 # And If the new name (the latest one)  is not matching the new policy, then 
just ignore the event as the  intermittent new name would not have added to the 
list of table to be bootstrapped.


 # New name matching old policy
 # New name not matching new policy
 # Dump the event. The table will be dropped by repl load at the target.


 # New name matching new policy
 # Replace handler will not bootstrap this table as the new name is matching 
both policies.
 # As old name is not matching the old policy, the table will not be there at 
target. The rename event should add the new name to the list of table to be 
bootstrapped.
 # Subsequent events with new table name should be ignored.
 # Drop events should not be ignored as if the table is present during 
bootstrapped, then its a new table and thus should be doropped.
 # In case of rename event (double rename)
 # If the new name satisfies the table pattern, then add the new name to the 
list of tables to be bootstrapped and remove the old name from the list of 
tables to be bootstrapped.
 # If the new name does not satisfies then just removed the table name from the 
list of tables to be bootstrapped.


 # Old name is matching old policy – The old table will be there at the target 
cluster. The table will not be returned by get-all-table. Repl load should 
delete the old table as it is not matching the new policy.
 # Old name is not matching new policy
 # New name not matching old policy
 # New name not matching new policy
 # Nothing to be done. Ignore the event.


 # New name matching new policy
 # As

[jira] [Updated] (HIVE-21886) REPL - With table list - Handle rename events during replace policy

2019-06-18 Thread mahesh kumar behera (JIRA)


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

mahesh kumar behera updated HIVE-21886:
---
Description: (was: REPL DUMP fetches the events from NOTIFICATION_LOG 
table based on regular expression + inclusion/exclusion list. So, in case of 
rename table event, the event will be ignored if old table doesn't match the 
pattern but the new table should be bootstrapped. REPL DUMP should have a 
mechanism to detect such tables and automatically bootstrap with incremental 
replication.Also, if renamed table is excluded from replication policy, then 
need to drop the old table at target as well. 

There are 4 scenarios that needs to be handled.
 # Both new name and old name satisfies the table name pattern filter.
 ## No need to do anything. The incremental event for rename should take care 
of the replication.
 # Both the names does not satisfy the table name pattern filter.
 ## Both the names are not in the scope of the policy and this nothing needs to 
be done.
 # New name satisfies the pattern but the old name does not.
 ## The table will not be present at the target.
 ## Rename event handler for dump should detect this case and add the new table 
name to the list of table for bootstrap.
 ## All the events related to the table (new name) should be ignored.
 ## If there is a drop event for the table (with new name), then remove the 
table from the list of tables to be bootstrapped.
 ## In case of rename (double rename)
 ### If the new name satisfies the table pattern, then add the new name to the 
list of tables to be bootstrapped and remove the old name from the list of 
tables to be bootstrapped.
 ### If the new name does not satisfies then just removed the table name from 
the list of tables to be bootstrapped.
 # New name does not satisfies the pattern but the old name satisfies.
 ## Change the rename event to a drop event.)

> REPL - With table list - Handle rename events during replace policy
> ---
>
> Key: HIVE-21886
> URL: https://issues.apache.org/jira/browse/HIVE-21886
> Project: Hive
>  Issue Type: Sub-task
>  Components: repl
>Reporter: mahesh kumar behera
>Assignee: mahesh kumar behera
>Priority: Major
>  Labels: DR, Replication
>




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