whatyouhide / xandra

Fast, simple, and robust Cassandra/ScyllaDB driver for Elixir.
ISC License
406 stars 54 forks source link

Crash when receiving :host_down event #323

Closed harunzengin closed 1 year ago

harunzengin commented 1 year ago

When Xandra.Cluster is connected to a couple of nodes and one of them crashes and we get a :node_down message, Xandra crashes with FunctionClauseError:

** (EXIT from #PID<0.284.0>) shell process exited with reason: an exception was raised:
    ** (FunctionClauseError) no function clause matching in Xandra.Cluster.Pool.handle_event/4
        (xandra 0.17.0) lib/xandra/cluster/pool.ex:186: Xandra.Cluster.Pool.handle_event(:info, {:host_down, {172, 25, 0, 11}, 9042}, :has_connected_once, %Xandra.Cluster.Pool{pool_options: [], contact_nodes: [{'172.25.0.10', 9042}, {'172.25.0.11', 9042}, {'172.25.0.12', 9042}], autodiscovered_nodes_port: 9042, pool_supervisor: #PID<0.287.0>, control_connection: #PID<0.288.0>, refresh_topology_interval: 300000, load_balancing_module: Xandra.Cluster.LoadBalancingPolicy.DCAwareRoundRobin, load_balancing_state: %Xandra.Cluster.LoadBalancingPolicy.DCAwareRoundRobin{local_dc: "berlin", local_hosts: [{%Xandra.Cluster.Host{address: {172, 25, 0, 10}, port: 9042, data_center: "berlin", host_id: "70f45c99-dbd3-481b-be04-603f22a89ab3", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1831232751059347242", "-2927274651294285531", "-4705908952117872660", "-5684054404633986735", "-7303077700331030033", "-739935640367134982", "-8893082252844928671", "104441007124026774", "1544709237026610012", "2616209853366642825", "3634061258109069840", "4451733190721420635", "5527489071947000174", "6263404764657893815", "7342777572105495473", "8586297577786087445"])}, :connected}, {%Xandra.Cluster.Host{address: {172, 25, 0, 12}, port: 9042, data_center: "berlin", host_id: "1c842506-6a29-4e30-8fa1-5282bc940f58", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1524457644217707815", "-2615754754909920075", "-3711796655144858364", "-5490430955968445493", "-6468576408484559568", "-680080996726546059", "-8087599704181602866", "1831687849516069992", "2849539254258497007", "3667211186870847802", "4742967068096427341", "5478882760807320982", "6558255568254922640", "760187233176037179", "7801775573935514612", "8769139817014050111"])}, :connected}, {%Xandra.Cluster.Host{address: {172, 25, 0, 11}, port: 9042, data_center: "berlin", host_id: "ca6bf4ed-6a90-45e7-8256-aeb4dc37842c", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1034722149644811703", "-2278242155325403677", "-3357614962773005334", "-4093530655483898975", "-5169286536709478515", "-5986958469321829309", "-67357906566276205", "-7004809874064256325", "-8076310490404289138", "1522646645947622432", "3141669941644665729", "4119815394160779805", "5898449694984366933", "6994491595219305222", "8085788705911517481", "8930165353402679239"])}, :connected}], remote_hosts: [{%Xandra.Cluster.Host{address: {172, 25, 0, 13}, port: 9042, data_center: "munich", host_id: "becabd8c-8183-4913-b681-bd9a1640cee2", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1019286977578646497", "-2098659785026248154", "-2834575477737141794", "-3910331358962721334", "-4728003291575072128", "-5745854696317499144", "-6817355312657531956", "-8257623542560115196", "-9102000190051276954", "1191597271180480974", "224233028101945475", "2781601823694379612", "4400625119391422909", "5378770571907536985", "7157404872731124113", "8253446772966062402"])}, :up}, {%Xandra.Cluster.Host{address: {172, 25, 0, 14}, port: 9042, data_center: "munich", host_id: "364b9b72-f44c-4fc5-994c-83ac2bf6cb15", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1690418006572812673", "-3130686236475395913", "-3975062883966557669", "-5066359994658769929", "-6162401894893708218", "-618917390232779861", "-7941036195717295347", "-8919181648233409423", "1216605947121997948", "2292361828347577487", "3028277521058471128", "398934014509647154", "4107650328506072786", "5351170334186664758", "6318534577265200257", "7908539129779098895"])}, :up}, {%Xandra.Cluster.Host{address: {172, 25, 0, 15}, port: 9042, data_center: "munich", host_id: "23dec1e2-33e1-4870-987b-1e79f96aba12", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1691995075370806194", "-3470629376194393323", "-4448774828710507398", "-595953175135867905", "-6067798124407550696", "-7657802676921449334", "-8625166919999984833", "1339720583047506111", "2779988812950089349", "3851489429290122162", "4869340834032549177", "495343935556344354", "5687012766644899972", "6762768647870479511", "7498684340581373152", "8578057148028974810"])}, :up}]}, target_pools: 3, sync_connect_ref: nil, name: nil, peers: %{{{172, 25, 0, 10}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 10}, port: 9042, data_center: "berlin", host_id: "70f45c99-dbd3-481b-be04-603f22a89ab3", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1831232751059347242", "-2927274651294285531", "-4705908952117872660", "-5684054404633986735", "-7303077700331030033", "-739935640367134982", "-8893082252844928671", "104441007124026774", "1544709237026610012", "2616209853366642825", "3634061258109069840", "4451733190721420635", "5527489071947000174", "6263404764657893815", "7342777572105495473", "8586297577786087445"])}, pool_pid: #PID<0.292.0>, status: :connected}, {{172, 25, 0, 11}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 11}, port: 9042, data_center: "berlin", host_id: "ca6bf4ed-6a90-45e7-8256-aeb4dc37842c", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1034722149644811703", "-2278242155325403677", "-3357614962773005334", "-4093530655483898975", "-5169286536709478515", "-5986958469321829309", "-67357906566276205", "-7004809874064256325", "-8076310490404289138", "1522646645947622432", "3141669941644665729", "4119815394160779805", "5898449694984366933", "6994491595219305222", "8085788705911517481", "8930165353402679239"])}, pool_pid: #PID<0.295.0>, status: :connected}, {{172, 25, 0, 12}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 12}, port: 9042, data_center: "berlin", host_id: "1c842506-6a29-4e30-8fa1-5282bc940f58", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1524457644217707815", "-2615754754909920075", "-3711796655144858364", "-5490430955968445493", "-6468576408484559568", "-680080996726546059", "-8087599704181602866", "1831687849516069992", "2849539254258497007", "3667211186870847802", "4742967068096427341", "5478882760807320982", "6558255568254922640", "760187233176037179", "7801775573935514612", "8769139817014050111"])}, pool_pid: #PID<0.298.0>, status: :connected}, {{172, 25, 0, 13}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 13}, port: 9042, data_center: "munich", host_id: "becabd8c-8183-4913-b681-bd9a1640cee2", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1019286977578646497", "-2098659785026248154", "-2834575477737141794", "-3910331358962721334", "-4728003291575072128", "-5745854696317499144", "-6817355312657531956", "-8257623542560115196", "-9102000190051276954", "1191597271180480974", "224233028101945475", "2781601823694379612", "4400625119391422909", "5378770571907536985", "7157404872731124113", "8253446772966062402"])}, pool_pid: nil, status: :up}, {{172, 25, 0, 14}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 14}, port: 9042, data_center: "munich", host_id: "364b9b72-f44c-4fc5-994c-83ac2bf6cb15", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1690418006572812673", "-3130686236475395913", "-3975062883966557669", "-5066359994658769929", "-6162401894893708218", "-618917390232779861", "-7941036195717295347", "-8919181648233409423", "1216605947121997948", "2292361828347577487", "3028277521058471128", "398934014509647154", "4107650328506072786", "5351170334186664758", "6318534577265200257", "7908539129779098895"])}, pool_pid: nil, status: :up}, {{172, 25, 0, 15}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 15}, port: 9042, data_center: "munich", host_id: "23dec1e2-33e1-4870-987b-1e79f96aba12", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1691995075370806194", "-3470629376194393323", "-4448774828710507398", "-595953175135867905", "-6067798124407550696", "-7657802676921449334", "-8625166919999984833", "1339720583047506111", "2779988812950089349", "3851489429290122162", "4869340834032549177", "495343935556344354", "5687012766644899972", "6762768647870479511", "7498684340581373152", "8578057148028974810"])}, pool_pid: nil, status: :up}}, reqs_before_connecting: %{max_size: 100, queue: {[], []}}, xandra_mod: Xandra, control_conn_mod: Xandra.Cluster.ControlConnection})
        (stdlib 4.3) gen_statem.erl:1428: :gen_statem.loop_state_callback/11
        (stdlib 4.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

I think the reason is that we expect a %Host{} struct instead of {172, 25, 0, 11}, 9042 in https://github.com/lexhide/xandra/blob/de34b698d8a0630510c84bcbd2b0b91d3fe98dfd/lib/xandra/cluster/pool.ex#L295

harunzengin commented 1 year ago

Same thing happens with other calls to the same handle_event function, such as:

** (EXIT from #PID<0.320.0>) shell process exited with reason: an exception was raised:
    ** (FunctionClauseError) no function clause matching in Xandra.Cluster.Pool.handle_event/4
        (xandra 0.17.0) lib/xandra/cluster/pool.ex:186: Xandra.Cluster.Pool.handle_event(:info, {:xandra, :disconnected, {'172.25.0.11', 9042}, #PID<0.335.0>}, :has_connected_once, %Xandra.Cluster.Pool{pool_options: [], contact_nodes: [{'172.25.0.10', 9042}, {'172.25.0.11', 9042}, {'172.25.0.12', 9042}], autodiscovered_nodes_port: 9042, pool_supervisor: #PID<0.327.0>, control_connection: #PID<0.328.0>, refresh_topology_interval: 300000, load_balancing_module: Xandra.Cluster.LoadBalancingPolicy.DCAwareRoundRobin, load_balancing_state: %Xandra.Cluster.LoadBalancingPolicy.DCAwareRoundRobin{local_dc: "berlin", local_hosts: [{%Xandra.Cluster.Host{address: {172, 25, 0, 10}, port: 9042, data_center: "berlin", host_id: "70f45c99-dbd3-481b-be04-603f22a89ab3", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1831232751059347242", "-2927274651294285531", "-4705908952117872660", "-5684054404633986735", "-7303077700331030033", "-739935640367134982", "-8893082252844928671", "104441007124026774", "1544709237026610012", "2616209853366642825", "3634061258109069840", "4451733190721420635", "5527489071947000174", "6263404764657893815", "7342777572105495473", "8586297577786087445"])}, :connected}, {%Xandra.Cluster.Host{address: {172, 25, 0, 12}, port: 9042, data_center: "berlin", host_id: "1c842506-6a29-4e30-8fa1-5282bc940f58", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1524457644217707815", "-2615754754909920075", "-3711796655144858364", "-5490430955968445493", "-6468576408484559568", "-680080996726546059", "-8087599704181602866", "1831687849516069992", "2849539254258497007", "3667211186870847802", "4742967068096427341", "5478882760807320982", "6558255568254922640", "760187233176037179", "7801775573935514612", "8769139817014050111"])}, :connected}, {%Xandra.Cluster.Host{address: {172, 25, 0, 11}, port: 9042, data_center: "berlin", host_id: "ca6bf4ed-6a90-45e7-8256-aeb4dc37842c", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1034722149644811703", "-2278242155325403677", "-3357614962773005334", "-4093530655483898975", "-5169286536709478515", "-5986958469321829309", "-67357906566276205", "-7004809874064256325", "-8076310490404289138", "1522646645947622432", "3141669941644665729", "4119815394160779805", "5898449694984366933", "6994491595219305222", "8085788705911517481", "8930165353402679239"])}, :up}], remote_hosts: [{%Xandra.Cluster.Host{address: {172, 25, 0, 13}, port: 9042, data_center: "munich", host_id: "becabd8c-8183-4913-b681-bd9a1640cee2", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1019286977578646497", "-2098659785026248154", "-2834575477737141794", "-3910331358962721334", "-4728003291575072128", "-5745854696317499144", "-6817355312657531956", "-8257623542560115196", "-9102000190051276954", "1191597271180480974", "224233028101945475", "2781601823694379612", "4400625119391422909", "5378770571907536985", "7157404872731124113", "8253446772966062402"])}, :up}, {%Xandra.Cluster.Host{address: {172, 25, 0, 14}, port: 9042, data_center: "munich", host_id: "364b9b72-f44c-4fc5-994c-83ac2bf6cb15", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1690418006572812673", "-3130686236475395913", "-3975062883966557669", "-5066359994658769929", "-6162401894893708218", "-618917390232779861", "-7941036195717295347", "-8919181648233409423", "1216605947121997948", "2292361828347577487", "3028277521058471128", "398934014509647154", "4107650328506072786", "5351170334186664758", "6318534577265200257", "7908539129779098895"])}, :up}, {%Xandra.Cluster.Host{address: {172, 25, 0, 15}, port: 9042, data_center: "munich", host_id: "23dec1e2-33e1-4870-987b-1e79f96aba12", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1691995075370806194", "-3470629376194393323", "-4448774828710507398", "-595953175135867905", "-6067798124407550696", "-7657802676921449334", "-8625166919999984833", "1339720583047506111", "2779988812950089349", "3851489429290122162", "4869340834032549177", "495343935556344354", "5687012766644899972", "6762768647870479511", "7498684340581373152", "8578057148028974810"])}, :up}]}, target_pools: 3, sync_connect_ref: nil, name: nil, peers: %{{{172, 25, 0, 10}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 10}, port: 9042, data_center: "berlin", host_id: "70f45c99-dbd3-481b-be04-603f22a89ab3", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1831232751059347242", "-2927274651294285531", "-4705908952117872660", "-5684054404633986735", "-7303077700331030033", "-739935640367134982", "-8893082252844928671", "104441007124026774", "1544709237026610012", "2616209853366642825", "3634061258109069840", "4451733190721420635", "5527489071947000174", "6263404764657893815", "7342777572105495473", "8586297577786087445"])}, pool_pid: #PID<0.330.0>, status: :connected}, {{172, 25, 0, 11}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 11}, port: 9042, data_center: "berlin", host_id: "ca6bf4ed-6a90-45e7-8256-aeb4dc37842c", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1034722149644811703", "-2278242155325403677", "-3357614962773005334", "-4093530655483898975", "-5169286536709478515", "-5986958469321829309", "-67357906566276205", "-7004809874064256325", "-8076310490404289138", "1522646645947622432", "3141669941644665729", "4119815394160779805", "5898449694984366933", "6994491595219305222", "8085788705911517481", "8930165353402679239"])}, pool_pid: #PID<0.333.0>, status: :up}, {{172, 25, 0, 12}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 12}, port: 9042, data_center: "berlin", host_id: "1c842506-6a29-4e30-8fa1-5282bc940f58", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1524457644217707815", "-2615754754909920075", "-3711796655144858364", "-5490430955968445493", "-6468576408484559568", "-680080996726546059", "-8087599704181602866", "1831687849516069992", "2849539254258497007", "3667211186870847802", "4742967068096427341", "5478882760807320982", "6558255568254922640", "760187233176037179", "7801775573935514612", "8769139817014050111"])}, pool_pid: #PID<0.336.0>, status: :connected}, {{172, 25, 0, 13}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 13}, port: 9042, data_center: "munich", host_id: "becabd8c-8183-4913-b681-bd9a1640cee2", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1019286977578646497", "-2098659785026248154", "-2834575477737141794", "-3910331358962721334", "-4728003291575072128", "-5745854696317499144", "-6817355312657531956", "-8257623542560115196", "-9102000190051276954", "1191597271180480974", "224233028101945475", "2781601823694379612", "4400625119391422909", "5378770571907536985", "7157404872731124113", "8253446772966062402"])}, pool_pid: nil, status: :up}, {{172, 25, 0, 14}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 14}, port: 9042, data_center: "munich", host_id: "364b9b72-f44c-4fc5-994c-83ac2bf6cb15", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1690418006572812673", "-3130686236475395913", "-3975062883966557669", "-5066359994658769929", "-6162401894893708218", "-618917390232779861", "-7941036195717295347", "-8919181648233409423", "1216605947121997948", "2292361828347577487", "3028277521058471128", "398934014509647154", "4107650328506072786", "5351170334186664758", "6318534577265200257", "7908539129779098895"])}, pool_pid: nil, status: :up}, {{172, 25, 0, 15}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 15}, port: 9042, data_center: "munich", host_id: "23dec1e2-33e1-4870-987b-1e79f96aba12", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1691995075370806194", "-3470629376194393323", "-4448774828710507398", "-595953175135867905", "-6067798124407550696", "-7657802676921449334", "-8625166919999984833", "1339720583047506111", "2779988812950089349", "3851489429290122162", "4869340834032549177", "495343935556344354", "5687012766644899972", "6762768647870479511", "7498684340581373152", "8578057148028974810"])}, pool_pid: nil, status: :up}}, reqs_before_connecting: %{max_size: 100, queue: {[], []}}, xandra_mod: Xandra, control_conn_mod: Xandra.Cluster.ControlConnection})
        (stdlib 4.3) gen_statem.erl:1428: :gen_statem.loop_state_callback/11
        (stdlib 4.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
whatyouhide commented 1 year ago

Yep good catch! Fixed ☝️

harunzengin commented 1 year ago

@whatyouhide this is still not fixed. The following line sends a :disconnected message which Xandra.Cluster.Pool.handle_event/4 doesn't understand.

https://github.com/lexhide/xandra/blob/ac66313bd8ce548e0673fb1f37562d317c3a427f/lib/xandra/connection.ex#L380

whatyouhide commented 1 year ago

Ah yes, missed that comment 🤦 Should have been fixed in ab2a867.

harunzengin commented 1 year ago

@whatyouhide Now I get:

[error] module=gen_server  GenServer #PID<0.319.0> terminating
** (FunctionClauseError) no function clause matching in Xandra.Cluster.Pool.handle_event/4
    (xandra 0.17.0) lib/xandra/cluster/pool.ex:186: Xandra.Cluster.Pool.handle_event(:info, {:xandra, :disconnected, {'172.25.0.11', 9042}, #PID<0.331.0>}, :has_connected_once, %Xandra.Cluster.Pool{pool_options: [], contact_nodes: [{'172.25.0.10', 9042}, {'172.25.0.11', 9042}, {'172.25.0.12', 9042}], autodiscovered_nodes_port: 9042, pool_supervisor: #PID<0.319.0>, control_connection: #PID<0.320.0>, refresh_topology_interval: 300000, load_balancing_module: Xandra.Cluster.LoadBalancingPolicy.DCAwareRoundRobin, load_balancing_state: %Xandra.Cluster.LoadBalancingPolicy.DCAwareRoundRobin{local_dc: "berlin", local_hosts: [{%Xandra.Cluster.Host{address: {172, 25, 0, 10}, port: 9042, data_center: "berlin", host_id: "70f45c99-dbd3-481b-be04-603f22a89ab3", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1831232751059347242", "-2927274651294285531", "-4705908952117872660", "-5684054404633986735", "-7303077700331030033", "-739935640367134982", "-8893082252844928671", "104441007124026774", "1544709237026610012", "2616209853366642825", "3634061258109069840", "4451733190721420635", "5527489071947000174", "6263404764657893815", "7342777572105495473", "8586297577786087445"])}, :connected}, {%Xandra.Cluster.Host{address: {172, 25, 0, 12}, port: 9042, data_center: "berlin", host_id: "1c842506-6a29-4e30-8fa1-5282bc940f58", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1524457644217707815", "-2615754754909920075", "-3711796655144858364", "-5490430955968445493", "-6468576408484559568", "-680080996726546059", "-8087599704181602866", "1831687849516069992", "2849539254258497007", "3667211186870847802", "4742967068096427341", "5478882760807320982", "6558255568254922640", "760187233176037179", "7801775573935514612", "8769139817014050111"])}, :connected}, {%Xandra.Cluster.Host{address: {172, 25, 0, 11}, port: 9042, data_center: "berlin", host_id: "ca6bf4ed-6a90-45e7-8256-aeb4dc37842c", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1034722149644811703", "-2278242155325403677", "-3357614962773005334", "-4093530655483898975", "-5169286536709478515", "-5986958469321829309", "-67357906566276205", "-7004809874064256325", "-8076310490404289138", "1522646645947622432", "3141669941644665729", "4119815394160779805", "5898449694984366933", "6994491595219305222", "8085788705911517481", "8930165353402679239"])}, :up}], remote_hosts: [{%Xandra.Cluster.Host{address: {172, 25, 0, 13}, port: 9042, data_center: "munich", host_id: "becabd8c-8183-4913-b681-bd9a1640cee2", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1019286977578646497", "-2098659785026248154", "-2834575477737141794", "-3910331358962721334", "-4728003291575072128", "-5745854696317499144", "-6817355312657531956", "-8257623542560115196", "-9102000190051276954", "1191597271180480974", "224233028101945475", "2781601823694379612", "4400625119391422909", "5378770571907536985", "7157404872731124113", "8253446772966062402"])}, :up}, {%Xandra.Cluster.Host{address: {172, 25, 0, 14}, port: 9042, data_center: "munich", host_id: "364b9b72-f44c-4fc5-994c-83ac2bf6cb15", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1690418006572812673", "-3130686236475395913", "-3975062883966557669", "-5066359994658769929", "-6162401894893708218", "-618917390232779861", "-7941036195717295347", "-8919181648233409423", "1216605947121997948", "2292361828347577487", "3028277521058471128", "398934014509647154", "4107650328506072786", "5351170334186664758", "6318534577265200257", "7908539129779098895"])}, :up}, {%Xandra.Cluster.Host{address: {172, 25, 0, 15}, port: 9042, data_center: "munich", host_id: "23dec1e2-33e1-4870-987b-1e79f96aba12", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1691995075370806194", "-3470629376194393323", "-4448774828710507398", "-595953175135867905", "-6067798124407550696", "-7657802676921449334", "-8625166919999984833", "1339720583047506111", "2779988812950089349", "3851489429290122162", "4869340834032549177", "495343935556344354", "5687012766644899972", "6762768647870479511", "7498684340581373152", "8578057148028974810"])}, :up}]}, target_pools: 3, sync_connect_ref: nil, name: nil, peers: %{{{172, 25, 0, 10}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 10}, port: 9042, data_center: "berlin", host_id: "70f45c99-dbd3-481b-be04-603f22a89ab3", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1831232751059347242", "-2927274651294285531", "-4705908952117872660", "-5684054404633986735", "-7303077700331030033", "-739935640367134982", "-8893082252844928671", "104441007124026774", "1544709237026610012", "2616209853366642825", "3634061258109069840", "4451733190721420635", "5527489071947000174", "6263404764657893815", "7342777572105495473", "8586297577786087445"])}, pool_pid: #PID<0.326.0>, status: :connected}, {{172, 25, 0, 11}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 11}, port: 9042, data_center: "berlin", host_id: "ca6bf4ed-6a90-45e7-8256-aeb4dc37842c", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1034722149644811703", "-2278242155325403677", "-3357614962773005334", "-4093530655483898975", "-5169286536709478515", "-5986958469321829309", "-67357906566276205", "-7004809874064256325", "-8076310490404289138", "1522646645947622432", "3141669941644665729", "4119815394160779805", "5898449694984366933", "6994491595219305222", "8085788705911517481", "8930165353402679239"])}, pool_pid: #PID<0.329.0>, status: :up}, {{172, 25, 0, 12}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 12}, port: 9042, data_center: "berlin", host_id: "1c842506-6a29-4e30-8fa1-5282bc940f58", rack: "b1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1524457644217707815", "-2615754754909920075", "-3711796655144858364", "-5490430955968445493", "-6468576408484559568", "-680080996726546059", "-8087599704181602866", "1831687849516069992", "2849539254258497007", "3667211186870847802", "4742967068096427341", "5478882760807320982", "6558255568254922640", "760187233176037179", "7801775573935514612", "8769139817014050111"])}, pool_pid: #PID<0.332.0>, status: :connected}, {{172, 25, 0, 13}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 13}, port: 9042, data_center: "munich", host_id: "becabd8c-8183-4913-b681-bd9a1640cee2", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1019286977578646497", "-2098659785026248154", "-2834575477737141794", "-3910331358962721334", "-4728003291575072128", "-5745854696317499144", "-6817355312657531956", "-8257623542560115196", "-9102000190051276954", "1191597271180480974", "224233028101945475", "2781601823694379612", "4400625119391422909", "5378770571907536985", "7157404872731124113", "8253446772966062402"])}, pool_pid: nil, status: :up}, {{172, 25, 0, 14}, 9042} => %{host: %Xandra.Cluster.Host{address: {172, 25, 0, 14}, port: 9042, data_center: "munich", host_id: "364b9b72-f44c-4fc5-994c-83ac2bf6cb15", rack: "m1", release_version: "4.1.1", schema_version: "54e17321-3f2e-37ca-9b08-d91ba7bdd369", tokens: MapSet.new(["-1690418006572812673", "-3130686236475395913", "-3975062883966557669", "-5066359994658769929", "-6162401894893708218", "-618917390232779861", "-7941036195717295347", "-8919181648233409423", "1216605947121997948", "2292361828347577487", "3028277521058471128", "398934014509647154", "4107650328506072786", "5351170334186664758", "6318534577265200257", "7908539129779098895"])}, pool_pid: nil, st (truncated)

which I think the ip in {'172.25.0.11', 9042} is expected to be in form: {{172, 25, 0, 11}, 9042} in this guard:

https://github.com/lexhide/xandra/blob/ab2a8676c58f5b450942939985484ecad0cd5603/lib/xandra/cluster/pool.ex#L129-L131

whatyouhide commented 1 year ago

@harunzengin yet one more good find 😉 Fixed in 429608d.