setRegionState (Hbck2)

Manually sets the state of a specific region in hbase:meta.

This command is high risk and should be used only as a last resort in extreme situations.

Command Syntax

Bash
Copy

Options

-i, --inputFiles <file1> [<file2>...] Specifies one or more files containing encoded region names and region states, one pair per line.

Possible Region States

Bash
Copy

Description

Use this command when a region’s state in hbase:meta is incorrect and is blocking an operation such as assign or unassign. For example, an unassign operation may only proceed if the region is in one of the following states:

Bash
Copy

Before running this command, you must ensure that no active procedure—such as assign, split, or merge—is currently handling the region. To verify this, use the list_procedures command in the HBase shell.

For tables with region replicas, the region identifier must include both:

  • The primary region’s encoded region name
  • The replica ID

Use the format:

Bash
Copy

Return Values

  • "0" — The region state was successfully changed
  • "1" — The region state could not be changed

Examples

  1. Set a region to the CLOSING state:
Bash
Copy
  1. Set region states from a file (fileName1):

Example contents of fileName1:

Bash
Copy

Run the command:

Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated