-
Notifications
You must be signed in to change notification settings - Fork 64
Implement snapshot isolation mode support in query client #726
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: asmyasnikov <[email protected]>
Co-authored-by: asmyasnikov <[email protected]>
|
@copilot I have updated ydb-api-protos dependency and regenerate genproto which have a newest snapshot read-write tx mode |
Co-authored-by: asmyasnikov <[email protected]>
…gs.to_proto() Co-authored-by: asmyasnikov <[email protected]>
Implemented The new mode is available as
|
|
@copilot some tests failed - fix it please |
…n't support writes in snapshot isolation) Co-authored-by: vgvoleg <[email protected]>
Fixed in commit bb62948. Removed |
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: #727
The query client already supports
QuerySnapshotReadOnlytransaction mode for snapshot isolation with read-only capability. However, the newQuerySnapshotReadWritemode (usingSnapshotRWModeSettingsproto) was not yet implemented.What is the new behavior?
Added
QuerySnapshotReadWritetransaction mode to the Python SDK query client to support snapshot isolation with read-write capability.Changes Made:
New
QuerySnapshotReadWriteclass inydb/_grpc/grpcwrapper/ydb_query_public_types.py:SnapshotRWModeSettingsproto messageUpdated
TransactionSettings.to_proto()inydb/_grpc/grpcwrapper/ydb_query.py:snapshot_read_writemodeExported from
ydb/query/__init__.py:QuerySnapshotReadWriteto__all__and importsUpdated docstrings in all transaction-related files to include the new mode
Updated pool.py files to include
snapshot_read_writein modes that need explicitbegin()Usage:
Other information
Both snapshot isolation modes are now available:
ydb.QuerySnapshotReadOnly()- Read-only snapshot isolationydb.QuerySnapshotReadWrite()- Read-write snapshot isolationTable client equivalent
ydb.SnapshotReadOnly()is also implemented.Note: The
QuerySnapshotReadWrite()mode is not included in thetest_retry_tx_normaltest parametrization because the YDB server in CI returns "Writes aren't supported for Snapshot Isolation", indicating this feature isn't yet fully enabled on the server side. The SDK implementation is correct and ready for when server support is available.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.