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

Add ScyllaDB driver support #3578

Merged
merged 1 commit into from
Feb 17, 2023

Conversation

porunov
Copy link
Member

@porunov porunov commented Feb 11, 2023

  • Add ScyllaDB support via janusgraph-scylla
  • janusgraph-cql contains tests for Cassandra3, Cassandra4, ScyllaDB. janusgraph-scylla contains tests for ScyllaDB only.

ScyllaDB driver has the same classpath as DataStax driver. Thus, we can't have both janusgraph-cql and janusgraph-scylla dependencies in the classpath at the same time.
It means that janusgraph-all can have only one of them. This is fine I think because anyone who is using that dependency should be able to exclude janusgraph-cql and include janusgraph-scylla when necessary.

That said, it also means that we can't have janusgraph-scylla in any of the JanusGraph distributions because those distributions already have janusgraph-cql dependency. Right now the only option to add scylla as a storage adapter to JanusGraph distribution is by manually replacing libraries.
The issue to make it more easier for users to replace cql drivers with scylla drivers is here: #3580 (has a solution description).

I checked that the optimized ScyllaDB driver is used for scylla storage option.

Fixes #1778
Related to #2451
Fixes to #2505 (comment about observations of Hadoop tests with ScyllaDB is here)

Signed-off-by: Oleksandr Porunov alexandr.porunov@gmail.com


Thank you for contributing to JanusGraph!

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there an issue associated with this PR? Is it referenced in the commit message?
  • Does your PR body contain #xyz where xyz is the issue number you are trying to resolve?
  • Has your PR been rebased against the latest commit within the target branch (typically master)?
  • Is your initial contribution a single, squashed commit?

For code changes:

  • Have you written and/or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE.txt file, including the main LICENSE.txt file in the root of this repository?
  • If applicable, have you updated the NOTICE.txt file, including the main NOTICE.txt file found in the root of this repository?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

@porunov porunov added this to the Release v1.0.0 milestone Feb 11, 2023
@janusgraph-bot janusgraph-bot added the cla: external Externally-managed CLA label Feb 11, 2023
@porunov porunov force-pushed the feature/scylla-storage-backend branch 6 times, most recently from 5f72e86 to bd75102 Compare February 12, 2023 06:36
@porunov porunov marked this pull request as ready for review February 12, 2023 12:32
@porunov porunov force-pushed the feature/scylla-storage-backend branch 3 times, most recently from 9e3a4c2 to e650702 Compare February 13, 2023 02:06
@farodin91
Copy link
Contributor

@porunov Would it be possible to use java shadowing for instead of library coping?

@porunov
Copy link
Member Author

porunov commented Feb 13, 2023

@porunov Would it be possible to use java shadowing for instead of library coping?

I don't have experience with shadowing Java libraries, so can't say for sure. I have created an issue #3580 to be able to avoid copying libraries. In that issue I proposed making diff between cql and scylla dependencies, split them to multiple folders and choose the folder to include based on environment variable.
I think shadowing should be another approach to solve #3580 but I don't have a clear picture of how to accomplish it due to lack of experience.

Copy link
Member

@FlorianHockmann FlorianHockmann left a comment

Choose a reason for hiding this comment

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

Thanks a lot for tackling this, @porunov! I also tried that a while back, but then stopped when I ran into the issue you're describing in #3580 as I had no idea how to resolve this. But your approach of first only adding this as a module and resolve the problem with selecting the right library in the distribution at runtime in a follow-up issue definitely makes sense to get us moving here :-)

I just reviewed the diff here and everything looks good basically. I only added some small nitpick comments. The logs of the added GH Actions also show that the Scylla driver is really being used there:

Using Scylla optimized driver!!!

I would like to also build the distribution and try out the approach you've documented with manually replacing the JARs if I find some time in the next few days but wanted to already provide my review comments so far.

docs/changelog.md Outdated Show resolved Hide resolved
docs/changelog.md Outdated Show resolved Hide resolved
docs/changelog.md Show resolved Hide resolved
docs/storage-backend/scylladb.md Outdated Show resolved Hide resolved
docs/storage-backend/scylladb.md Show resolved Hide resolved
@porunov
Copy link
Member Author

porunov commented Feb 13, 2023

Thanks @FlorianHockmann for the review! I will experiment tomorrow or on Wednesday with ScyllaDB parameters suggested here #2505 (comment) and update the PR with your suggestions and probably modify the JanusGraphCassandraContainer a bit to use those parameters.

I don't personally like the manual approach of replacing libs and also think we should handle #3580 before we release 1.0.0, but thought it makes sense to ship Scylla module first.

@porunov porunov force-pushed the feature/scylla-storage-backend branch 5 times, most recently from 0329556 to 4027981 Compare February 14, 2023 05:43
@porunov
Copy link
Member Author

porunov commented Feb 14, 2023

@FlorianHockmann I fixed the comments you left. I also fixed Hadoop tests.
That said, I noticed that we didn't apply configuration for ScyllaDB. After fixing that I see that ssl tests are failing. The reason is described here: #2505 (comment)
Couldn't figure out the cause why ScyllaDB is failing to start yet :/

@porunov
Copy link
Member Author

porunov commented Feb 15, 2023

I'm stuck with the issue about ssl certificates (here). I'm not sure I'll be able to resolve that issue. Thus, I can just comment out tests related to ScyllaDB ssl certificates and open a new issue for the tests. Let me know what you think about it.

@FlorianHockmann
Copy link
Member

Thus, I can just comment out tests related to ScyllaDB ssl certificates and open a new issue for the tests. Let me know what you think about it.

That would definitely be ok for me. This PR is already a huge improvement. It doesn't need to fix everything at once and these tests would already have failed before, if they were properly configured, right?

@porunov
Copy link
Member Author

porunov commented Feb 15, 2023

Thus, I can just comment out tests related to ScyllaDB ssl certificates and open a new issue for the tests. Let me know what you think about it.

That would definitely be ok for me. This PR is already a huge improvement. It doesn't need to fix everything at once and these tests would already have failed before, if they were properly configured, right?

Yes, if they were properly configured and use that configuration they would fail due to startup issue of the testcontainer.
Okay, I will comment them in such case

- Add ScyllaDB driver support via `janusgraph-scylla`
- `janusgraph-cql` contains tests for Cassandra3, Cassandra4, ScyllaDB. `janusgraph-scylla` contains tests for ScyllaDB only.
- Fix ScyllaDB tests (configs were not applied to ScyllaDB tests previously)

Fixes JanusGraph#1778
Related to JanusGraph#2451
Fixes JanusGraph#2505

Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
@porunov porunov force-pushed the feature/scylla-storage-backend branch from 4027981 to 7179cbb Compare February 15, 2023 16:31
@porunov
Copy link
Member Author

porunov commented Feb 15, 2023

Commented the failing tests. The PR is ready for re-review

@porunov porunov merged commit 52f639c into JanusGraph:master Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: external Externally-managed CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dedicated Scylla backend
4 participants