Skip to content

JAVA-1038: Fetch node info by rpc_address if it has a broadcast_address which is not in system.peers.#596

Merged
olim7t merged 1 commit into
2.1from
java1038
Feb 23, 2016
Merged

JAVA-1038: Fetch node info by rpc_address if it has a broadcast_address which is not in system.peers.#596
olim7t merged 1 commit into
2.1from
java1038

Conversation

@adutra
Copy link
Copy Markdown
Contributor

@adutra adutra commented Feb 17, 2016

This supersedes #550 .

@olim7t
Copy link
Copy Markdown
Contributor

olim7t commented Feb 19, 2016

👍

@tolbertam
Copy link
Copy Markdown
Contributor

I tried this out in EC2 and it worked fantastically! Set up a 3 node cluster with a similar setup to what @wy96f described in #550 (private listen_address & rpc_address, public broadcast_address, didn't try multi-region as that isn't relevant to this change)

Sequence of events showing this working:

Before stopping 172.30.1.194 (52.90.195.27)

122834 Host: /172.30.1.194:9042, State: UP
122834 Host: /172.30.1.195:9042, State: UP
122834 Host: /172.30.1.193:9042, State: UP
122841 Peers Row: Row[/54.173.253.177, datacenter1, 24c2d31c-375c-48f5-b87d-dd04827a9e9c, /172.30.1.193]
122841 Peers Row: Row[/52.90.195.27, datacenter1, 30707e5e-5b04-49d7-bb16-ecc736ea7bea, /172.30.1.194]
122841 Peers Row: Row[/52.90.31.50, datacenter1, 5edda4e6-c755-4c77-b882-718d64a437a0, /172.30.1.195]

After stopping 172.30.1.194 (52.90.195.27)

127841 Host: /172.30.1.194:9042, State: DOWN
127841 Host: /172.30.1.195:9042, State: UP
127841 Host: /172.30.1.193:9042, State: UP
127844 Peers Row: Row[/54.173.253.177, datacenter1, 24c2d31c-375c-48f5-b87d-dd04827a9e9c, /172.30.1.193]
127844 Peers Row: Row[/52.90.195.27, datacenter1, 30707e5e-5b04-49d7-bb16-ecc736ea7bea, /172.30.1.194]
127844 Peers Row: Row[/52.90.31.50, datacenter1, 5edda4e6-c755-4c77-b882-718d64a437a0, /172.30.1.195]

After starting 172.30.1.194 (now: 52.90.195.55)

578438 Host: /172.30.1.194:9042, State: UP
578438 Host: /172.30.1.195:9042, State: UP
578438 Host: /172.30.1.193:9042, State: UP
578443 Peers Row: Row[/54.173.253.177, datacenter1, 24c2d31c-375c-48f5-b87d-dd04827a9e9c, /172.30.1.193]
578443 Peers Row: Row[/54.164.27.55, datacenter1, 30707e5e-5b04-49d7-bb16-ecc736ea7bea, /172.30.1.194]
578443 Peers Row: Row[/52.90.31.50, datacenter1, 5edda4e6-c755-4c77-b882-718d64a437a0, /172.30.1.195]

As you can see the host is marked back up and the driver reconnects to it even though the peer changes, where it wouldn't have attempted to reconnect previously as the listen address would no longer be in the peers table.

The only thing I think that would be nice to add to this is logging for this particular case (maybe at debug) when the entry isn't found in peers and we attempt using the rpc_address instead.

@olim7t
Copy link
Copy Markdown
Contributor

olim7t commented Feb 23, 2016

@tolbertam I added the log in the rebased commit.

olim7t added a commit that referenced this pull request Feb 23, 2016
JAVA-1038: Fetch node info by rpc_address if it has a broadcast_address which is not in system.peers.
@olim7t olim7t merged commit 2708bd7 into 2.1 Feb 23, 2016
@olim7t olim7t deleted the java1038 branch February 23, 2016 17:42
Sfurti-yb pushed a commit to yugabyte/cassandra-java-driver that referenced this pull request Dec 8, 2023
Sfurti-yb pushed a commit to yugabyte/cassandra-java-driver that referenced this pull request Dec 8, 2023
[apache#595][apache#596]

Signed-off-by: Mark Paluch <mpaluch@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants