Bug #75043 Transporter::doSend() fails to update send buffers after a partly failed send
Submitted: 28 Nov 2014 10:40 Modified: 10 Dec 2014 18:18
Reporter: Ole John Aske Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:7.1.34 OS:Any
Assigned to: CPU Architecture:Any

[28 Nov 2014 10:40] Ole John Aske
Description:
The different Transporter::doSend() implementations (TCP, Loopback ++)
request an array of 'iovec' from fetch_send_iovec_data().
Upon completion of the send, they are expected to update 
the send buffers by consuming what were actually sent, by
calling iovec_data_sent(). The next call to 
fetch_send_iovec_data() will then exclude that part
of the buffered data already sent.

However, ::doSend() might do several attempts to
(the OS) for sending its data, possibly sending only a 
smaller chunk each time. If it fail after some data
had been sent, iovec_data_sent() is *not* called to
correctly consume the part of the message sent before
the failure.

Iff we then make another call to doSend(), possibly from
another thread which waited for the 'send rights', it will
include the part of the message already sent, in its own
sending. Iff this sending does not fail like the previous send,
the duplicated message part will look like garbage on the
destination node, and likely cause it to fail.

We have not seen a real crash where this could be identified
as the root cause. However, by code inspection we find that
the message buffer is not correctly maintained in the 
scenarios described above, and it should be fixed such
that the are consistent.

How to repeat:
Not succeeded to reproduce a real crash from this yet.
[10 Dec 2014 18:18] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

  Documented fix in the NDB 7.1.34, 7.2.19, and 7.3.8 changelogs, as follows:

    Transporter send buffers were not updated properly following a
    failed send.
  
  Closed.    

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html