Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-15145

Alter partition and fs renameDir should happen in same transaction

    XMLWordPrintableJSON

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.

      Attachments

        Activity

          People

            mohitsabharwal Mohit Sabharwal
            mohitsabharwal Mohit Sabharwal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: