You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "JingsongLi (via GitHub)" <gi...@apache.org> on 2026/08/03 03:57:39 UTC

[PR] [core] Fix forced L0 compaction level selection [paimon]

JingsongLi opened a new pull request, #8993:
URL: https://github.com/apache/paimon/pull/8993

   ## What changed
   
   - Include an existing level 1 run in the initial forced-L0 candidates so the size-ratio check evaluates level 2 using the combined level 0 and level 1 size.
   - Add focused coverage for both including and excluding level 2 at the size-ratio boundary.
   - Add a table-level regression test that constructs real level 0, level 1, and level 2 files and verifies they compact into one level 2 file.
   
   ## Why
   
   `forcePickL0` previously evaluated the size ratio starting with level 0 only. When level 0 was too small compared with level 1, `createUnit` added level 1 later to avoid producing another level 0 file, but level 2 was never reconsidered. Repeated forced compactions could therefore keep growing and rewriting level 1, causing excessive write amplification.
   
   ## Validation
   
   ```text
   mvn -pl paimon-core -am -DfailIfNoTests=false -DwildcardSuites=none -Dtest=ForceUpLevel0CompactionTest,UniversalCompactionTest,PrimaryKeySimpleTableTest#testForceUpLevel0CompactionConsidersLevel2 test
   ```
   
   All 14 selected tests passed, including Checkstyle, Spotless, and Enforcer checks. The table-level regression was also verified to fail against the old selection logic, leaving separate level 1 and level 2 files.
   


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core] Fix forced L0 compaction level selection [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #8993:
URL: https://github.com/apache/paimon/pull/8993


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org