Skip to content

HBASE-30352 Tolerate stale recovered.edits below durable seqid in split/merge (branch-2.4 backport) - #8706

Closed
nirdosh0110 wants to merge 1 commit into
apache:branch-2.4from
nirdosh0110:HBASE-30352-branch-2.4
Closed

nirdosh0110 wants to merge 1 commit into
apache:branch-2.4from
nirdosh0110:HBASE-30352-branch-2.4

Conversation

@nirdosh0110

Copy link
Copy Markdown
Contributor

Backport of #8599 to branch-2.4 (JIRA: HBASE-30352).

Problem

On split/merge, AssignmentManagerUtil.checkClosedRegion aborts the procedure whenever any recovered.edits file exists for a parent region, to prevent data loss. In corner cases a region can be left with recovered.edits whose max seqid is already covered by the region's durable (last-flushed) seqid — those edits are provably redundant, yet their mere presence wedges the split/merge into a stuck RIT that requires manual cleanup.

Change

checkClosedRegion now tolerates such stale files: before aborting, it consults the master's last-flushed seqid for the region and, only when that watermark is authoritative (> 0), drops recovered.edits files whose max seqid is <= durableSeqId. If any file's seqid is above the watermark (or the watermark is unknown), it still aborts as before — no behavior change for the genuinely-unsafe case.

  • Scans the region WAL dir, region dir, and the "wrong" WAL region dir via WALSplitUtil.getSplitEditFilesSorted.
  • Deletes only files strictly at/below durableSeqId; a failed delete or an unparseable/higher seqid falls back to the safe abort.

Test

TestAssignmentManagerUtil covers the new path (3 tests, all green locally).

Verification (local)

  • mvn -pl hbase-server -am clean test -Dtest=TestAssignmentManagerUtil -Dhadoop.profile=3.0 (JDK8) → Tests run: 3, Failures: 0, Errors: 0
  • mvn -pl hbase-server spotless:check -Dhadoop.profile=3.0 → BUILD SUCCESS

Backport notes

  • Adapted from the branch-2 change. The production file (AssignmentManagerUtil.java) applied cleanly, including the added Logger/FS imports.
  • The test file needed JUnit4 adaptation (branch-2.4 uses JUnit4, not JUnit5): kept org.junit.* / @Category / @ClassRule, added assertTrue, and switched the new assertion to JUnit4 argument order (assertFalse(message, condition)).

…it/merge

Backport of apache#8599 to branch-2.4.

(cherry picked from commit cc1876e)
@virajjasani

Copy link
Copy Markdown
Contributor

@nirdosh0110 I realized branch-2.4 doesn't seem active anymore, we can leave this backport and close the PR.

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.

2 participants