lintingbin opened a new pull request, #4179:
URL: https://github.com/apache/amoro/pull/4179

   ## What changes were proposed in this pull request?
   
   `reachMinorInterval()` uses the table-level `lastMinorOptimizingTime`, which 
is frequently reset by high-traffic partitions. This causes partitions with 
fewer small files (below the minor trigger file count threshold) to never get 
minor optimized, even when their files accumulate over time.
   
   ### Root Cause
   
   The `lastMinorOptimizingTime` is a single table-level timestamp shared 
across all partitions. When a high-traffic partition triggers minor 
optimization, the timestamp is reset for the entire table. Cold partitions 
(with few files, not reaching `minor-trigger-file-count`) rely on 
`reachMinorInterval()` to trigger optimization, but the interval check never 
passes because the table-level timestamp keeps getting refreshed.
   
   ### Solution
   
   Added a cross-day fallback mechanism in `reachMinorInterval()`:
   
   - When `minorLeastInterval` is less than one day (which is the typical 
configuration, default is 1 hour), and the last minor optimization happened on 
a different calendar day, `reachMinorInterval()` returns `true`.
   - This ensures every partition gets at least one minor optimization attempt 
per day, preventing starvation of cold partitions.
   - The guard `minorLeastInterval < 1 day` avoids semantic conflict when users 
intentionally set a longer interval (e.g., 2 days).
   
   Also added Javadoc to `SELF_OPTIMIZING_MINOR_TRIGGER_INTERVAL` to document 
the expected range and the cross-day fallback behavior.
   
   ## How was this patch tested?
   
   Existing `TestOptimizingEvaluator` tests pass. The change is minimal and 
additive — it only adds a fallback path that activates when the normal interval 
check fails and a day boundary has been crossed.
   
   Closes #4055


-- 
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]

Reply via email to