-
Notifications
You must be signed in to change notification settings - Fork 111
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: enable transactional connection state as an opt-in #3326
Open
olavloite
wants to merge
7
commits into
transactional-connection-state
Choose a base branch
from
enable-transactional-connection-state
base: transactional-connection-state
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: enable transactional connection state as an opt-in #3326
olavloite
wants to merge
7
commits into
transactional-connection-state
from
enable-transactional-connection-state
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
product-auto-label
bot
added
size: l
Pull request size is large.
api: spanner
Issues related to the googleapis/java-spanner API.
labels
Sep 9, 2024
olavloite
force-pushed
the
enable-transactional-connection-state
branch
from
September 10, 2024 08:37
2bfc411
to
259460d
Compare
…tate This change adds internal data structures that can be used for transactional connection state. These data structures also reduces the amount of code that is needed for each connection property that is added. Connection properties are currently represented as actual variables in the ConnectionImpl class. These new data structures removes the need for that. Only the connection property retryAbortsInternally is refactored to use the new data structure. All other connection properties will be refactored in a following change, in order to keep each change as small as possible. The data structure supports both transactional and non-transactional connection state. Transactional state is disabled in the current version in order to be consistent with the current behavior. It will be enabled in a later change when all connection properties have been refactored to use the new data structure.
olavloite
force-pushed
the
refactor-connection-variables-to-connection-state
branch
from
September 10, 2024 10:54
94c2d17
to
8d91e01
Compare
olavloite
force-pushed
the
enable-transactional-connection-state
branch
from
September 10, 2024 11:34
259460d
to
0c2b944
Compare
Replace individual variables in ConnectionOptions and ConnectionImpl with references to ConnectionProperties. This reduces the amount of code bloat, especially in ConnectionOptions, as all connection property parsing is now handled by the ConnectionState class in a generic way. This setup also reduces the amount of code that is needed to add a new connection property, as there is only one source of truth: the list of properties in the ConnectionProperties class. Following steps that will reduce the amount of code bloat further are: 1. Replace all the regular expressions for SET and SHOW statements with a simple token-based parser. 2. Cleaning up ConnectionOptions further by removing the duplicate list of ConnectionProperties there. These can be removed once the JDBC driver has been updated to use the new list of properties.
olavloite
force-pushed
the
refactor-connection-variables-to-connection-state
branch
from
September 10, 2024 11:40
8d91e01
to
aec3020
Compare
…tate This change adds internal data structures that can be used for transactional connection state. These data structures also reduces the amount of code that is needed for each connection property that is added. Connection properties are currently represented as actual variables in the ConnectionImpl class. These new data structures removes the need for that. Only the connection property retryAbortsInternally is refactored to use the new data structure. All other connection properties will be refactored in a following change, in order to keep each change as small as possible. The data structure supports both transactional and non-transactional connection state. Transactional state is disabled in the current version in order to be consistent with the current behavior. It will be enabled in a later change when all connection properties have been refactored to use the new data structure.
Replace individual variables in ConnectionOptions and ConnectionImpl with references to ConnectionProperties. This reduces the amount of code bloat, especially in ConnectionOptions, as all connection property parsing is now handled by the ConnectionState class in a generic way. This setup also reduces the amount of code that is needed to add a new connection property, as there is only one source of truth: the list of properties in the ConnectionProperties class. Following steps that will reduce the amount of code bloat further are: 1. Replace all the regular expressions for SET and SHOW statements with a simple token-based parser. 2. Cleaning up ConnectionOptions further by removing the duplicate list of ConnectionProperties there. These can be removed once the JDBC driver has been updated to use the new list of properties.
This change enables transactional connection state for the Connection API. It can be enabled by default for PostgreSQL-dialect databases using a system property, and is always an opt-in for GoogleSQL-dialect databases. Transactional connection state can be enabled for any database connection with the `connection_state_type` connection STARTUP property.
olavloite
force-pushed
the
enable-transactional-connection-state
branch
from
September 10, 2024 12:02
0c2b944
to
b74abca
Compare
olavloite
changed the title
feat: use transactional connection state for PostgreSQL
feat: enable transactional connection state
Sep 10, 2024
olavloite
changed the title
feat: enable transactional connection state
feat: enable transactional connection state as an opt-in
Sep 10, 2024
Base automatically changed from
refactor-connection-variables-to-connection-state
to
transactional-connection-state
September 12, 2024 08:48
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change enables transactional connection state for the Connection API.
It can be enabled by default for PostgreSQL-dialect databases using a system
property, and is always an opt-in for GoogleSQL-dialect databases.
Transactional connection state can be enabled for any database connection
with the
connection_state_type
connection STARTUP property.