Copilot commented on code in PR #7048:
URL: https://github.com/apache/hbase/pull/7048#discussion_r2119201485
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java:
##########
@@ -503,12 +509,13 @@ public int getSplitQueueSize() {
return splits.getQueue().size();
}
- private boolean shouldSplitRegion() {
+ private boolean shouldSplitRegion(RegionInfo ri) {
if (server.getNumberOfOnlineRegions() > 0.9 * regionSplitLimit) {
LOG.warn("Total number of regions is approaching the upper limit " +
regionSplitLimit + ". "
+ "Please consider taking a look at
http://hbase.apache.org/book.html#ops.regionmgt");
}
- return (regionSplitLimit > server.getNumberOfOnlineRegions());
+ return (regionSplitLimit > server.getNumberOfOnlineRegions()
+ && ri.getReplicaId() == RegionInfo.DEFAULT_REPLICA_ID);
Review Comment:
[nitpick] Since this condition ensures that only primary replicas are
allowed to be split, consider adding a brief code comment or updating the
documentation to clarify this behavior for future maintainers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]