Skip to content

HBASE-30368 TableSnapshotScanner fails on an already restored MOB tab… - #8628

Open
liuxiaocs7 wants to merge 3 commits into
apache:masterfrom
liuxiaocs7:HBASE-30368
Open

HBASE-30368 TableSnapshotScanner fails on an already restored MOB tab…#8628
liuxiaocs7 wants to merge 3 commits into
apache:masterfrom
liuxiaocs7:HBASE-30368

Conversation

@liuxiaocs7

Copy link
Copy Markdown
Member

…le snapshot

see: HBASE-30368

@liuxiaocs7
liuxiaocs7 requested a lite review from Copilot September 8, 2026 10:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

This PR addresses failures in TableSnapshotScanner when scanning a snapshot that has been restored from a MOB-enabled table (HBASE-30368), by ensuring MOB “dummy” regions are excluded from scan region selection.

Changes:

  • Add a new test that restores a MOB snapshot and verifies the scanner behaves correctly with a start row that yields no results.
  • Update TableSnapshotScanner to filter out MOB region info entries when determining valid regions to scan.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTableSnapshotScanner.java Adds a regression test covering restored MOB snapshot scanning behavior.
hbase-server/src/main/java/org/apache/hadoop/hbase/client/TableSnapshotScanner.java Excludes MOB dummy regions from isValidRegion to avoid attempting to open non-existent region dirs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +164 to +166
// The mob region is a dummy region used only to organise mob files under mobdir. It has no
// region directory under the table dir to open, and holds no rows. See HBASE-30365 and
// HBASE-30368.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. The fix looks right to me.

I verified it locally: the test fails without the isValidRegion change, and a full scan of a restored mob snapshot still returns the real values, so skipping the pseudo-region does not lose data.

I have one request though. I realized the last clause of the comment ("holds no rows") is not accurate.

DefaultMobStoreFlusher appends the original cell to the mob file, then writes a reference cell to the normal store:

mobFileWriter.append(c);
...
// The key is same, the value is the filename of the mob file
ExtendedCell reference = MobUtils.createMobRefCell(c, fileName, ...);
writer.append(reference);

So the mob files do hold every row, with the real values. They just must not be scanned as a region, since they are reached by reference from the real regions. Simplest fix is to drop that clause:

Suggested change
// The mob region is a dummy region used only to organise mob files under mobdir. It has no
// region directory under the table dir to open, and holds no rows. See HBASE-30365 and
// HBASE-30368.
// The mob region is a dummy region used only to organise mob files under mobdir. It has no
// region directory under the table dir to open. See HBASE-30365 and HBASE-30368.

That wording is mine from HBASE-30365, so the same clause is already on master in TableSnapshotInputFormatImpl. Could you fix that one in this PR too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @junegunn, thanks for catching this and for verifying the full scan. You're right—the “holds no rows” wording is inaccurate. I've removed it from both TableSnapshotScanner and TableSnapshotInputFormatImpl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants