Venugopal Reddy K created HIVE-29528:
----------------------------------------
Summary: Managed database directory not deleted after DROP
DATABASE when hive.acid.lockless.reads.enabled=true
Key: HIVE-29528
URL: https://issues.apache.org/jira/browse/HIVE-29528
Project: Hive
Issue Type: Bug
Components: Hive, Metastore, Standalone Metastore
Reporter: Venugopal Reddy K
*[Description]*
When {{hive.acid.lockless.reads.enabled}} is set to {*}true{*}, {{DROP
DATABASE}} becomes a non-blocking operation in Hive Metastore (HMS).
In this mode:
* The managed database directory (e.g., {{{}/warehouse/managed/mydb.db{}}}) is
*not deleted immediately* upon issuing the {{DROP DATABASE}} request.
* Deletion of ACID table data is handled *asynchronously* by a background
cleaner thread.
* Table data and corresponding table directories are eventually removed as
expected.
However, the {*}managed database directory itself is never deleted{*}, even
after All ACID tables are cleaned up.
This results in {*}orphaned database directories remaining indefinitely in the
filesystem{*}, leading to potential storage bloat and inconsistencies between
HMS metadata and filesystem state.
*[Steps to Reproduce]*
# Enable {{hive.acid.lockless.reads.enabled=true}}
# Create a managed database (e.g., {{{}mydb{}}})
# Create one or more ACID tables inside the database
# Insert data into the tables
# Execute {{DROP DATABASE mydb CASCADE}}
# Wait for the background cleaner thread to delete table data
# Check the filesystem for database directory.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)