0

I'm experiencing a strange mysql behaviour that occurs between two virtual machines.

When I have a query string longer than 1457 chars, the connection I'm using hangs.
I was thinking the problem was a query with a tons of result but then discovered that the query string is not important.

For example:

select * from users where uname = "abcdefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffpooooooooooppppppppfooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooffffffseroieeeeuuwwwwwwwwwwwuii";

hangs the server.

If i remove a single char from that string, mysql returns an empty recordset, as expected. There is not a such user and the field uname is varchar(64). The table, contains just one record.

I tried to monitor the socket and discovered that the querystring is retransmitted 20 times and then the traffic stops but the client does not exit and connection is not dropped/closed.cd

192.168.0.111:43012 -> 192.168.0.112:mysql
    ...
    bytes_sent:22614
    bytes_retrans:20260
    bytes_acked:329
    bytes_received:8208
    segs_out:28
    segs_in:10
    data_segs_out:18
    data_segs_in:8
    ...

The very same query made from a different instance to the same server, works flawlessy. I tried the official mysql terminal client, an alternative terminal client and a script but I got the same result.

5
  • File a bug report with a concrete example at bugs.mysql.com
    – Rick James
    Mar 3, 2022 at 20:21
  • This could be an issue with MTU setting on the network interfaces on the host. Might be that the query ends up in a too long TCP segment, which is then dropped by the kernel. Mar 5, 2022 at 11:32
  • Thanks for the suggestion @RickJames. It is difficult to file a bug report. The problem is limited to a single server vm when it interacts with a specific vm client. I replicated the two vms and the problem gone away. I Rebooted the two original vms and the problem persists. If just one of the two machines change, the problem will not occurs.
    – Eineki
    Mar 5, 2022 at 23:27
  • @Eineki - Thanks for trying. "client" -- mysql commandline client? Or something else?
    – Rick James
    Mar 6, 2022 at 1:46
  • Yes, @RickJames mysql command line client, mycli, an alternative commandline client written in python and a very simple php script (connect, send the query, retrieve the empty recordset and close connection) written on purpose. Same result. I'm starting to think of the mtu as #TeroKilkanen pointed out (the string lenght should have set that bell ringing).
    – Eineki
    Mar 7, 2022 at 13:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.