HBASE-29272 Fix TableSnapshotInputFormatImpl returning 0 for InputSplit length (branch-2.6)#8493
Open
terrytlu wants to merge 1 commit into
Open
HBASE-29272 Fix TableSnapshotInputFormatImpl returning 0 for InputSplit length (branch-2.6)#8493terrytlu wants to merge 1 commit into
terrytlu wants to merge 1 commit into
Conversation
terrytlu
force-pushed
the
HBASE-29272-backport-2.6
branch
5 times, most recently
from
July 23, 2026 11:26
b9a14d8 to
54039b3
Compare
…eturning 0 on branch-2.6 When Spark reads a snapshot, InputSplit.getLength() always returned 0, so the distributed execution framework skipped the split and the job produced empty/incomplete data. Compute the actual region size via SnapshotRegionSizeCalculator (which returns a new RegionSizes holder) and use it as the split length. Per the HBase API stability policy, the public 5-arg TableSnapshotRegionSplit constructor is retained but marked @deprecated (since 2.6.7, to be removed in 4.0.0), matching the removal already done on master. Co-authored-by: Peng Lu <lupeng@apache.org> Signed-off-by: terrytlu <terrytlu@tencent.com> Signed-off-by: Peng Lu <lupeng@apache.org>
terrytlu
force-pushed
the
HBASE-29272-backport-2.6
branch
from
July 23, 2026 12:10
54039b3 to
4678de1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #6947 to branch-2.6.
When Spark reads an HBase snapshot via
TableSnapshotInputFormat,InputSplit.getLength()always returned 0. This caused the distributed computation framework (e.g. Spark) to treat all splits as empty and skip processing, resulting in no data or bogus data being read.This change calculates the per-region size via the new
SnapshotRegionSizeCalculatorand sets theInputSplitlength accordingly, so the framework can correctly schedule and process the splits.Changes
RegionSizesandSnapshotRegionSizeCalculatorclasses.SnapshotInfonow accumulates per-region sizes during manifest scanning.TableSnapshotInputFormatImpl.InputSplitcarries alengthfield, serialized inwrite/readFields.TestSnapshotRegionSizeCalculator.Branch-specific note
On this stable branch the
@DeprecatedTableSnapshotRegionSplitconstructors (using HTableDescriptor/HRegionInfo) are retained for API compatibility. They are only removed on master (4.0.0).Tests
mvn test -pl hbase-server -Dtest=TestSnapshotRegionSizeCalculator