CDAP-6062: Note: This protects a partition and its files from being deleted if a Hive query is concurrently reading it. However, it does not guarantee atomicity of drop operations across multiple partitions: If I try to delete 5 partitions in a single transaction, and the 4th partition is locked by Hive, then the first three are already deleted from Hive (and the file system) when we fail for number 4 (and the 5th will not even be attempted to delete, because the transaction fails). But the first three cannot be reinstated during tx rollback, because both Hive and the file system are not transactional and don't allow rollback. The partition meta data for these three will, however, be reinstated during rollback.
Therefore this only protects against concurrency consistently if a single partition is deleted per transaction.