作业图太大,无法提交到 Google Cloud Dataflow
Job graph too large to submit to Google Cloud Dataflow
我正在尝试 运行 Dataflow 上的作业,每当我尝试使用 DataflowRunner 将其提交到 运行 时,我都会从服务中收到以下错误:
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Request payload size exceeds the limit: x bytes.",
"reason" : "badRequest"
} ],
"message" : "Request payload size exceeds the limit: x bytes.",
"status" : "INVALID_ARGUMENT"
}
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "(3754670dbaa1cc6b): The job graph is too large. Please try again with a smaller job graph, or split your job into two or more smaller jobs.",
"reason" : "badRequest",
"debugInfo" : "detail: \"(3754670dbaa1cc6b): CreateJob fails due to Spanner error: New value exceeds the maximum size limit for this column in this database: Jobs.CloudWorkflowJob, size: 17278017, limit: 10485760.\"\n"
} ],
"message" : "(3754670dbaa1cc6b): The job graph is too large. Please try again with a smaller job graph, or split your job into two or more smaller jobs.",
"status" : "INVALID_ARGUMENT"
}
如何将我的作业更改为更小或增加作业大小限制?
此问题有一个解决方法,可让您将作业图的大小增加到最多 100MB。您可以指定此实验:--experiments=upload_graph
.
该实验激活了一个新的提交路径,该路径将作业文件上传到 GCS,并通过不包含作业图的 HTTP 请求创建作业 - 但只是对其的引用。
缺点是 UI 可能无法正确显示作业,因为它依赖于 API 请求来共享作业。
额外注意:减小作业图的大小仍然是一个好习惯。
一个重要的提示是,有时可以创建一些匿名 DoFns / lambda 函数,这些函数在其闭包中具有非常大的上下文,因此我建议查看代码中的任何闭包,并确保它们不是包括非常大的上下文。
也许避免匿名 lambdas/DoFns 会有所帮助,因为上下文将成为 class 的一部分,而不是序列化对象。
我正在尝试 运行 Dataflow 上的作业,每当我尝试使用 DataflowRunner 将其提交到 运行 时,我都会从服务中收到以下错误:
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Request payload size exceeds the limit: x bytes.",
"reason" : "badRequest"
} ],
"message" : "Request payload size exceeds the limit: x bytes.",
"status" : "INVALID_ARGUMENT"
}
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "(3754670dbaa1cc6b): The job graph is too large. Please try again with a smaller job graph, or split your job into two or more smaller jobs.",
"reason" : "badRequest",
"debugInfo" : "detail: \"(3754670dbaa1cc6b): CreateJob fails due to Spanner error: New value exceeds the maximum size limit for this column in this database: Jobs.CloudWorkflowJob, size: 17278017, limit: 10485760.\"\n"
} ],
"message" : "(3754670dbaa1cc6b): The job graph is too large. Please try again with a smaller job graph, or split your job into two or more smaller jobs.",
"status" : "INVALID_ARGUMENT"
}
如何将我的作业更改为更小或增加作业大小限制?
此问题有一个解决方法,可让您将作业图的大小增加到最多 100MB。您可以指定此实验:--experiments=upload_graph
.
该实验激活了一个新的提交路径,该路径将作业文件上传到 GCS,并通过不包含作业图的 HTTP 请求创建作业 - 但只是对其的引用。
缺点是 UI 可能无法正确显示作业,因为它依赖于 API 请求来共享作业。
额外注意:减小作业图的大小仍然是一个好习惯。
一个重要的提示是,有时可以创建一些匿名 DoFns / lambda 函数,这些函数在其闭包中具有非常大的上下文,因此我建议查看代码中的任何闭包,并确保它们不是包括非常大的上下文。
也许避免匿名 lambdas/DoFns 会有所帮助,因为上下文将成为 class 的一部分,而不是序列化对象。