Got it

CTBase failed to create a secondary index pre-allocated regions

Latest reply: Jan 22, 2022 11:38:41 645 13 5 0 0

Hello, friend!

Do you know how to solve the CTBase fails to create a secondary index pre-allocated regions? Don't worry, the post will share with you!

Problem Description

CTBase fails to create a secondary index pre-allocated regions.

Problem Analysis

Failed to create a secondary index on the CTBase Web UI and reported REGION:testproto2,7^id007,1440118711478.c62421f36fe272104d138da7e51df8af. is not empty! in HMaster Logs. This is because a region with data cannot be divided into multiple regions at the same time.

Solution

You need to manually create an empty region. To divide an empty region, perform the following steps:

The clustered table in the example is named splitdemo.

1. Find the last region in the cluster table and obtain the region name. 

On the HMaster page, click a table name, find the last region in Table Regions, and obtain its region name. As shown in the following figure, the region name is 6da2b449566beb35ea680441b84fa036.

HSmater

2. Search for used index prefixes in the table.

Run the following command in the HBase shell:scan '_ctmeta_', {ROWPREFIXFILTER =>'Cluster table name^User table name^'};

For example:

scan '_ctmeta_', {ROWPREFIXFILTER => 'splitdemo^demou1^'}. Run this command to replace the table name. In the last line of the scan result, the value in red is obtained. The value is the index prefix, as shown in the figure, which is 3.

table

3. Obtain the start character of an empty region. The last prefix is obtained in the order of 0-9 A-Z a-z. The last prefix is an unused prefix. In the previous step, if the last prefix is 3, the next unused prefix is 4. Generally, no data exists after character 4 in the rowkey table. However, the write data error cannot be excluded. Therefore, you need to check whether the rowkey following character 4 exists in the table.Run the following command in the HBase shell: 

scan'cluster table name', {STARTROW=>'start character'};

For example, scan 'splitdemo', {STARTROW=>'4'}

Run the following command to check whether data exists:

If no data exists, the rowkey starts from 4.

If data exists, scan the last piece of data and check the rowkey of the data to determine the next rowkey. In this case, the region starting from the next rowkey is blank. The next rowkey does not need to be precise. It's the starting character.

4. Split a blank region, Run the following command in the HBase shell: 

Split'region name','start character' ;

For example, 

Split 'e7d93f64f986d4b79939b0141ce8fe20' and '4'. The two parameters are the region name obtained in step 1 and step 3 and the start character of the empty region, respectively. 

5. Create the index again.

That's all, thanks!

  • x
  • convention:

Unicef
MVE Created Jul 23, 2021 06:26:38

WELL DONE
View more
  • x
  • convention:

olive.zhao
olive.zhao Created Aug 3, 2021 02:47:26 (0) (0)
Thanks!  
Navin_kay
Navin_kay Created Jan 22, 2022 11:37:42 (0) (0)
 
wissal
MVE Created Jul 30, 2021 10:46:44

Very useful, good job.
View more
  • x
  • convention:

olive.zhao
olive.zhao Created Aug 3, 2021 02:47:33 (0) (0)
 
Navin_kay
Navin_kay Created Jan 22, 2022 11:37:48 (0) (0)
 
olive.zhao
Admin Created Aug 3, 2021 06:35:53

  • x
  • convention:

chantha
chantha Created Jan 22, 2022 11:38:35 (0) (0)
 
MahMush
Moderator Author Created Jan 7, 2022 04:38:43

learning is always fun.
View more
  • x
  • convention:

olive.zhao
olive.zhao Created Mar 21, 2022 00:37:03 (0) (0)
Thanks!  
user_4358465
Created Jan 19, 2022 15:45:09

Very useful, good job.
View more
  • x
  • convention:

chantha
Created Jan 22, 2022 11:38:41

Nice
View more
  • x
  • convention:

olive.zhao
olive.zhao Created Mar 22, 2022 06:02:39 (0) (0)
Thanks!  

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.