Skip to content

fix(catalog): avoid redundant hadoop namespace stat#1294

Open
gitcommit90 wants to merge 1 commit into
apache:mainfrom
gitcommit90:fix/issue-1273-dropnamespace-walkdir
Open

fix(catalog): avoid redundant hadoop namespace stat#1294
gitcommit90 wants to merge 1 commit into
apache:mainfrom
gitcommit90:fix/issue-1273-dropnamespace-walkdir

Conversation

@gitcommit90

Copy link
Copy Markdown

Summary

Remove the standalone Stat call before WalkDir in the Hadoop catalog's DropNamespace path.

WalkDir already reports a missing root path, so the separate pre-check widens a check-to-use race window where another caller can delete or recreate the namespace between the two filesystem calls.

Changes

  • Rely on WalkDir for missing namespace detection
  • Preserve existing behavior for a namespace path that is a file, not a directory, by checking the root WalkDir entry and returning ErrNoSuchNamespace
  • Keep existing WalkDir error handling for missing namespaces and non-empty namespaces

Verification

  • go test -v ./catalog/hadoop — pass
  • golangci-lint run --timeout=10m ./catalog/hadoop/... — 0 issues
  • git diff --check — clean

Fixes #1273

Signed-off-by: Joseph Yaksich <gitcommit90@users.noreply.github.com>
@gitcommit90 gitcommit90 requested a review from zeroshade as a code owner June 24, 2026 08:34

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending CI success

@laskoviymishka

Copy link
Copy Markdown
Contributor

is this still needed after #1273 and #1293?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: drop the redundant Stat before WalkDir in hadoop DropNamespace

3 participants