No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Error Is Reported When CTbase Is Used to Create Indexes on the FusionInsight Platform

Publication Date:  2019-04-12 Views:  54 Downloads:  0
Issue Description

An error is reported when CTbase Is used to create indexes on the FusionInsight platform. The secondary index fails to be created on the CTBase Web UI, and the following message is recorded in HMaster logs: REGION:testproto2,7^id007,1440118711478.c62421f36fe272104d138da7e51df8af. is not empty!

The following figure shows the created indexes.

The following figure shows the original indexes of the user table.

Handling Process

Manually create an empty region. To divide an empty region, perform the following steps:

In this example, the name of the cluster table is splitdemo.

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

On the HMaster page, click the table name. In Table Regions, find the last region and obtain its 

regionName.

As shown in the following figure, the regionName is 6da2b449566beb35ea680441b84fa036.


2. Search for the prefix of the used index in the table.

Run the following command in hbase shell:

scan '_ctmeta_', {ROWPREFIXFILTER => 'Cluster table name ^ User table name ^'}

For example:

scan '_ctmeta_', {ROWPREFIXFILTER => 'splitdemo^demou1^'}. Replace the table name when using this command. In the last line of the scanning result, as shown in the following figure, the value in red is the index prefix. In this case, the value is 3.


3. Obtain the start character of the empty region.

The start character of the last region can be obtained by running the command in step 2 and the start character of the next region can be obtained according to the sequence of 0-9 A-Z a-z. Take the previous step as an example, the start character of the last region is 3, so the start character of the next region will be 4. However, if the start character is greater than or equal to 4, the region will be empty with no data contained. So if data exists, it may be caused by data writing errors. Therefore, check whether the region is empty when its start character is greater than or equal to 4.

Run the following command in hbase shell:

scan 'Cluster table name', {STARTROW=> 'Start character'}

For example: scan ‘splitdemo’,{ STARTROW=>’4’}

Check whether data exists after the command execution.

If no data exists, the value of rowkey starts from 4 contains no data.

If data exists, find the last piece of data by scanning the value of the rowkey. Based on the rowkey value of the data, the next rowkey value of the data can be obtained. Starting from the next rowkey, the region may be empty and the next rowkey can be used as the start character. The value of the next rowkey needs not to be accurate.

4. Divide an empty region.

Run the following command in hbase shell:

Split 'Region name', 'Start character'

For Example:

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

5. An index can be recreated successfully.

Root Cause

A region with data cannot be divided into multiple regions.

END