Skip to content

HBASE-29875 Handle null-reader store files in compaction cleanup and selection#7972

Open
tr0k wants to merge 2 commits intoapache:branch-2.5from
tr0k:HBASE-29875-branch25-upstream
Open

HBASE-29875 Handle null-reader store files in compaction cleanup and selection#7972
tr0k wants to merge 2 commits intoapache:branch-2.5from
tr0k:HBASE-29875-branch25-upstream

Conversation

@tr0k
Copy link

@tr0k tr0k commented Mar 24, 2026

What this changes

This PR fixes HBASE-29875 in two commits:

  1. Guard DefaultStoreFileManager.getUnneededFiles against null readers
  2. Filter null-reader files before compaction selection in SortedCompactionPolicy

Why

In our 2.5.10 production environment, some stores reached a state
where HStoreFile.getReader() returned null. This caused compaction
paths to fail and blocked compaction progress for affected stores.

Validation

Validated on a downstream 2.5.10-based build with Java 11 and with:

  • TTL enabled
  • frequent flushes
  • MOB workload
  • manual and automatic compaction triggering

Observed result:

  • the known null-reader failure paths are avoided
  • healthy files can still be compacted
  • skipped null-reader files no longer abort compaction selection

Notes

This is a defensive fix around unexpected null-reader state. It does not
attempt to solve the root cause of why some HStoreFile instances end up
with reader == null.

tr0k added 2 commits March 24, 2026 15:58
…eededFiles

DefaultStoreFileManager.getUnneededFiles assumes HStoreFile.getReader()
is always non-null. In production we observed NullPointerException in the
expired-file cleanup path, which aborts compaction requests and can lead
to unbounded storefile growth for affected stores.

Guard against null readers and skip such files instead of throwing.
Add a focused unit test covering the null-reader case.
…ompaction selection

After guarding getUnneededFiles, null-reader HStoreFiles could still
reach compaction policy evaluation and interfere with minor compaction
selection.

Filter null-reader files out of the eligible candidate list before
compaction selection so healthy files can still be compacted.
Add a unit test covering the selection path with null-reader files.
@tr0k tr0k changed the base branch from master to branch-2.5 March 24, 2026 15:06
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.

1 participant