Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
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.