Apache Beam API 具有以下 BiqQuery 插入重試策略。如果我指定retryTransientErrors數據流作業的行為如何?shouldRetry提供來自 BigQuery 的錯誤,我可以決定是否應該重試。在哪里可以找到 BigQuery 的預期錯誤?BiqQuery 插入重試策略alwaysRetry - 始終重試所有失敗。neverRetry - 從不重試任何失敗。retryTransientErrors - 重試所有失敗,已知的持續性錯誤除外。shouldRetry - 如果應該重試此失敗,則返回 true。背景當我的 Cloud Dataflow 作業將非常舊的時間戳(從現在開始超過 1 年)插入 BigQuery 時,出現以下錯誤。?jsonPayload: {? exception:? "java.lang.RuntimeException: java.io.IOException: Insert failed:?[{"errors":[{"debugInfo":"","location":"","message":"Value 690000000 for field?timestamp_scanned of the destination table fr-prd-datalake:rfid_raw.store_epc_transactions_cr_uqjp is outside the allowed bounds.You can only stream to date range within 365 days in the past and 183 days inthe future relative to the current date.","reason":"invalid"}],在第一個錯誤之后,Dataflow 嘗試重試插入,但它總是因相同的錯誤而被 BigQuery 拒絕。它沒有停止,所以我將retryTransientErrors添加到 BigQueryIO.Write 步驟,然后重試停止了。
1 回答

holdtom
TA貢獻1805條經驗 獲得超10個贊
如果我指定 retryTransientErrors,數據流作業的行為如何?
所有錯誤都被視為暫時性錯誤,除非 BigQuery 表示錯誤原因是“無效”、“無效查詢”、“未實施”之一
shouldRetry 提供來自 BigQuery 的錯誤,我可以決定是否應該重試。在哪里可以找到 BigQuery 的預期錯誤?
你不能,因為調用者看不到錯誤。我不確定這是否是故意的,或者 Apache Beam 是否應該公開錯誤以便用戶可以編寫自己的重試邏輯。
添加回答
舉報
0/150
提交
取消