You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/12/08 08:26:39 UTC

[GitHub] [incubator-kvrocks] caipengbo opened a new issue, #1170: SLAVEOF command may block a long time

caipengbo opened a new issue, #1170:
URL: https://github.com/apache/incubator-kvrocks/issues/1170

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-kvrocks/issues) and found no similar issues.
   
   
   ### Version
   
   2.2.0
   
   ### Minimal reproduce step
   
   1. `echo 6 > /proc/sys/net/ipv4/tcp_syn_retries`
   2. `SLAVEOF` a non-routable IP address(such as `10.255.255.1`)
   3. `SLAVEOF new_mater_ip port`
   
   ### What did you expect to see?
   
   Step 3 should not block for a long time because we are switching to the new master, which should be a quick operation.
   
   ### What did you see instead?
   
   Step 3 will block a long time(**> 2min** based on above reproduced scenario)
   
   ### Anything Else?
   
   This is because we use blocking IO when use socket [connect(2)](https://man7.org/linux/man-pages/man2/connect.2.html). In some cases, `connect(2)` will be blocked for a long time.
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] caipengbo commented on issue #1170: SLAVEOF command may block a long time

Posted by GitBox <gi...@apache.org>.
caipengbo commented on issue #1170:
URL: https://github.com/apache/incubator-kvrocks/issues/1170#issuecomment-1342624662

   Let's set it a little longer than 3 seconds, so we can tolerate 2 times lost sync packages? @git-hulk 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #1170: SLAVEOF command may block a long time

Posted by GitBox <gi...@apache.org>.
git-hulk commented on issue #1170:
URL: https://github.com/apache/incubator-kvrocks/issues/1170#issuecomment-1342598616

   Cool, got it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #1170: SLAVEOF command may block a long time

Posted by GitBox <gi...@apache.org>.
git-hulk commented on issue #1170:
URL: https://github.com/apache/incubator-kvrocks/issues/1170#issuecomment-1342626360

   Yes, sounds good to me.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk closed issue #1170: SLAVEOF command may block a long time

Posted by GitBox <gi...@apache.org>.
git-hulk closed issue #1170: SLAVEOF command may block a long time
URL: https://github.com/apache/incubator-kvrocks/issues/1170


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] caipengbo commented on issue #1170: SLAVEOF command may block a long time

Posted by GitBox <gi...@apache.org>.
caipengbo commented on issue #1170:
URL: https://github.com/apache/incubator-kvrocks/issues/1170#issuecomment-1342597259

   > @caipengbo I think the root cause is we didn't set a timeout for the connect operation, so it will backoff retransmit the sync packet(1s,2s,4s,8s,16s,32s,64s) until reaching the tcp_syn_retries(default is 6 for most Linux distro). 
   
   Yes, we should add a timeout.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #1170: SLAVEOF command may block a long time

Posted by GitBox <gi...@apache.org>.
git-hulk commented on issue #1170:
URL: https://github.com/apache/incubator-kvrocks/issues/1170#issuecomment-1342591350

   @caipengbo I think the root cause is we didn't set a timeout for the connect operation, so it will backoff retransmit the sync packet(1s,2s,4s,8s,16s,32s,64s) until reaching the `tcp_syn_retries`(default is 6 for most Linux distro).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org