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: add fallback to PDML mode #1841

Merged
merged 2 commits into from
Dec 4, 2024
Merged

feat: add fallback to PDML mode #1841

merged 2 commits into from
Dec 4, 2024

Conversation

olavloite
Copy link
Collaborator

@olavloite olavloite commented Nov 26, 2024

DML statements that are executed in auto-commit mode can use either atomic transactions, or partitioned non-atomic transactions. The former is bound by the mutation limits in Spanner. The latter may update/delete any number of rows.

The transaction type that is used to execute DML statements in auto-commit mode is determined by the connection variable autocommit_dml_mode. This connection variable now supports a third value. The supported values are:

  • TRANSACTIONAL (default): Uses atomic read/write transactions.
  • PARTITIONED_NON_ATOMIC: Use Partitioned DML for DML statements in auto-commit mode. Use this mode to execute DML statements that exceed the transaction mutation limit in Spanner.
  • TRANSACTIONAL_WITH_FALLBACK_TO_PARTITIONED_NON_ATOMIC: Execute DML statements using atomic read/write transactions. If this fails because the mutation limit on Spanner has been exceeded, the DML statement is retried using a Partitioned DML transaction.

DML statements that are executed in auto-commit mode can use either
atomic transactions, or partitioned non-atomic transactions. The
former is bound by the mutation limits in Spanner. The latter may
update/delete any number of rows.

The transaction type that is used to execute DML statements in
auto-commit mode is determined by the connection variable
`autocommit_dml_mode`. This connection variable now supports a
third value. The supported values are:

  - TRANSACTIONAL (default): Uses atomic read/write transactions.
  - PARTITIONED_NON_ATOMIC: Use Partitioned DML for DML statements in auto-commit mode. Use this mode
    to execute DML statements that exceed the transaction mutation limit in Spanner.
  - TRANSACTIONAL_WITH_FALLBACK_TO_PARTITIONED_NON_ATOMIC: Execute DML statements using atomic read/write
    transactions. If this fails because the mutation limit on Spanner has been exceeded, the DML statement
    is retried using a Partitioned DML transaction.
@olavloite olavloite requested review from a team as code owners November 26, 2024 10:48
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: spanner Issues related to the googleapis/java-spanner-jdbc API. labels Nov 26, 2024
@olavloite olavloite requested a review from rayudu3745 November 26, 2024 10:48
@rayudu3745
Copy link
Collaborator

rayudu3745 commented Nov 28, 2024

@olavloite required tests are failing. is this expected ?

@olavloite olavloite added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 28, 2024
@olavloite
Copy link
Collaborator Author

@olavloite required tests are failing. is this expected ?

Yes, sorry, I should have included that in the PR description. This PR depends on the changes in googleapis/java-spanner#3480, which have not yet been released. Installing a snapshot build of the Java client locally that includes that change, and then running the tests in this PR, works.

@olavloite olavloite removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 4, 2024
@olavloite olavloite merged commit 1e81863 into main Dec 4, 2024
23 checks passed
@olavloite olavloite deleted the fallback-to-pdml branch December 4, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner-jdbc API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants