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
OAK-9668 Update H2DB dependency #466
Conversation
thomasmueller
commented
Jan 17, 2022
- binarySearch: This is a bit ugly: I copied that from the H2 base class. An option would be to use the base class directly, but this would likely require a bigger change.
- Changing maxBlobSize from 2 MB to 1 MB: this is a change in H2, to avoid running out of memory I think. The reason is that PreparedStatement.setBytes is used with the byte array.
- Cache test: It looks like there was a change in the behavior after Thread.interrupt. I don't think this test is needed any longer, as I don't think we have custom code calling Thread.interrupt any longer.
@@ -146,7 +146,7 @@ public void testBigBlob() throws Exception { | |||
|
|||
LOG.info("max blob length for " + blobStoreName + " was " + test); | |||
|
|||
int expected = Math.max(blobStore.getBlockSize(), 2 * 1024 * 1024); | |||
int expected = Math.max(blobStore.getBlockSize(), 1 * 1024 * 1024); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't recall whether RDBBlobStore requires bigger blobs. In which case, changing the test here would hide regressions with other databases. It might be better to disable this test case just for h2db.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @reschke. This seems to be a limitation of the newer H2 version. The default block size of AbstractBlobStore is 2MB. I assume that's why we have this test.
jackrabbit-oak/oak-blob/src/main/java/org/apache/jackrabbit/oak/spi/blob/AbstractBlobStore.java
Line 120 in c6ddcc5
private int blockSize = 2 * 1024 * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's a limitation of a new version of H2... An in-memory object contains the array of bytes, and the size of such objects is now limited to 1 MB (I didn't know btw... just read that in the source code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the test consider blobStore.getBlockSize()
when it is set to 128 in setUp()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted this change in 4f76f50. Instead the test is skipped when it runs on H2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly do not recall.
The PR currently does not update the H2 dependency. I'll do that in a minute... |
Update dependency to 2.0.206
oak-pojosr has a test failure with:
Looks like 1MB is the limit for BINARY VARYING: https://h2database.com/html/advanced.html#limits_limitations |
would it make sense to move I've done that now in d08bfc0 - but feel free to revert that |
Use 1MB block size for test with RDBBlobStore on H2
This should be fixed with b015851. The test sets the block size to 1MB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good to me now.
Revert change of expected size. Disable test instead on H2
PS: trying to reproduce the test locally but can't so far. rerunning the test now to see if it is flaky |
oak-store-document that failed in run 5 succeeded in run 6 and 7 - so it does look like a flaky test. the failure is:
which looks like a test race condition between the previous test case and It's not exactly clear to me why it fails though .. but I don't consider this as a blocker for this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from my side - the test failure of run nr. 5 look flaky
any other +1? |
* OAK-9668 Update H2DB dependency * OAK-9668: Update H2DB dependency Update dependency to 2.0.206 * OAK-9668 : move cast and binarySearch to DataTypeUtil * OAK-9668: Update H2DB dependency Use 1MB block size for test with RDBBlobStore on H2 * OAK-9668: Update H2DB dependency Revert change of expected size. Disable test instead on H2 Co-authored-by: Marcel Reutegger <marcel.reutegger@gmail.com> Co-authored-by: Stefan Egli <stefanegli@apache.org>
PS: #468 is the backport of this to 1.22 branch |
* OAK-9668 Update H2DB dependency * OAK-9668: Update H2DB dependency Update dependency to 2.0.206 * OAK-9668 : move cast and binarySearch to DataTypeUtil * OAK-9668: Update H2DB dependency Use 1MB block size for test with RDBBlobStore on H2 * OAK-9668: Update H2DB dependency Revert change of expected size. Disable test instead on H2 Co-authored-by: Marcel Reutegger <marcel.reutegger@gmail.com> Co-authored-by: Stefan Egli <stefanegli@apache.org> Co-authored-by: Thomas Mueller <thomasm@apache.org> Co-authored-by: Marcel Reutegger <marcel.reutegger@gmail.com>
* OAK-9668 Update H2DB dependency * OAK-9668: Update H2DB dependency Update dependency to 2.0.206 * OAK-9668 : move cast and binarySearch to DataTypeUtil * OAK-9668: Update H2DB dependency Use 1MB block size for test with RDBBlobStore on H2 * OAK-9668: Update H2DB dependency Revert change of expected size. Disable test instead on H2 Co-authored-by: Marcel Reutegger <marcel.reutegger@gmail.com> Co-authored-by: Stefan Egli <stefanegli@apache.org> (cherry picked from commit 8c1b628)