Hi,all.I have some questions When I use Flink kube...
# troubleshooting
d
Hi,all.I have some questions When I use Flink kubernetes operator.And the version is
Flink:v1_18
and
operator:v1.7
. The parallelism of task's source and sink are both 6 when it started,and the autoscaler operator is enabled. The Autoscaler yaml configuration is like this:
Copy code
apiVersion: flink.apache.org/v1beta1
kind: FlinkDeployment
metadata:
  name: xx
  namespace: flink
spec:
  image: xx
  imagePullPolicy: Always
  flinkVersion: v1_18
  flinkConfiguration:
    job.autoscaler.enabled: "true"
    job.autoscaler.stabilization.interval: 2min
    job.autoscaler.metrics.window: 10min
    job.autoscaler.target.utilization: "0.8"
    job.autoscaler.target.utilization.boundary: "0.2"
    job.autoscaler.scale-down.max-factor: "0.5"
    job.autoscaler.scale-up.max-factor: "2"
    job.autoscaler.restart.time: 2min
    job.autoscaler.catch-up.duration: 10min
    job.autoscaler.metrics.busy-time.aggregator: "AVG"
    job.autoscaler.vertex.min-parallelism: "3"
    job.autoscaler.vertex.max-parallelism: "9"
    job.autoscaler.scale-up.grace-period: 30min
    jobmanager.scheduler: adaptive
...
When using webui to decrease the parallelism of task source vertex through -, an error is reported as follows: the vertex of conigmap is :
Copy code
parallelismOverrides:
9dd63673dd41ea021b896d5203f3ba7c:4,cbc357ccb763df2852fee8c4fc7d55f2:5
the source is cbc357ccb763df2852fee8c4fc7d55f2 and the sink is 9dd63673dd41ea021b896d5203f3ba7c
and the exception is :
Copy code
Server Response Message:
org.apache.flink.runtime.rest.handler.RestHandlerException: The requested lower bound [5] for job vertex [cbc357ccb763df2852fee8c4fc7d55f2] is higher than the upper bound [4].
	at org.apache.flink.runtime.dispatcher.Dispatcher.validateMaxParallelism(Dispatcher.java:1216)
	at org.apache.flink.runtime.dispatcher.Dispatcher.lambda$updateJobResourceRequirements$32(Dispatcher.java:1170)
	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.complete(Unknown Source)
	at org.apache.flink.runtime.rpc.pekko.PekkoInvocationHandler.lambda$invokeRpc$1(PekkoInvocationHandler.java:268)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.complete(Unknown Source)
	at org.apache.flink.util.concurrent.FutureUtils.doForward(FutureUtils.java:1267)
	at org.apache.flink.runtime.concurrent.ClassLoadingUtils.lambda$null$1(ClassLoadingUtils.java:93)
	at org.apache.flink.runtime.concurrent.ClassLoadingUtils.runWithContextClassLoader(ClassLoadingUtils.java:68)
	at org.apache.flink.runtime.concurrent.ClassLoadingUtils.lambda$guardCompletionWithContextClassLoader$2(ClassLoadingUtils.java:92)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.complete(Unknown Source)
	at org.apache.flink.runtime.concurrent.pekko.ScalaFutureUtils$1.onComplete(ScalaFutureUtils.java:47)
	at org.apache.pekko.dispatch.OnComplete.internal(Future.scala:310)
	at org.apache.pekko.dispatch.OnComplete.internal(Future.scala:307)
	at org.apache.pekko.dispatch.japi$CallbackBridge.apply(Future.scala:234)
	at org.apache.pekko.dispatch.japi$CallbackBridge.apply(Future.scala:231)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
	at org.apache.flink.runtime.concurrent.pekko.ScalaFutureUtils$DirectExecutionContext.execute(ScalaFutureUtils.java:65)
	at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:72)
	at scala.concurrent.impl.Promise$DefaultPromise.$anonfun$tryComplete$1(Promise.scala:288)
	at scala.concurrent.impl.Promise$DefaultPromise.$anonfun$tryComplete$1$adapted(Promise.scala:288)
	at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:288)
	at org.apache.pekko.pattern.PromiseActorRef.$bang(AskSupport.scala:629)
	at org.apache.pekko.pattern.PipeToSupport$PipeableFuture$$anonfun$pipeTo$1.applyOrElse(PipeToSupport.scala:34)
	at org.apache.pekko.pattern.PipeToSupport$PipeableFuture$$anonfun$pipeTo$1.applyOrElse(PipeToSupport.scala:33)
	at scala.concurrent.Future.$anonfun$andThen$1(Future.scala:536)
	at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
	at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
	at org.apache.pekko.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:73)
	at org.apache.pekko.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:110)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85)
	at org.apache.pekko.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:110)
	at org.apache.pekko.dispatch.TaskInvocation.run(AbstractDispatcher.scala:59)
	at org.apache.pekko.dispatch.ForkJoinExecutorConfigurator$PekkoForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:57)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
i want to know if there have any bug when using webui to descrease the parallelism?or i use it with the wrong way?
g
Why are you using the WebUI to change parallelism and use the autoscaler at the same time? You might have introduced a race condition there
If you use the autoscaler/operator then you should not touch the webui for any actions if possible
Also I would suggest removing these configs:
Copy code
job.autoscaler.scale-down.max-factor: "0.5"
    job.autoscaler.scale-up.max-factor: "2"
    job.autoscaler.metrics.busy-time.aggregator: "AVG"
In most cases it’s bettter to have the default MAX aggregator and the max scale down/up factor of 0.5/2 may cause some issues depending on your max parallelism config.
also setting the catch up duration too low will cause the autoscaler to add more extra capacity. You should start by setting this to something like 15/30 mins instead
but thats just a recommendation 🙂
d
The main purpose of using Autoscaler is to automatically expand or shrink tasks, in order to reduce costs, so that I can use the least number of machines to run tasks during my low peak hours. The main purpose of using webui is to manually increase or decrease parallelism to release the free slots of excess tasks. For example, taskmanager. numberOfTaskSlots: "2" At this point, the maximum parallelism of my task is 5. I want to manually release the maximum parallelism to 4 to release a slot to the cluster resource, so that other tasks cannot be used. So Will there be any issues with using these two functions together?
ok,thank you.i will take your advise.
the job max/min parallelismis
Copy code
job.autoscaler.vertex.min-parallelism: "3"
    job.autoscaler.vertex.max-parallelism: "9"
g
That’s not the max parallelism I am talking about. I was referring to the max parallelism setting for the Flink job itself
I don’t think the autoscaler works together with manually setting the webui parallelism
They call the same rest api with conflicting parallelism settings (as you can see )
d
the param can make the job not restart and t improvements to the speed of scaling operations:
Copy code
jobmanager.scheduler : adaptive
so i use it and i found the param:https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-release-1.7/docs/custom-resource/autoscaler/#how-to-use-autoscaler-standalone and i found another question is only the sink can decrease the parallelism .And source is not busy,it make the slots free,and can not release. the sink is 5->4->2