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

Shard awareness extension for Scylla patchset 1 #1210

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

mmatczuk
Copy link
Contributor

@mmatczuk mmatczuk commented Oct 9, 2018

This patchset contains the generic part of #1206. It introduces ConnPicker interface that is used to abstract hostConnPool storage.

There are, however, some differences to #1206 code.

  • Conn.shard is replaced by Conn.supported, the supported map
  • HostInfo.shardingInfo is dropped
  • all the ConnPicker impl are not exported
  • hostConnPool.connPickerOnce is dropped as it's already handled by mu

@mmatczuk mmatczuk force-pushed the mmt/scylla_shard_aware_patch_1 branch 2 times, most recently from 7a1a249 to d14fa44 Compare October 9, 2018 20:59
Copy link
Contributor

@alourie alourie left a comment

Choose a reason for hiding this comment

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

please rebase on newest master, specifically query_executor.go needs an update.

connpicker.go Outdated
}

func (nopConnPicker) Size() (int, int) {
return 0, 1 // 1 makes hostConnPool want to fill the pool
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason to want to fill the pool for no-op?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nopConnPicker is a guard implementation used in newHostConnPool [1]. If it's 0 then hostConnPool.fill is not called. The real ConnPool assignment is deferred to the moment when we have a connection [2]. Maybe we should change the comment, do you have any suggestions?

[1] https://github.com/gocql/gocql/pull/1210/files#diff-3aa88c8ac2c0ffb49cbd55573005b354R283
[2] https://github.com/gocql/gocql/pull/1210/files#diff-3aa88c8ac2c0ffb49cbd55573005b354R515

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm having a couple of ideas here, will try something out first.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, I'm fine with this guard. Maybe update the comment that if hostConnPool doesn't need to fill the pool, then it won't initiate the picker in this case?

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 added more detailed description, PTAL.

@dahankzter
Copy link
Contributor

They are both rebased @alourie afaict. No way to retrigger Travis though, can you do it?

@dahankzter dahankzter force-pushed the mmt/scylla_shard_aware_patch_1 branch from d14fa44 to 5a13421 Compare October 10, 2018 07:19
@dahankzter
Copy link
Contributor

Actually, I was wrong. I have rebased them now.

@dahankzter dahankzter force-pushed the mmt/scylla_shard_aware_patch_1 branch from 5a13421 to 15fb290 Compare October 10, 2018 07:27
@mmatczuk mmatczuk force-pushed the mmt/scylla_shard_aware_patch_1 branch from 15fb290 to 9b76938 Compare October 10, 2018 08:33
@mmatczuk
Copy link
Contributor Author

mmatczuk commented Oct 10, 2018

Hi @alourie,
after rebase to aa46e85 it fails on Travis with C* 3.11.3, seems to be a problem with the commit.

@alourie
Copy link
Contributor

alourie commented Oct 10, 2018

@mmatczuk yep, I can see that, that's unrelated to your commit. Will review it soon.

@mmatczuk mmatczuk force-pushed the mmt/scylla_shard_aware_patch_1 branch 2 times, most recently from 917951f to 191e22e Compare October 11, 2018 06:52
@mmatczuk
Copy link
Contributor Author

@alourie it's rebased to 26b68fd now.

@alourie alourie requested a review from Zariel October 11, 2018 07:33
Copy link
Contributor

@alourie alourie left a comment

Choose a reason for hiding this comment

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

cc @Zariel please have a look

@mmatczuk mmatczuk force-pushed the mmt/scylla_shard_aware_patch_1 branch from 191e22e to 6fdb280 Compare October 12, 2018 10:39
@mmatczuk
Copy link
Contributor Author

@Zariel I rebased that over you latest commit and resolved conflicts in conn.go

@mmatczuk mmatczuk force-pushed the mmt/scylla_shard_aware_patch_1 branch from 6fdb280 to db738dc Compare October 18, 2018 07:11
@mmatczuk
Copy link
Contributor Author

Hi @alourie and @Zariel,

I rebased this branch again and dropped ea1cb17 due to that being redone in #1217. We also found and fixed a race in tests (see 8bd5d33) do you want that in a separate PR?

@dahankzter updated #1211 with graphs showing why this work so much beneficial to Scylla users. Do you think we could get that merged?

@mmatczuk mmatczuk force-pushed the mmt/scylla_shard_aware_patch_1 branch from db738dc to fbe2d0d Compare October 18, 2018 07:52
@alourie
Copy link
Contributor

alourie commented Oct 18, 2018

@mmatczuk If you can split 8bd5d33 into a separate PR, that would be great. We'll be able to proceed with that one unrelated to Scylla work.

Aside for that, I'm keen to merge this work, just waiting for @Zariel to have a look.

@mmatczuk
Copy link
Contributor Author

The new PR is created #1220.

@alourie
Copy link
Contributor

alourie commented Oct 18, 2018

The new PR is created #1220.

Merged.

mmatczuk and others added 3 commits October 18, 2018 15:41
Co-authored-by: Henrik Johansson <henrik@scylladb.com>
Co-authored-by: Michał Matczuk <michal@scylladb.com>
This allows tokenAwareHostPolicy return token from ExecutableQuery.

Co-authored-by: Henrik Johansson <henrik@scylladb.com>
Co-authored-by: Michał Matczuk <michal@scylladb.com>
The hostConnPool logic around conns slice is moved to defaultConnPicker.

Co-authored-by: Henrik Johansson <henrik@scylladb.com>
Co-authored-by: Michał Matczuk <michal@scylladb.com>
@mmatczuk mmatczuk force-pushed the mmt/scylla_shard_aware_patch_1 branch from fbe2d0d to 608dba8 Compare October 18, 2018 13:41
@mmatczuk
Copy link
Contributor Author

mmatczuk commented Oct 18, 2018

Great. Rebased again, only relevant commits are left.

@apache apache deleted a comment from senthilrag Oct 26, 2018
@rkuska
Copy link

rkuska commented Nov 13, 2018

Hi, just wanted to ask whether you plan to merge this MR and also the other related; #1211 and if there is some sort of timeline set or some help is needed?

This would help me in deciding whether or not use the patched version of gocql.

@mmatczuk
Copy link
Contributor Author

mmatczuk commented Feb 20, 2019

Hi @Zariel,
I'm trying to understand the status of the Scylla related patches, what is your take on it? Should gocql be a pure Cassandra driver without any vendor specific extensions? I'm fine with that, we already have a fork but from Open Source philosophy standpoint I'm not too happy about it.
Cheers

@steeve
Copy link

steeve commented Oct 20, 2019

Friendly ping :)

@mmatczuk
Copy link
Contributor Author

@steeve we maintain a shard aware fork at https://github.com/scylladb/gocql

@steeve
Copy link

steeve commented Oct 21, 2019

@mmatczuk yes, we already use it and it great. but it would be nice that the changes be merged, even though the fork is top notch

@martin-sucha
Copy link
Contributor

@Zariel could you please decide whether the Scylla patch set from scylla/gocql would be accepted (and what changes might be necessary before that) to gocql/gocql or not? If I understand it is (or should be made possible to make it) compatible both with Scylla and Cassandra at the same time. The uncertainty is causing some additional work for us and fracturing the ecosystem. I believe everyone would benefit from all the parties contributing just to a single version of gocql.

@ashtonian
Copy link

Please merge :)

@jeffwidman
Copy link
Contributor

@Zariel could you please decide whether the Scylla patch set from scylla/gocql would be accepted (and what changes might be necessary before that) to gocql/gocql or not? If I understand it is (or should be made possible to make it) compatible both with Scylla and Cassandra at the same time. The uncertainty is causing some additional work for us and fracturing the ecosystem. I believe everyone would benefit from all the parties contributing just to a single version of gocql.

@martin-sucha @Zariel any update on this?

I completely agree it's a royal pain for us to ensure all our libraries are pulling in scylla/gocql since many of our external deps pull in gocql/gocql and would be much simpler if gocql just pulled in the token-aware stuff.

@Zariel
Copy link
Contributor

Zariel commented Mar 10, 2021

I'll take a look at this this coming weekend, I'll be happy to support an interface which allows the Scylla specific logic to live outside the main tree.

@jeffwidman
Copy link
Contributor

I'll take a look at this this coming weekend, I'll be happy to support an interface which allows the Scylla specific logic to live outside the main tree.

@Zariel any chance you got time to look at this over the weekend?

@Zariel
Copy link
Contributor

Zariel commented Mar 15, 2021

So I think this is broadly ok but I think the abstraction could do with some work. It feels like the ConnPicker is doing a bit too much, namely controlling how many connections to open. I get this is what Scylla needs but it is one of the core reasons why I disliked the previous approach, needing to dial a connection to figure out how many connections to dial means that abstractions leak and makes things elsewhere a bit messy.

We could also do with having a type for Pick which exposes more than just the queries token, or at least so we can add things to it in the future without making breaking API changes.

Also the name Pick is too overused and not very descriptive, it could also probably do with returning some kind of iterator to try more connections or something.

@mmatczuk
Copy link
Contributor Author

There is more Scylla specific stuff in the fork at the moment. The shard-awareness seems to be well battle tested. I can send an updated patch set based on what we have now.

@jeffwidman
Copy link
Contributor

nudge @mmatczuk

nivekuil referenced this pull request in nivekuil/seaweedfs Jun 28, 2021
@robd003
Copy link

robd003 commented Dec 8, 2021

Any chance this could be merged in along with #1211 ?

@ashtonian
Copy link

@mmatczuk @Zariel - this pr turns 4 in October. What needs to be done with this and #1211 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants