GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing github.com — feat(db_api): add an ability to set ReadOnly/ReadWrite connection mode by IlyaFaer · Pull Request #475 · googleapis/python-spanner
This repository was archived by the owner on Jun 8, 2026. It is now read-only.
Conversation
|
|
@larkee, hm, okay. If we want to use the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
By default, a snapshot is a single-use read-only transaction so it would only be valid for one read operation. However, there is an option make a multi-use snapshot in which all reads are from the same snapshot of data i.e. data is consistent. Multi-use snapshot example: https://cloud.google.com/spanner/docs/transactions#ro_transaction_example With this in mind, I think using |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yes, that is the intention here. So the implementation should roughly be:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@skuruppu, of course, it's not. I don't want to sound boring, but I can't see why you both think it's that performance influencing. We don't calculate checksums in Anyway it's pushed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, that was my fault. I didn't realize that you had already created that change, as the comment that you referenced above didn't say anything about that.
In my opinion, the current implementation would have been slightly confusing for a potential new developer. The retry mechanism is not needed for read-only transactions. I think that it is better that it is completely clear in the code to prevent anyone from accidentally re-enabling it in the future. (This last commit for example has also removed an unnecessary test case that tested the retry mechanism for a query in autocommit mode; a situation that could not happen, but still was part of the code base.) Anyways, I'm happy enough with this as-is, but we should add a system test ASAP to actually show that it is working as intended. If @skuruppu and/or @larkee are OK with that, then we could do that in a separate PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ultimately @larkee needs to approve this as the code owner so please do add any tests that they ask for before merging. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@IlyaFaer I second what @olavloite said. The refactor is less about performance (since it should be roughly equivalent) but is more about readability and reducing confusion for new developers. However, if you create a tracking issue for the refactor work, I will approve and merge this PR 👍 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think all comments are already processed. I've pushed changes with adding I also returned back that deleted-by-merge-of-another-commit system test. It checks that I think it's worth adding a unit test, which'll check that |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looking at |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.