Open Leoyzen opened 1 year ago
@danny0405 I think Hudi supports the Flink compactor in service mode. Is there any config to get it right?
@danny0405 @yihua Is there any solution right now? We have a source which produce 100k tps+ and taskmanager keeps crash timeout when using online compaction.
@Leoyzen Thanks for the feedback, it seems that Flink does not allow multiple jobs in one execution env in some modes(high availability HA or web submission), so I fired a fix here: https://github.com/apache/hudi/pull/7588.
I also notice that you use the Flink jar provided by Aliyun EMR maybe, it is not that easy for version upgrade.
@danny0405 Thanks for the fix, I will give it a try. Yeah I'm using aliyun vvp/vvr, but the bundle is compiled by myself and manually provided as individual jar.So it will not depend on the enviroment.
@danny0405 It seems not commit compaction after compaction finished in service mode.A lot of rollback have been found. logs.zip
Do you compact multiple instants together in one job ? And whether there is some error stack trace here ?
The current strategy is that the compaction job would try to rollback any inflight compaction instants that have not been finished. (Because we have no idea whether the inflight compaction hangs/crashes or is ongoing).
So you should ensure that the compaction job can finish during the schedule time interval.
@danny0405 I know.There is only one job doing offline compaction, and this job contains multiple slot/parallism to do compaction.
You can see there is no commit after compaction finished, it is abnormal comparing with service mode disabled.
In service mode, a new compaction job is scheduled for the schedule interval (by default 10 minutes), that means all the compaction tasks should finish in 10 minutes, is that the case for you ?
@danny0405 Here is the situation I've meet:
Okey, you need to confirm 2 things:
CompactionCommit
sink to see why the compaction is not committed, the compaction instant is committed when all the file groups belong to it has finish the compaction task, you can see some inputs/outputs metrics on the job DAG metrics, and there are some log for CompactionCommit
operator.@danny0405 Here is the case. The command line to startup the offline program(service mode):
--path oss://dengine-lake-zjk/cloudcode_prod/dwd_egc_adv_resp_intra
--compaction-max-memory 3072
--archive-min-commits 180
--archive-max-commits 2016
--seq LIFO
--compaction-tasks 16
--plan-select-strategy num_instants
--max-num-plans 16
--min-compaction-interval-seconds 30
--spillable_map_path /opt/flink/flink-tmp-dir/
--service
-Dhadoop.fs.AbstractFileSystem.oss.impl=com.aliyun.jindodata.oss.OSS
-Dhadoop.fs.oss.impl=com.aliyun.jindodata.oss.JindoOssFileSystem
-Dhadoop.fs.oss.endpoint=cn-zhangjiakou.oss.aliyuncs.com
-Dhadoop.fs.oss.credentials.provider=com.aliyun.jindodata.oss.auth.SimpleCredentialsProvider
-Dhadoop.fs.oss.accessKeyId=********
-Dhadoop.fs.oss.accessKeySecret=***********
The job runs for first round(16 instants for 120 files).
And then TM stucks here while JM still rollback the compaction again and again, it don't commit finished at all.
The issue should be reopened. tm-compaction.log jm-compaction.log
Yeah, I didn't see any keywords for compaction commit like this Committing Compaction
, I see that you allow the param --compaction-tasks 16
to allow concurrent compaction for 16 plans, did you try to compile one by one instead?
If there is any exception like the Connection Refused
exception, it may be related with this patch: https://github.com/apache/hudi/pull/7214
@danny0405 I've noticed that there is warning and recovered log and don't know if it related.
I don't see these log while service mode is disabled.
2023-02-02 22:05:18,868 INFO org.apache.flink.api.java.typeutils.TypeExtractor [] - class org.apache.hudi.common.model.CompactionOperation does not contain a setter for field baseInstantTime
2023-02-02 22:05:18,869 INFO org.apache.flink.api.java.typeutils.TypeExtractor [] - Class class org.apache.hudi.common.model.CompactionOperation cannot be used as a POJO type because not all fields are valid POJO fields, and must be processed as GenericType. Please read the Flink documentation on "Data Types & Serialization" for details of the effect on performance.
2023-02-02 22:05:18,884 WARN org.apache.flink.resourceplan.applyagent.StreamGraphModifier [] - Path of resource plan is not specified, do nothing.
2023-02-02 22:05:18,884 INFO org.apache.flink.client.deployment.application.executors.EmbeddedExecutor [] - Job 6e03ee3092954b338d7b984d6918ce32 was recovered successfully.
@danny0405 Maybe I know what's going on.
It is not work at all in HA standalone cluster like Aliyun VVP.
The compact()
doesn't quit after prev patch, it just do nothing after the task has finished.
The job don't get "done" when service mode disabled. It hangs there and doing nothing.
The job don't get second around when service mode enabled. Hanging after first round.So the timeline service rollback again and again.
The compacation is succeed There is a commit file under .hoodie directory after first around. Although there is no logs at all.
So maybe it's not working when using new StreamEnviroment to execute the job.
I think it's better to move the compaction plan generate code inside the source function.
I can make a pr if needed.
What we suggest is to generate the compaction plan inside the streaming ingestion job, the offline compaction then just executes these plans, do you mean your job is stuck at the plan generation phase?
@danny0405 No. I mean the job stuck after plan execution and can't enter the second around.
In our scenario, the compaction plan is generated by streaming ingesting job. And the async table service in job manager seems to be problemlic. I suggest the code of plan discovery also the service mode cycle could be moved into source function.
Yeah, that's a solution, we can move the plan execution distribution into a long running streaming source operator instead when service mode is enabled.
Tips before filing an issue
Describe the problem you faced
I'm using HoodieFlinkCompactor to do offline compaction job. And it failed to using service mode.
The failure is
Cannot have more than one execute() or executeAsync() call in a single environment
.Runs fine in single round with service mode disabled(run once and quit).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
the second loop(which more than the first "parallism" jobs done) success when using service mode.
Environment Description
0.12.1
Spark version :
Hive version :
Hadoop version :
Storage (HDFS/S3/GCS..) :
Running on Docker? (yes/no) :
Additional context
job config
Stacktrace