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

feat: automatic fallback to Partitioned DML #2593

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

olavloite
Copy link
Collaborator

Adds a third option for the spanner.autocommit_dml_mode. This third option first tries to execute a DML statement using a standard, atomic transaction. If that fails because the transaction mutation limit was exceeded, the statement is retried using a Partitioned DML transaction.

Usage:

set spanner.autocommit_dml_mode='TRANSACTIONAL_WITH_FALLBACK_TO_PARTITIONED_NON_ATOMIC';

-- The following statement is executed as an atomic DML statement first.
-- If that fails due to exceeding the Spanner mutation limit, then this statement
-- will automatically be retried using Partitioned DML.
update large_table set active=true where active is null;

Adds a third option for the `spanner.autocommit_dml_mode`. This third option
first tries to execute a DML statement using a standard, atomic transaction.
If that fails because the transaction mutation limit was exceeded, the
statement is retried using a Partitioned DML transaction.

Usage:

```
set spanner.autocommit_dml_mode='TRANSACTIONAL_WITH_FALLBACK_TO_PARTITIONED_NON_ATOMIC';

-- The following statement is executed as an atomic DML statement first.
-- If that fails due to exceeding the Spanner mutation limit, then this statement
-- will automatically be retried using Partitioned DML.
update large_table set active=true where active is null;
```
@olavloite olavloite merged commit 3d0c471 into postgresql-dialect Dec 6, 2024
43 checks passed
@olavloite olavloite deleted the fallback-to-pdml branch December 6, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant