Repository navigation
Conversation
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.
JIRA: https://issues.apache.org/jira/browse/HBASE-30213.
What changes were proposed in this pull request?
Maintain an atomic heap-plus-off-heap MemStore total in HRegion through the existing increment/decrement paths. Use this total for write-blocking and flush threshold checks, including WAL replay, and account for the additional counter's heap overhead.
Per-component statistics, configured thresholds and the meta-region exemption remain unchanged. No public API or shared MemStoreSizing implementation is changed.
Why are the changes needed?
Heap and off-heap counters are read independently. A read spanning a flush and subsequent writes can combine values from different points in time and overestimate the total, causing a spurious RegionTooBusyException or an unnecessary flush request.
The change removes these mixed-counter reads from region threshold checks. It does not make the component counters, aggregate and actual memory changes transactional. They can temporarily differ while updates overlap, and transient rejections are still possible. Once updates complete, the aggregate must equal heap plus off-heap.
How was this patch tested?
Added coverage for mixed snapshots, threshold boundaries, nonzero mixed-sign deltas, exact accounting after concurrent updates, and real BASIC/EAGER in-memory compaction and flush with heap and off-heap allocation.
The tests also verify executor termination, WAL close attempts after a region close failure, and restoration of ChunkCreator.instance and chunkPoolDisabled, including when both region and WAL closure fail.