Uh oh!
There was an error while loading. Please reload this page.
feat(db_api): add an ability to set ReadOnly/ReadWrite connection mode - #475
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Knut Olav Løite <koloite@gmail.com>
…ython-spanner into read_only_transactions
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
IlyaFaer
commented
Aug 10, 2021
@larkee, hm, okay. If we want to use the |
larkee
commented
Aug 11, 2021
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 |
olavloite
commented
Aug 11, 2021
Yes, that is the intention here. So the implementation should roughly be:
|
IlyaFaer
commented
Sep 14, 2021
@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. |
olavloite
commented
Sep 14, 2021
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. |
skuruppu
commented
Sep 15, 2021
Ultimately @larkee needs to approve this as the code owner so please do add any tests that they ask for before merging. |
larkee
commented
Sep 15, 2021
@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 👍 |
IlyaFaer
commented
Sep 15, 2021
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 |
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. |
IlyaFaer
commented
Oct 5, 2021
Looking at |
Proposal for the user's question: googleapis/python-spanner-sqlalchemy#97
Will require small changes in SQLAlchemy dialect as well.