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

CassandraSinkCluster: Fix system.peers rpc_address #837

Merged
merged 1 commit into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions shotover-proxy/src/transforms/cassandra/sink_cluster/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,6 @@ impl CassandraSinkCluster {
MessageValue::Uuid(shotover_peer.host_id)
} else if colspec.name == preferred_ip_alias
|| colspec.name == preferred_port_alias
|| colspec.name == rpc_address_alias
{
MessageValue::Null
} else if colspec.name == native_address_alias {
Expand All @@ -589,7 +588,9 @@ impl CassandraSinkCluster {
shotover_peer.address.port() as i64,
IntSize::I32,
)
} else if colspec.name == peer_alias {
} else if colspec.name == peer_alias
|| colspec.name == rpc_address_alias
{
MessageValue::Inet(shotover_peer.address.ip())
} else if colspec.name == peer_port_alias {
MessageValue::Integer(7000, IntSize::I32)
Expand Down
12 changes: 7 additions & 5 deletions shotover-proxy/tests/cassandra_int_tests/cluster_multi_rack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ async fn test_rewrite_system_peers(connection: &CassandraConnection) {
// rack is non-determistic because we dont know which node this will be
ResultValue::Any,
ResultValue::Varchar("4.0.6".into()),
ResultValue::Null,
// rpc_address is non-determistic because we dont know which node this will be
ResultValue::Any,
// schema_version is non deterministic so we cant assert on it.
ResultValue::Any,
// Unfortunately token generation appears to be non-deterministic but we can at least assert that
Expand Down Expand Up @@ -96,21 +97,22 @@ async fn test_rewrite_system_local(connection: &CassandraConnection) {
let star_results = [
ResultValue::Varchar("local".into()),
ResultValue::Varchar("COMPLETED".into()),
// broadcast address is non-deterministic because we dont know which node this will be
// broadcast address is non-deterministic because we dont know which shotover node this will be
ResultValue::Any,
ResultValue::Int(7000),
ResultValue::Varchar("TestCluster".into()),
ResultValue::Varchar("3.4.5".into()),
ResultValue::Varchar("dc1".into()),
// gossip_generation is non deterministic cant assert on it
ResultValue::Any,
// host_id is non-deterministic because we dont know which node this will be
// host_id is non-deterministic because we dont know which shotover node this will be
ResultValue::Any,
// listen_address is non-deterministic because we dont know which shotover node this will be
ResultValue::Any,
ResultValue::Inet("127.0.0.1".parse().unwrap()),
ResultValue::Int(7000),
ResultValue::Varchar("5".into()),
ResultValue::Varchar("org.apache.cassandra.dht.Murmur3Partitioner".into()),
// rack is non-deterministic because we dont know which node this will be
// rack is non-deterministic because we dont know which shotover node this will be
ResultValue::Any,
ResultValue::Varchar("4.0.6".into()),
ResultValue::Inet("0.0.0.0".parse().unwrap()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ async fn test_rewrite_system_peers_dummy_peers(connection: &CassandraConnection)
ResultValue::Null,
ResultValue::Varchar("rack1".into()),
ResultValue::Varchar("3.11.13".into()),
ResultValue::Null,
// rpc_address is non-determistic because we dont know which node this will be
ResultValue::Any,
// schema_version is non deterministic so we cant assert on it.
ResultValue::Any,
// Unfortunately token generation appears to be non-deterministic but we can at least assert that
Expand All @@ -24,7 +25,8 @@ async fn test_rewrite_system_peers_dummy_peers(connection: &CassandraConnection)
ResultValue::Null,
ResultValue::Varchar("rack1".into()),
ResultValue::Varchar("3.11.13".into()),
ResultValue::Null,
// rpc_address is non-determistic because we dont know which node this will be
ResultValue::Any,
// schema_version is non deterministic so we cant assert on it.
ResultValue::Any,
// Unfortunately token generation appears to be non-deterministic but we can at least assert that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ async fn test_rewrite_system_peers_dummy_peers(connection: &CassandraConnection)
ResultValue::Null,
ResultValue::Varchar("rack1".into()),
ResultValue::Varchar("4.0.6".into()),
ResultValue::Null,
// rpc_address is non-determistic because we dont know which node this will be
ResultValue::Any,
// schema_version is non deterministic so we cant assert on it.
ResultValue::Any,
// Unfortunately token generation appears to be non-deterministic but we can at least assert that
Expand All @@ -72,7 +73,8 @@ async fn test_rewrite_system_peers_dummy_peers(connection: &CassandraConnection)
ResultValue::Null,
ResultValue::Varchar("rack1".into()),
ResultValue::Varchar("4.0.6".into()),
ResultValue::Null,
// rpc_address is non-determistic because we dont know which node this will be
ResultValue::Any,
// schema_version is non deterministic so we cant assert on it.
ResultValue::Any,
// Unfortunately token generation appears to be non-deterministic but we can at least assert that
Expand Down