-
Notifications
You must be signed in to change notification settings - Fork 622
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
CASSGO-5 system.peers
queried even if DisableInitialHostLookup
set to true
#1665
Comments
system.peers
queried event if DisableInitialHostLookup
set to true
system.peers
queried even if DisableInitialHostLookup
set to true
Thanks for raising the issue. It seems the behavior was like this since commit 83932d6 that introduced the option. It seems reasonable to me to treat this as a bug since the documentation says that the driver won't try to discover the hosts. Although Currently, gocql queries
We would need to disable it in all these cases, not just during reconnection. Could you elaborate on the reasons why you don't want to grant access to Does the issue affect executing queries for you or the only effect is that some error messages appear in logs? |
Thanks for getting back to me 🙇
Yes, that's a good point, we don't use those particular features so I neglected to include them in my issue but ofcourse a complete fix would need to address those call sites too.
Yeah sure. It's primarily to do with a quirk in AWS Keyspaces rather than us specifically wanting to deny access. We're using VPC endpoints and a query
Yeah, understood. I don't think that's such a problem with Keyspaces since the ring is abstracted away - we get a number of fixed endpoints which don't ever change!
I should have mentioned this in the initial issue 🤦🏻♂️ It does impact query execution, if a heartbeat fails we try and query
That's a good question. We don't disallow access but I'm not sure off the top of my head what AWS returns from For what it's worth, I recognise that this is issue is pretty specific to the AWS service - which is why I was reticent to call it a bug in the first instance 😅 Update: After a bit more debugging, I'm now less convinced that this is what caused our issues. Update 2: I think I've found the specific scenario that led to the "no hosts in pool" error, it's a bit of a doozy - sharing in case it's of any interest! Specific issue outline
So it seems like this problem was caused by the fact that:
|
I would like to work on this issue |
system.peers
queried even if DisableInitialHostLookup
set to true
system.peers
queried even if DisableInitialHostLookup
set to true
What version of Cassandra are you using?
We're actually using AWS Keyspaces
What version of Gocql are you using?
The issue exists in
1.2.1
What version of Go are you using?
1.19
What did you do?
Set the
DisableInitialHostLookup
totrue
What did you expect to see?
The driver would never query
system.peers
for host informationWhat did you see instead?
On heartbeat failure, the driver tries to query
system.peers
.Hi there,
Apologies in advance if this has been answered before - I searched through the issues and couldn't see anything related.
The docs for the
DisableInitialHostLookup
config flag state:It's true that the library avoids quering
system.peers
on session initialization however, in the event of a heartbeat failure on the control connection, we call(*controlConn).reconnect
with therefreshring
argtrue
. Which (as far as I can tell) will ultimately querysystem.peers
.It seems to me that this is true to the name of the config flag
DisableInitialHostLookup
but is not quite what the documentation suggests. I'm interested to know the maintainers' view on this and whether they'd consider a patch to change the reconnection logic to consider theDisableInitialHostLookup
configuration. Perhaps something like this:Why do we care?
A little bit more context to explain why this matters to us.
We're using gocql to speak to AWS Keyspaces, and, for various reasons, we don't want to grant the driver access to the
system.peers
table. We set theDisableInitialHostLookup
flag tofalse
but it seems that if we get a heartbeat timeout on a control connection, we'll try and refresh the ring and immediately run into this problem.The text was updated successfully, but these errors were encountered: