Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,14 @@ public class Config extends ConfigBase {
@ConfField(mutable = true, masterOnly = true)
public static long dynamic_partition_check_interval_seconds = 600;

/**
* When scheduling dynamic partition tables,
* the execution interval of each table to prevent excessive consumption of FE CPU at the same time
* default is 0
*/
@ConfField(mutable = true, masterOnly = true)
public static long dynamic_partition_step_interval_ms = 0;

/**
* If set to true, dynamic partition feature will open
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,20 @@ public void executeDynamicPartition(Collection<Pair<Long, Long>> dynamicPartitio
}
cloudBatchAfterCreatePartitions(executeFirstTime, partsInfo,
addPartitionClauses, db, olapTable, indexIds, tableName);

// ATTN: Breaking up dynamic partition table scheduling, consuming peak CPU consumption
if (!executeFirstTime && !addPartitionClauses.isEmpty()
&& Config.dynamic_partition_step_interval_ms > 0) {
long sleep = Config.dynamic_partition_step_interval_ms;
if (sleep > 1800 * 1000) {
LOG.warn("fe conf dynamic_partition_step_interval_ms bigger than 1800s, plz check it");
}
try {
Thread.sleep(sleep);
} catch (InterruptedException e) {
LOG.warn("sleep err", e);
}
}
}
}
}
Expand Down