Skip to content

Conversation

@joao-r-reis
Copy link
Contributor

There is an unintended change in 2.0-rc1 causing the driver to prefer system table addresses over the connection address which breaks deployments that rely on this behavior from 1.x.

This patch fixes this and keeps the behavior the same as it was in 1.x.

@joao-r-reis
Copy link
Contributor Author

Pushed a change to this line here, this might fix #1873

host_source.go Outdated
}

host, err := r.session.hostInfoFromIter(iter, nil, r.session.cfg.Port)
host, err := r.session.hostInfoFromIter(iter, iter.host.connectAddress, r.session.cfg.Port)
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this need to lock mu? Do we need a new function that's like ActualConnectAddress that does the locking?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh you're right I think, I should probably use host.ConnectAddress() instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually ConnectAddress() will do all the logic to falback to other columns so I probably need to add a new method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@jameshartig jameshartig left a comment

Choose a reason for hiding this comment

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

Looks good but I'd like to see some more comments around the changed lines so we understand the nuances of why they're doing something specific because it's not obvious when looking at the code in places.

There is an unintended change in 2.0-rc1 causing the driver to prefer system table addresses over the connection address which breaks deployments that rely on this behavior from 1.x.

This patch fixes this and keeps the behavior the same as it was in 1.x. It also fixes an issue where connection address was not being used when a full ring refresh was triggered.

Patch by João Reis; reviewed by James Hartig for CASSGO-91
@joao-r-reis
Copy link
Contributor Author

Looks good but I'd like to see some more comments around the changed lines so we understand the nuances of why they're doing something specific because it's not obvious when looking at the code in places.

good point, done

@joao-r-reis joao-r-reis changed the title CASSGO-91 Prefer connection address over system table addresses CASSGO-91 Prefer connection address over system local addresses Oct 10, 2025
@joao-r-reis joao-r-reis merged commit f3e2b39 into apache:trunk Oct 10, 2025
142 of 144 checks passed
@joao-r-reis joao-r-reis deleted the systemlocaladdress branch October 10, 2025 18:29
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.

2 participants