Skip to content

[WIP]HIVE-29843: Avoid deleting shared database directories - #6777

Open
Gezi-lzq wants to merge 1 commit into
apache:masterfrom
Gezi-lzq:codex/hive-29843-no-shared-dir-cleanup
Open

[WIP]HIVE-29843: Avoid deleting shared database directories#6777
Gezi-lzq wants to merge 1 commit into
apache:masterfrom
Gezi-lzq:codex/hive-29843-no-shared-dir-cleanup

Conversation

@Gezi-lzq

@Gezi-lzq Gezi-lzq commented Sep 13, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

Remove recursive database-directory cleanup from failed create_database rollbacks and add a regression test.

Issue: https://issues.apache.org/jira/browse/HIVE-29843

Why are the changes needed?

mkdirs does not prove exclusive directory ownership. A concurrent request that loses the metadata race can otherwise delete the directory adopted by the successful request, leaving Hive metadata and Iceberg data inconsistent.

Does this PR introduce any user-facing change?

Yes. Failed create_database requests no longer delete the final database directory. Empty directories may remain, but shared data is preserved.

How was this patch tested?

cd standalone-metastore/metastore-server
mvn -B -Dtest=TestCreateDatabaseHandler \
  -Dsurefire.failIfNoSpecifiedTests=false -DskipITs \
  -Dcheckstyle.skip=true -Drat.skip=true test

Result: 1 test passed.

@Gezi-lzq
Gezi-lzq marked this pull request as ready for review September 13, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants