Github user JamesRTaylor commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/127#discussion_r44850623
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java ---
@@ -450,7 +463,7 @@ private void closeStatements() throws SQLException {
// from modifying this list.
this.statements = Lists.newArrayList();
try {
- mutationState.rollback(this);
+ mutationState.clear();
--- End diff --
I'm pretty sure we want to call mutationState.rollback() here instead of
mutationState.clear(). Add a test like this to confirm:
- upsert a few rows to a transactional table
- query the table (which will write you upserts but not commit them)
- close the connection
I think the writes will get left hanging and once the tx times out, I'm not
sure what'll happen. The txID may end up on the invalid list (which is not
great) or not (which is even worse).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---