You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by lz...@apache.org on 2022/07/20 10:29:34 UTC

[flink-table-store] branch release-0.2 updated: [hotfix] Adjust numLevels to numSortedRunCompactionTrigger + 1 by default

This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch release-0.2
in repository https://gitbox.apache.org/repos/asf/flink-table-store.git


The following commit(s) were added to refs/heads/release-0.2 by this push:
     new 49b1745b [hotfix] Adjust numLevels to numSortedRunCompactionTrigger + 1 by default
49b1745b is described below

commit 49b1745b52e2552a9fef51e2739b603d3c5c8ff7
Author: JingsongLi <lz...@aliyun.com>
AuthorDate: Wed Jul 20 18:29:25 2022 +0800

    [hotfix] Adjust numLevels to numSortedRunCompactionTrigger + 1 by default
---
 .../src/main/java/org/apache/flink/table/store/CoreOptions.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/flink-table-store-core/src/main/java/org/apache/flink/table/store/CoreOptions.java b/flink-table-store-core/src/main/java/org/apache/flink/table/store/CoreOptions.java
index 8a7a5362..e78dbee9 100644
--- a/flink-table-store-core/src/main/java/org/apache/flink/table/store/CoreOptions.java
+++ b/flink-table-store-core/src/main/java/org/apache/flink/table/store/CoreOptions.java
@@ -414,7 +414,11 @@ public class CoreOptions implements Serializable {
         // By default, this ensures that the compaction does not fall to level 0, but at least to
         // level 1
         Integer numLevels = options.get(NUM_LEVELS);
-        numLevels = numLevels == null ? numSortedRunStopTrigger() + 1 : numLevels;
+        int expectedRuns =
+                maxSortedRunNum() == Integer.MAX_VALUE
+                        ? numSortedRunCompactionTrigger()
+                        : numSortedRunStopTrigger();
+        numLevels = numLevels == null ? expectedRuns + 1 : numLevels;
         return numLevels;
     }