[
https://issues.apache.org/jira/browse/HBASE-24581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Huaxiang Sun updated HBASE-24581:
---------------------------------
Issue Type: Improvement (was: Bug)
Priority: Major (was: Critical)
Debugged more, found out the that the check for replica region is there when it
goes to store.selectCompaction.
Since it is deep in the stack, it can be improved by moving the check at the
very begin of the compaction process.
> Replica regions should not trigger any compaction
> -------------------------------------------------
>
> Key: HBASE-24581
> URL: https://issues.apache.org/jira/browse/HBASE-24581
> Project: HBase
> Issue Type: Improvement
> Components: read replicas
> Affects Versions: 2.3.0
> Reporter: Huaxiang Sun
> Assignee: Huaxiang Sun
> Priority: Major
>
> I found that in certain cases replica regions can trigger compaction, one
> example as follows, need to check all places to avoid compaction for replica
> regions.
> {code:java}
> @Override
> public void postOpenDeployTasks(final PostOpenDeployContext context) throws
> IOException {
> HRegion r = context.getRegion();
> long openProcId = context.getOpenProcId();
> long masterSystemTime = context.getMasterSystemTime();
> rpcServices.checkOpen();
> LOG.info("Post open deploy tasks for {}, openProcId={},
> masterSystemTime={}",
> r.getRegionInfo().getRegionNameAsString(), openProcId, masterSystemTime);
> // Do checks to see if we need to compact (references or too many files)
> // TODO: SHX, do not do this for replica regions? Otherwise, it is going to
> lost data locality for primary regions.
> for (HStore s : r.stores.values()) {
> if (s.hasReferences() || s.needsCompaction()) {
> this.compactSplitThread.requestSystemCompaction(r, s, "Opening Region");
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)