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(Spanner): support max_commit_delay for commit_options #85

Merged
merged 7 commits into from Feb 7, 2024

Conversation

NivedhaSenthil
Copy link
Member

  • max_commit_delay says the latency for each request in milliseconds
  • the input is given as Numeric and it is converted to Protobuf duration internally
  • Value range is between 0 to 500ms

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea.
  • Follow the instructions in CONTRIBUTING. Most importantly, ensure the tests and linter pass by running bundle exec rake ci in the gem subdirectory.
  • Update code documentation if necessary.

closes: #<issue_number_goes_here>

@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Feb 3, 2024
@NivedhaSenthil NivedhaSenthil marked this pull request as ready for review February 5, 2024 06:04
@NivedhaSenthil NivedhaSenthil requested review from a team as code owners February 5, 2024 06:04
Copy link
Contributor

@SandeepTuniki SandeepTuniki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested some minor improvements. But otherwise LGTM.

google-cloud-spanner/lib/google/cloud/spanner/client.rb Outdated Show resolved Hide resolved
@@ -1141,6 +1145,10 @@ def upsert table, rows, commit_options: nil, request_options: nil
# * `:return_commit_stats` (Boolean) A boolean value. If `true`,
# then statistics related to the transaction will be included in
# {CommitResponse}. Default value is `false`
# * `:maxCommitDelay` (Numeric) The amount of latency in millisecond in this request
# is willing to incur in order to improve throughput.
# The commit delay must be at least 0ms and at most 500ms
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my understanding, what happens if the user value is out of this range? Will it be ignored? Or will the backend throw some kind of exception?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An error is thrown from backend telling the value is out of range.

@NivedhaSenthil NivedhaSenthil merged commit 3b73dfc into main Feb 7, 2024
15 of 17 checks passed
@NivedhaSenthil NivedhaSenthil deleted the spanner_commit_delay branch February 7, 2024 06:16
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 Spanner API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants