You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ri...@apache.org on 2023/05/25 12:07:25 UTC

[beam] branch release-2.48.0 updated: Always invalidate write stream (#26872) (#26886)

This is an automated email from the ASF dual-hosted git repository.

riteshghorse pushed a commit to branch release-2.48.0
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/release-2.48.0 by this push:
     new b80dde28e01 Always invalidate write stream (#26872) (#26886)
b80dde28e01 is described below

commit b80dde28e01796aeb9fa28e04be47332062800a6
Author: Bruno Volpato <bv...@google.com>
AuthorDate: Thu May 25 08:07:15 2023 -0400

    Always invalidate write stream (#26872) (#26886)
    
    Co-authored-by: reuvenlax <re...@google.com>
---
 .../beam/sdk/io/gcp/bigquery/StorageApiWriteUnshardedRecords.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiWriteUnshardedRecords.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiWriteUnshardedRecords.java
index 46b542a84a5..113c9f83082 100644
--- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiWriteUnshardedRecords.java
+++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiWriteUnshardedRecords.java
@@ -609,6 +609,8 @@ public class StorageApiWriteUnshardedRecords<DestinationT, ElementT>
                   retrieveErrorDetails(contexts));
               failedContext.failureCount += 1;
 
+              invalidateWriteStream();
+
               // Maximum number of times we retry before we fail the work item.
               if (failedContext.failureCount > 5) {
                 throw new RuntimeException("More than 5 attempts to call AppendRows failed.");
@@ -641,8 +643,6 @@ public class StorageApiWriteUnshardedRecords<DestinationT, ElementT>
                         + "doesn't exist");
               }
 
-              invalidateWriteStream();
-
               appendFailures.inc();
               return RetryType.RETRY_ALL_OPERATIONS;
             },