Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: documents resume on update database ddl #767

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -172,6 +172,11 @@ public OperationFuture<Database, RestoreDatabaseMetadata> restoreDatabase(
* problem like a `NULL` value in a column to which `NOT NULL` would be added). If a statement
* fails, all subsequent statements in the batch are automatically cancelled.
*
* <p>If an operation already exists with the given operation id, the operation will be resumed
* and the returned future will complete when the original operation finishes. See more
* information in {@link com.google.cloud.spanner.spi.v1.GapicSpannerRpc#updateDatabaseDdl(String,
* Iterable, String)}
*
* <p>Example to update the database DDL.
*
* <pre>{@code
Expand Down
Expand Up @@ -1037,6 +1037,17 @@ public Timestamp apply(Operation input) {
NanoClock.getDefaultClock());
}

/**
* If the update database ddl operation returns an ALREADY_EXISTS error, meaning the operation id
* used is already in flight, this method will simply resume the original operation. The returned
* future will be completed when the original operation finishes.
*
* <p>This mechanism is necessary, because the update database ddl can be retried. If a retryable
* failure occurs, the backend has already started processing the update database ddl operation
* with the given id and the library issues a retry, an ALREADY_EXISTS error will be returned. If
* we were to bubble this error up, it would be confusing for the caller, who used originally
* called the method with a new operation id.
*/
@Override
public OperationFuture<Empty, UpdateDatabaseDdlMetadata> updateDatabaseDdl(
final String databaseName,
Expand Down