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

Bundles with all GET requests can use a single transaction for better performance #1627

Closed
punktilious opened this issue Oct 27, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request performance performance

Comments

@punktilious
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Currently bundles containing only GET requests and of type BATCH use a transaction per request. Better throughput can be achieved if a single transaction is used for the entire request. Because the request is read-only, this does not change the semantics of the request.

Describe the solution you'd like
Use a single transaction if the bundle contains only GET requests.

Describe alternatives you've considered
Recommend that such requests are sent with a bundle type of TRANSACTION, not BATCH.

@prb112 prb112 added the enhancement New feature or request label Oct 27, 2020
@kmbarton423 kmbarton423 added the performance performance label Nov 16, 2020
@michaelwschroeder michaelwschroeder self-assigned this Apr 29, 2021
michaelwschroeder added a commit that referenced this issue Apr 29, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue May 10, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue May 10, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue May 10, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue May 10, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue May 10, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
@punktilious
Copy link
Collaborator Author

To verify, posted batch bundles with different combinations of GET, DELETE and PUT entries. In each case, inspection of the logs showed that the transaction scope was correct.

It was also noted that when a READ fails as part of a read-only batch bundle, the transaction is no longer rolled back but committed. This allows values held in the thread-local caches to be propagated to the shared caches and not be thrown away (which would be a waste).

@punktilious
Copy link
Collaborator Author

It was further confirmed that bundles of type transaction will fail if one of the entries fails. The transaction is marked for rollback in this case, although it would be more optimal to commit in the case of a purely read-only scenario. A new issue will be raised for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance performance
Projects
None yet
Development

No branches or pull requests

4 participants