Skip to content

HBASE-28660 list_namespace not working after an incorrect user input (branch-2)#7971

Open
arvindKandpal-ksolves wants to merge 1 commit intoapache:branch-2from
arvindKandpal-ksolves:HBASE-28660-branch-2
Open

HBASE-28660 list_namespace not working after an incorrect user input (branch-2)#7971
arvindKandpal-ksolves wants to merge 1 commit intoapache:branch-2from
arvindKandpal-ksolves:HBASE-28660-branch-2

Conversation

@arvindKandpal-ksolves
Copy link

Why are the changes needed?

This is a backport of the fix for HBASE-28660 to branch-2.
When a user enters an incorrect command like list_namespace, 'ns.*', the JRuby parser mistakenly creates a local variable initialized to nil before throwing a SyntaxError. Because Ruby prioritizes local variables over method calls, subsequent valid commands return empty/nil instead of executing the actual shell command.

How does this PR fix the problem?

  • Added the same cleanup mechanism inside hirb.rb's eval_input loop that was merged into the master branch.
  • Checks for collisions (shadowing) with registered HBase shell commands.
  • Warns the user via stderr and safely discards the polluted binding.
  • Includes the updated comprehensive test cases in general_test_cluster.rb covering all 5 affected commands (list, list_namespace, list_snapshots, scan, processlist).

Tests run

Ran the shell tests locally on branch-2 with the Hadoop 3 profile and verified that all tests pass without regressions.
mvn test -Dtest=TestShell -pl hbase-shell -Dhadoop.profile=3.0

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.

1 participant