From 81e52e59dcf3c4a44108e039fb0e3a0e2ce8284f Mon Sep 17 00:00:00 2001 From: shollyman Date: Mon, 3 Oct 2022 13:00:04 -0700 Subject: [PATCH] docs(bigquery/storage/managedwriter): add retry info to package docs (#6803) * docs(bigquery/storage/managedwriter): add retry info to package docs This PR adds additional guidance around retry to the error section of the package docs. --- bigquery/storage/managedwriter/doc.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bigquery/storage/managedwriter/doc.go b/bigquery/storage/managedwriter/doc.go index a81ff5df079..4754a5ff8d0 100644 --- a/bigquery/storage/managedwriter/doc.go +++ b/bigquery/storage/managedwriter/doc.go @@ -171,7 +171,7 @@ have been finalized, meaning they'll no longer allow further data writes. // table atomically. resp, err := client.BatchCommitWriteStreams(ctx, req) -# Error Handling +# Error Handling and Automatic Retries Like other Google Cloud services, this API relies on common components that can provide an enhanced set of errors when communicating about the results of API interactions. @@ -199,5 +199,17 @@ An example of accessing the structured error details: } } } + +This library supports the ability to retry failed append requests, but this functionality is not +enabled by default. You can enable it via the EnableWriteRetries option when constructing a new +managed stream. Use of automatic retries can impact correctness when attempting certain exactly-once +write patterns, but is generally recommended for workloads that only need at-least-once writing. + +With write retries enabled, failed writes will be automatically attempted a finite number of times +(currently 4) if the failure is considered retriable. + +In support of the retry changes, the AppendResult returned as part of an append call now includes +TotalAttempts(), which returns the number of times that specific append was enqueued to the service. +Values larger than 1 are indicative of a specific append being enqueued multiple times. */ package managedwriter