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
msg: client bind #12901
msg: client bind #12901
Conversation
refactor from #7256 |
we also met this problem when public and cluster are different net but can be interconnect. when injecting public network fault, it will cause mon electing always and osd false down |
Signed-off-by: Haomai Wang <haomai@xsky.com>
Signed-off-by: Haomai Wang <haomai@xsky.com>
Signed-off-by: Haomai Wang <haomai@xsky.com>
9a58f6b
to
dbb737d
Compare
@@ -859,6 +859,18 @@ ssize_t AsyncConnection::_process_connection() | |||
cs.close(); | |||
} | |||
|
|||
{ | |||
entity_addr_t addr2bind = msgr->get_myaddr(); | |||
if (msgr->cct->ms_bind_before_connect && (!addr2bind.is_blank_ip())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_myaddr() returns by reference, right? can use it directly instead of copying the value to addr2bind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eh, i guess if we have this option enabled by default it doesn't matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will modify addr2bind, so nonreference is suitable
/home/jenkins-build/build/workspace/ceph-pull-requests/src/msg/simple/Pipe.cc: In member function ‘int Pipe::accept()’: /home/jenkins-build/build/workspace/ceph-pull-requests/src/msg/simple/Pipe.cc:361:20: error: ‘class CephContext’ has no member named ‘ms_bind_before_connect’ if (msgr->cct->ms_bind_before_connect && (!addr2bind.is_blank_ip())) { ^ |
retest this please |
952938b
to
80c1b68
Compare
@@ -563,6 +573,9 @@ int main(int argc, const char **argv) | |||
r = ms_hb_front_server->bind(hb_front_addr); | |||
if (r < 0) | |||
exit(1); | |||
r = ms_hb_front_client->client_bind(hb_back_addr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuriw sorry, I have a mistake. you may need to update this pr to branch and schedule qa
Signed-off-by: Zengran Zhang <zhangzengran@h3c.com> Signed-off-by: Haomai Wang <haomai@xsky.com>
80c1b68
to
6e4ed29
Compare
{ | ||
lock.Lock(); | ||
if (did_bind) { | ||
assert(my_inst.addr == bind_addr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems that miss lock.Unlock()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
It looks like this will break librados functionality when used behind a NAT since it learns the address of the gateway and then attempts to bind using it instead of its local IP address [1]. |
No description provided.