HBASE-30368 TableSnapshotScanner fails on an already restored MOB tab… - #8628
HBASE-30368 TableSnapshotScanner fails on an already restored MOB tab…#8628liuxiaocs7 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
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
TableSnapshotScannerto 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.
| // 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. |
There was a problem hiding this comment.
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:
| // 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?
There was a problem hiding this comment.
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.
…le snapshot
see: HBASE-30368