CASSGO-6 'Unable to discover cluster nodes with an empty rack name' issue fix#1785
CASSGO-6 'Unable to discover cluster nodes with an empty rack name' issue fix#1785tengu-alt wants to merge 1 commit into
Conversation
55e1d51 to
ed0c71d
Compare
| if err != nil { | ||
| return RowData{}, err | ||
| } | ||
| if column.Name == "rack" && column.Keyspace == "system" && (column.Table == "peers_v2" || column.Table == "peers") { |
There was a problem hiding this comment.
This seems like a hack, plus it could break backwards compatibility for existing users of RowData (outside of gocql) that read from those tables.
Could the issue be fixed another way, for example improving the API/adding new API for all users?
There was a problem hiding this comment.
I agree with addressing #1834 first, @martin-sucha can you provide feedback on #1834 ? I see your original comment on that issue, but I'm not sure if #1834 accurately implements what you were proposing.
ed0c71d to
e5b7c46
Compare
| state nodeState | ||
| schemaVersion string | ||
| tokens []string | ||
| isRackNil bool |
There was a problem hiding this comment.
We can change rack to be *string, it's a private field. A conversion has to happen in the Rack() function though.
There was a problem hiding this comment.
Sounds good to me!
Let's wait for the feedback that you have asked for.
e5b7c46 to
caf3893
Compare
faf1dcf to
adc8753
Compare
adc8753 to
e5992ca
Compare
|
I have an alternative solution that I can propose soon without depending on any other PRs. |
Sounds good, let's see it when it arrives. |
|
Alternative fix: #1895 |
This PR addresses issue #1706.
The driver was unable to discover nodes with an empty rack name because the
isValidPeer()function incorrectly checked for an empty string in the rack value (which is a valid case). The correct validation should ensure the rack name is not null (as a null value indicates an invalid peer).This PR fixes the method of retrieving the rack value from the
system.peersandsystem.peers_v2tables. Now, the rack value is set as a pointer to a string, allowing the value to be checked for null.