You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "czy006 (via GitHub)" <gi...@apache.org> on 2026/08/18 08:58:09 UTC
Re: [PR] [hotfix][Optimizer] Guard invalid fragment ratio and target quota [amoro]
czy006 commented on code in PR #4324:
URL: https://github.com/apache/amoro/pull/4324#discussion_r3802571088
##########
amoro-common/src/main/java/org/apache/amoro/config/OptimizingConfig.java:
##########
@@ -226,7 +226,9 @@ public OptimizingConfig setMinTargetSizeRatio(double minTargetSizeRatio) {
}
public long maxFragmentSize() {
- return targetSize / fragmentRatio;
+ // A non-positive fragment ratio (misconfigured property or legacy persisted value) means
+ // "no fragmenting": fall back to the target size instead of dividing by zero in planners.
+ return fragmentRatio <= 0 ? targetSize : targetSize / fragmentRatio;
Review Comment:
Good catch. I updated the fallback to use the documented default fragment ratio of 8, so the default 128 MiB target size yields a 16 MiB fragment threshold. CommonPartitionEvaluator now calls OptimizingConfig.maxFragmentSize() instead of performing the raw division, and a planner-level regression test covers both zero and negative ratios.
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org