[ 
https://issues.apache.org/jira/browse/HBASE-30381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiao Liu resolved HBASE-30381.
------------------------------
    Hadoop Flags: Reviewed
      Resolution: Fixed

> MOB snapshot scanning fails on branch-2.5 after HBASE-29662
> -----------------------------------------------------------
>
>                 Key: HBASE-30381
>                 URL: https://issues.apache.org/jira/browse/HBASE-30381
>             Project: HBase
>          Issue Type: Bug
>          Components: mapreduce, mob, snapshots
>    Affects Versions: 2.5.13, 2.5.14, 2.5.15, 2.5.16
>            Reporter: Xiao Liu
>            Assignee: Xiao Liu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.5.17
>
>
> h2. Problem
> MOB snapshot scanning fails on branch-2.5 through both:
> * \{{TableSnapshotInputFormat}}, which generates an input split for the MOB 
> pseudo-region.
> * \{{TableSnapshotScanner}} with \{{snapshotAlreadyRestored=true}}, which 
> includes the MOB pseudo-region in its region list.
> Opening the pseudo-region as a regular region fails with:
> {noformat}
> java.io.IOException: Region directory does not exist: 
> .../data/<namespace>/<table>/<mob-region-encoded-name>
> {noformat}
> HBASE-30365 and HBASE-30368 fixed these paths on newer branches, but the 
> fixes are missing from branch-2.5.
> h2. Root cause and affected versions
> The missing MOB pseudo-region filtering has existed since at least 2.5.0. 
> Previously, region initialization could automatically create the missing 
> directory, masking the problem by scanning an empty region.
> HBASE-29662 was backported to branch-2.5 as commit 7b58903e6ea and first 
> included in 2.5.13. It prevents region initialization from silently creating 
> missing region directories, exposing this existing defect as a scan failure.
> This is not caused by HBASE-30336 on branch-2.5. The branch already skips MOB 
> regions when creating regular region directories in 
> \{{RestoreSnapshotHelper.cloneRegion()}}. MOB files are restored under 
> \{{mobdir}}, so the scanners must exclude the pseudo-region.
> h2. Reproduction
> # Create a MOB-enabled table, write MOB data, and take a snapshot.
> # Scan the snapshot using \{{TableSnapshotInputFormat}}; alternatively, 
> restore it with \{{RestoreSnapshotHelper.copySnapshotForScanner()}} and scan 
> it using \{{TableSnapshotScanner}} with \{{snapshotAlreadyRestored=true}}.
> # The scan fails when it attempts to open the MOB pseudo-region.
> A minimal local reproduction confirms both failures. Adding the MOB filters 
> makes both paths pass. A comparison using \{{HRegionFileSystem}} from 
> immediately before and after HBASE-29662 also confirms the transition from 
> automatic directory creation to the exception.
> h2. Proposed fix
> Backport the MOB pseudo-region filters from:
> * HBASE-30365: \{{TableSnapshotInputFormatImpl.getRegionInfosFromManifest()}}.
> * HBASE-30368: \{{TableSnapshotScanner.isValidRegion()}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to