Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-8257

BigQueryIO - only first day table can be created, despite having CreateDisposition.CREATE_IF_NEEDED

Details

    • Bug
    • Status: Open
    • P3
    • Resolution: Unresolved
    • 2.21.0
    • None
    • io-java-gcp
    • None
    •  Dataflow streaming pipeline

    Description

      I have a dataflow job processing data from pub/sub defined like this:

      read from pub/sub -> process (my function) -> group into day windows -> write to BQ

      I'm using Write.Method.FILE_LOADS because of bounded input.

      My job works fine, processing lots of GBs of data but it fails and tries to retry forever when it gets to create another table. The job is meant to run continuously and create day tables on its own, it does fine on the first few ones but then gives me indefinitely:

      Processing stuck in step write-bq/BatchLoads/SinglePartitionWriteTables/ParMultiDo(WriteTables) for at least 05h30m00s without outputting or completing in state finish

      Before this happens it also throws: 

      Load job <job_id> failed, will retry: {"errorResult": {"message":"Not found: Table <name_of_table> was not found in location US","reason":"notFound"}
      

      It is indeed a right error because this table doesn't exists. Problem is that the job should create it on its own because of defined option CreateDisposition.CREATE_IF_NEEDED.

      The number of day tables that it creates correctly without a problem depends on number of workers. It seems that when some worker creates one table its CreateDisposition changes to CREATE_NEVER causing the problem, but it's only my guess.

      The similar problem was reported here but without any definite answer:
      https://issues.apache.org/jira/browse/BEAM-3772?focusedCommentId=16387609&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16387609

      ProcessElement definition here seems to give some clues but I cannot really say how it works with multiple workers: https://github.com/apache/beam/blob/master/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/WriteTables.java#L138

      I use 2.15.0 Apache SDK.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dbodych D Bodych
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: