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

PHOENIX-6821: Optimize batching in auto-commit mode #1570

Merged
merged 5 commits into from Apr 4, 2023

Conversation

haridsv
Copy link
Contributor

@haridsv haridsv commented Mar 2, 2023

This change also includes the following to make the batch functionality more consistent and confirmant to the JDBC spec:

  • Disallow the use of DQL in a batch by throwing BatchUpdateException.
  • When addBatch is called if we already have a non-empty MutationState, then treat it as an error, i.e., prohibit mixing batch and non-batch executions.
  • Replace the use of custom BatchUpdateExecution exception with the java.sql.BatchUpdateException and propagate update counts through it.

@tkhurana tkhurana self-requested a review March 9, 2023 21:58
pom.xml Outdated
@@ -98,7 +98,7 @@
<jackson-bom.version>2.12.6.20220326</jackson-bom.version>
<antlr.version>3.5.2</antlr.version>
<!-- Only used for tests with HBase 2.1-2.4 -->
<reload4j.version>1.2.19</reload4j.version>
<reload4j.version>1.2.21</reload4j.version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem related to this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is not, but I was getting build error initially which got fixed with this change. I will try again without this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to compile without this change, so reverted it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot that the issue was not with the compilation but the ITs. Without changing this version, I am getting the below exception:

java.lang.NoSuchFieldError: tlm
	at org.apache.log4j.MDCFriend.fixForJava9(MDCFriend.java:11)
	at org.slf4j.impl.Log4jMDCAdapter.<clinit>(Log4jMDCAdapter.java:38)
	at org.slf4j.impl.StaticMDCBinder.getMDCA(StaticMDCBinder.java:59)
	at org.slf4j.MDC.bwCompatibleGetMDCAdapterFromBinder(MDC.java:99)
	at org.slf4j.MDC.<clinit>(MDC.java:108)
	at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1080)
	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1139)

This got fixed when I bumped up this version. Could you check if you are able to run this IT in IntelliJ with the old version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it seems like a local env issue, I will keep this change out.

Copy link
Contributor

@tkhurana tkhurana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be good to add a test with delete statements

@haridsv haridsv requested a review from tkhurana March 14, 2023 05:44
haridsv added a commit to haridsv/phoenix that referenced this pull request Mar 30, 2023
This change also includes the following to make the batch functionality
more consistent and confirmant to the JDBC spec:
- Disallow the use of DQL in a batch by throwing BatchUpdateException.
- Replace the use of custom BatchUpdateExecution exception with the java.sql.BatchUpdateException and propagate update counts through it.
- Add unit test coverage for executeBatch()
- Add tests for delete and further enhance existing tests
- Review feedback changes

Squashes the following commits to avoid patch errors during PR validation builds:

* b9eb9bf Addressed additional review feedback
* 54973f7 Add tests for delete and further enhance existing tests
* 7548551 Restoring prior version for reload4j.version
* b29d8d2 Add unit test coverage for executeBatch()
* 6e0c825 Review feedback changes
* f129a15 Reverted the code that prevents mixing of non-batch commit after a batch commit as it is broken
* af39750 Fix checkstyle errors in the lines touched in this PR.
* 7236deb Merge branch 'master' into PHOENIX-6821
* 5c6ac93 PHOENIX-6821: Optimize batching in auto-commit mode
tkhurana pushed a commit that referenced this pull request Apr 3, 2023
* PHOENIX-6821: Optimize batching in auto-commit mode

Squash of the change from PR #1570

* Fix a merge issue with cherry-pick

* Additional changes needed to fix compilation errors for 5.1 branch

* Fix checkstyle errors

* Fix checkstyle errors

* Remove extraneous whitespace
@tkhurana
Copy link
Contributor

tkhurana commented Apr 3, 2023

@haridsv There are still some checkstyle warnings left.

@haridsv
Copy link
Contributor Author

haridsv commented Apr 4, 2023

@tkhurana They are all existing lines, not sure why they are getting flagged, but I just pushed a commit with fixes.

@tkhurana tkhurana merged commit 4e29515 into apache:master Apr 4, 2023
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants