Mohit Sabharwal created HIVE-15145: -------------------------------------- Summary: Alter partition and fs renameDir should happen in same transaction Key: HIVE-15145 URL: https://issues.apache.org/jira/browse/HIVE-15145 Project: Hive Issue Type: Improvement Reporter: Mohit Sabharwal Assignee: Mohit Sabharwal
In HiveAlterTable#alterPartition, the rename partition logic is as follows: - open txn - db.alterPartition(old, new) - commit txn - fs.mkdirs - if mkdirs fails -- open txn -- db.alterPartition(new, old) -- commit txn Instead, both db.alterPartition(old, new) and fs.mkdirs can be moved under a single transaction. Currently, if the second db.alterPartition(new, old) fails, we have a partition metadata committed without corresponding partition directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)