Skip to content

Commit 4c8e4de

Browse files
committed
Improving tm replica interpretation
Signed-off-by: mszacillo <[email protected]>
1 parent a1bcbf1 commit 4c8e4de

File tree

1 file changed

+12
-2
lines changed
  • pkg/resourceinterpreter/default/thirdparty/resourcecustomizations/flink.apache.org/v1beta1/FlinkDeployment

1 file changed

+12
-2
lines changed

pkg/resourceinterpreter/default/thirdparty/resourcecustomizations/flink.apache.org/v1beta1/FlinkDeployment/customizations.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,18 @@ spec:
3838
jm_replicas = 1
3939
end
4040
41-
parallelism = observedObj.spec.job.parallelism
42-
tm_replicas = math.ceil(parallelism / observedObj.spec.flinkConfiguration['taskmanager.numberOfTaskSlots'])
41+
-- TaskManager replica setting takes precedence over parallelism setting
42+
43+
tm_replicas = observedObj.spec.taskManager.replicas
44+
if isempty(tm_replicas) then
45+
parallelism = observedObj.spec.job.parallelism
46+
task_slots = observedObj.spec.flinkConfiguration['taskmanager.numberOfTaskSlots']
47+
if isempty(parallelism) or isempty(task_slots) then
48+
tm_replicas = 1
49+
else
50+
tm_replicas = math.ceil(parallelism / observedObj.spec.flinkConfiguration['taskmanager.numberOfTaskSlots'])
51+
end
52+
end
4353
4454
replica = jm_replicas + tm_replicas
4555

0 commit comments

Comments
 (0)