From commits-return-85759-archive-asf-public=cust-asf.ponee.io@beam.apache.org Mon Jul 30 19:37:07 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id EE746180630 for ; Mon, 30 Jul 2018 19:37:06 +0200 (CEST) Received: (qmail 4332 invoked by uid 500); 30 Jul 2018 17:37:06 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 4323 invoked by uid 99); 30 Jul 2018 17:37:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jul 2018 17:37:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9E13A180166 for ; Mon, 30 Jul 2018 17:37:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id yXnVYSUe9ki0 for ; Mon, 30 Jul 2018 17:37:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id AD9715F546 for ; Mon, 30 Jul 2018 17:37:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7FF30E0253 for ; Mon, 30 Jul 2018 17:37:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id BF8852776D for ; Mon, 30 Jul 2018 17:37:00 +0000 (UTC) Date: Mon, 30 Jul 2018 17:37:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (BEAM-5040) BigQueryIO retries infinitely in WriteTable and WriteRename MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/BEAM-5040?focusedWorklogId=3D1= 28818&page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpan= el#worklog-128818 ] ASF GitHub Bot logged work on BEAM-5040: ---------------------------------------- Author: ASF GitHub Bot Created on: 30/Jul/18 17:36 Start Date: 30/Jul/18 17:36 Worklog Time Spent: 10m=20 Work Description: chamikaramj commented on a change in pull request #= 6080: [BEAM-5040] Fix retry bug for BigQuery jobs. URL: https://github.com/apache/beam/pull/6080#discussion_r206256749 =20 =20 ########## File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/bea= m/sdk/io/gcp/bigquery/WriteTables.java ########## @@ -284,19 +305,25 @@ private void load( } return; case UNKNOWN: - LOG.info("Load job {} finished in unknown state: {}", jobRef, lo= adJob.getStatus()); - throw new RuntimeException( - String.format( - "UNKNOWN status of load job [%s]: %s.", - jobId, BigQueryHelpers.jobToPrettyString(loadJob))); - case FAILED: + // This might happen if BigQuery's job listing is slow. Retry wi= th the same + // job id. LOG.info( - "Load job {} failed, {}: {}", + "Load job {} finished in unknown state: {}: {}", jobRef, - (i < BatchLoads.MAX_RETRY_JOBS - 1) ? "will retry" : "will n= ot retry", - loadJob.getStatus()); + loadJob.getStatus(), + (i < maxRetryJobs - 1) ? "will retry" : "will not retry"); lastFailedLoadJob =3D loadJob; continue; + case FAILED: + lastFailedLoadJob =3D loadJob; + jobId =3D BigQueryHelpers.getRetryJobId(jobId, projectId, bqLoca= tion, jobService).jobId; + LOG.info( =20 Review comment: Should we retry actually failed jobs ? This might have been due to a leg= itimate client error, no ? Should we refer to error code/message before ret= rying ? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 128818) Time Spent: 0.5h (was: 20m) > BigQueryIO retries infinitely in WriteTable and WriteRename > ----------------------------------------------------------- > > Key: BEAM-5040 > URL: https://issues.apache.org/jira/browse/BEAM-5040 > Project: Beam > Issue Type: Bug > Components: io-java-gcp > Affects Versions: 2.5.0 > Reporter: Reuven Lax > Assignee: Reuven Lax > Priority: Major > Time Spent: 0.5h > Remaining Estimate: 0h > > BigQueryIO retries infinitely in WriteTable and WriteRename > Several=C2=A0failure scenarios with the current code: > # It's possible for a load job to return failure even though it actually= succeeded (e.g. the reply might have timed out). In this case, BigQueryIO = will retry the job which will fail again (because the job id has already be= en used), leading to indefinite retries. Correct behavior is to stop retryi= ng as the load job has succeeded. > # It's possible for a load job to be accepted by BigQuery, but then to f= ail on the BigQuery side. In this case a retry with the same job id will fa= il as that job id has already been used. BigQueryIO will sometimes detect t= his, but if the worker has restarted it will instead issue a load with the = old job id and go into a retry loop. Correct behavior is to generate a new = deterministic job id and retry using that new job id. > # In many cases of worker restart, BigQueryIO ends up in infinite retry = loops. -- This message was sent by Atlassian JIRA (v7.6.3#76005)