johnjcasey opened a new issue, #26521:
URL: https://github.com/apache/beam/issues/26521

   ### What happened?
   
   This affects versions 2.35 - 2.47, though it is most severe in 2.44-2.47 due 
to #26520 causing guaranteed exceptions.
   
   When we get an exception from BQ when attempting to append to a stream, we 
will retry the current append on a new stream. However, in doing so, we abandon 
the existing stream. This results in messages on that stream that have not yet 
been committed not making it to BQ, resulting in data consistency issues. 
   
   ```
   public static void main(String[] args) {
    BigQueryOptions options = 
PipelineOptionsFactory.fromArgs(args).create().as(BigQueryOptions.class);
    options.setStorageApiAppendThresholdRecordCount(5);
    Pipeline p= Pipeline.create(options);
   
    p.apply("ReadLines", 
TextIO.read().from("gs://apache-beam-samples/shakespeare/kinglear.txt"))
        .apply("Save Events To BigQuery", BigQueryIO.<String>write()
            .to("google.com:clouddfe:reprodataset.reprotable")
            .withFormatFunction(s -> new TableRow().set("words", s))
            .withMethod(Write.Method.STORAGE_WRITE_API)
            .withCreateDisposition(CreateDisposition.CREATE_NEVER)
            
.withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_APPEND));
   
    p.run();
   }
   ```
    repros the issue on versions 2.44-2.47
   
   ### Issue Priority
   
   Priority: 1 (data loss / total loss of function)
   
   ### Issue Components
   
   - [ ] Component: Python SDK
   - [X] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [X] Component: IO connector
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Samza Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to