When a RPC fails with a retryable error, the google-cloud-cpp client libraries automatically retry the RPC if the RPC is idempotent. For each service, the library define a policy that determines whether a given request is idempotent. In many cases this can be determined statically, for example, read-only operations are always idempotent. In some cases, the contents of the request may need to be examined to determine if the operation is idempotent. For example, performing operations with pre-conditions, such that the pre-conditions change when the operation succeed, is typically idempotent.
Applications may override the default idempotency policy, though we anticipate that this would be needed only in very rare circumstances. A few examples include:
In some services deleting "the most recent" entry may be idempotent if the system has been configured to keep no history or versions, as the deletion may succeed only once. In contrast, deleting "the most recent entry" is not idempotent if the system keeps multiple versions. Google Cloud Storage or Bigtable can be configured either way.
In some applications, creating a duplicate entry may be acceptable as the system will deduplicate them later. In such systems it may be preferable to retry the operation even though it is not idempotent.
Constants
Name
Description
kIdempotent
The operation is idempotent and can be retried after a transient failure.
kNonIdempotent
The operation is not idempotent and should not be retried after a transient failure.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-05 UTC."],[[["This page provides documentation for various versions of the Google Cloud C++ client library, ranging from version 2.10.1 up to the latest release candidate, 2.37.0-rc."],["The library automatically retries RPCs that are deemed idempotent when they encounter retryable errors, based on policies that can be statically determined or evaluated from the request's content."],["Idempotent operations, marked with `kIdempotent`, can be safely retried after a transient failure, while non-idempotent operations, marked with `kNonIdempotent`, should not be retried."],["The default idempotency policies can be overridden by applications in specific scenarios, like deleting the most recent entry in a system with no history or accepting duplicate entries for later deduplication."],["The documentation defines idempotency, indicating that read-only operations are always idempotent, while some operations require checking the request's content to determine if they meet the requirements."]]],[]]