建议 grep 一下 master 的日志,这种大概率是已经被合并的 region,只是没有正确的 offline,可以看看当前表里和他重叠的那个
region 是怎么合并出来的

在 2.3 以后这种情况会少很多,主要是 AM-v2 和 procedure 存储的部分做了不少改进和优化

leojie <leo...@apache.org> 于2023年6月5日周一 16:09写道:

> hi all
> 请教社区一些HBase2中 Orphan Regions的问题,使用的hbase版本是2.2.6,hadoop版本是3.3.2
> HBase的hbck report页面出现了一些Orphan Regions,
> Orphan Regions on RegionServer
>
> 126 region(s) in set.
> Region NameReported Online RegionServer
> newptc_log,09c83c3e,1628548002412.5db648586560d01bcc5e4ae26348f14c.
> node27.hadoop,60020,1679982363818 <http://node27.hadoop:60030/rs-status>
> Orphan Regions on FileSystem
>
> 164 region(s) in set.
> Region Encoded NameFileSystem Path
> 5db648586560d01bcc5e4ae26348f14c
> hdfs://hadoop-namenode/hbase/data/default/newptc_log
> /5db648586560d01bcc5e4ae26348f14c
>
> 这些region的特点是:
>
> 1.  孤儿region的元数据信息在hbase:meta表中不存在,但仍会被一些RS报告,RS界面上可以搜索到这个region的信息,
> 2. 孤儿region对应的HBase表region是完整的,不存在region重叠或region空洞,表依旧正常被读写
> 3. region的hdfs目录结构如下:
> [root@hadoop-operator~]# sudo -uhbase hdfs dfs -ls -R
> /hbase/data/default/newptc_log/5db648586560d01bcc5e4ae26348f14c
> -rw-r--r--   3 hbase hbase        109 2023-04-06 10:37
> /hbase/data/default/newptc_log/5db648586560d01bcc5e4ae26348f14c/.regioninfo
> drwxr-xr-x   - hbase hbase          0 2023-04-06 10:38
> /hbase/data/default/newptc_log/5db648586560d01bcc5e4ae26348f14c/.tmp
> drwxr-xr-x   - hbase hbase          0 2023-04-17 18:10
> /hbase/data/default/newptc_log/5db648586560d01bcc5e4ae26348f14c/.tmp/task
> drwxr-xr-x   - hbase hbase          0 2023-04-06 10:37
>
> /hbase/data/default/newptc_log/5db648586560d01bcc5e4ae26348f14c/recovered.edits
> -rw-r--r--   3 hbase hbase          0 2023-04-06 10:37
>
> /hbase/data/default/newptc_log/5db648586560d01bcc5e4ae26348f14c/recovered.edits/3461430.seqid
> drwxr-xr-x   - hbase hbase          0 2023-04-17 18:10
> /hbase/data/default/newptc_log/5db648586560d01bcc5e4ae26348f14c/task
> -rw-r--r--   3 hbase hbase     121250 2023-04-17 17:06
>
> /hbase/data/default/newptc_log/5db648586560d01bcc5e4ae26348f14c/task/046f0b1f772e40e59131251eb6d6e44f
>
> 这些region下的hfile size大小不为0(个别是个空目录),我使用
>
> HFile.Reader读出这些hfile,与表中数据进行比对,发现这些孤儿region对应的数据不存在表里,(表没有设置TTL),且这些孤儿region
> 对应的HFILE中的数据都有Put标识(非delete),因此不确定这些孤儿region下的数据是否还有用。
> 我按照页面提示的步骤回放孤儿region目录,发现并不成功:
> First make sure *hbase:meta* is in a healthy state; run *hbck2 fixMeta* to
> be sure. Once this is done, per Region below, run a bulk load -- *$ hbase
> completebulkload REGION_DIR_PATH TABLE_NAME* -- and then delete the
> desiccated directory content (HFiles are removed upon successful load; all
> that is left are empty directories and occasionally a seqid marking file).
>
>
> 请教各位大佬,出现大面积孤儿region的根本原因是什么(发生这个问题之前,我们只是对表进行了大批量的小region合并操作,可能跟这个操作相关),是否有相关ISSUE修复?该如何确定这些孤儿region的hfile是否是冗余数据呢?
> 当重启RS时,这些孤儿region就会消失了,不确定是否会导致数据丢失。
>

Reply via email to