Panic in case of advertise-address collision
Scenario: advertise-address collision doesn't affect the cluster
Given a single-instance cluster
When another instance with the same advertise-addres tries to join
Then in response it should get an error with a clear reason specified
Steps to reproduce
picodata run --instance-id i1 --peer :3301 --data-dir ./tmp/i1 --listen 127.0.0.1:3301 --advertise-address 127.0.0.1:3301
picodata run --instance-id i2 --peer :3301 --data-dir ./tmp/i2 --listen 127.0.0.1:3302 --advertise-address 127.0.0.1:3301
8f9e3dcd)
Actual behavior (commiti1
panics:
2022-05-27 18:48:34.703 [2688423] main/112/raft_join_loop I> processing batch: ["i2"]
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Other(Tarantool(TarantoolError { code: TupleFound, message: "Duplicate key exists in unique index \"peer_address\" in space \"raft_group\" with old tuple - [1, \"127.0.0.1:3301\", true, \"i1\", \"r1\", \"68d4a766-4144-3248-aeb4-e212356716e4\", \"e0df68c5-e7f9-395f-86b3-30ad9e1b7b07\", 1] and new tuple - [2, \"127.0.0.1:3301\", false, \"i2\", \"r1\", \"24c4ac5f-4981-3441-879c-aee1edb608a6\", \"e0df68c5-e7f9-395f-86b3-30ad9e1b7b07\", 3]" }))', src/traft/node.rs:490:58
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
[supervisor:2688416] subprocess finished: Ok(Signaled(Pid(2688423), SIGABRT, true))