Yes, Todd. The client sends CHECKSUM_OK when it reads to the end of the data. The DN expects CHECKSUM_OK only when it sends the entire block.
It's my goal that either side can independently decide whether a CHECKSUM_OK is supposed to be present. (A good protocol should do that.) So I propose:
1. The client keeps its current behaviour, sending CHECKSUM_OK when it reads to the end of the data.
2. The DN, after sending all the data, always expects a CHECKSUM_OK. If it's not there, it will close the client connection.
3. Point #2 does not matter currently, since the DN always closes the client connection. But
HDFS-941 may change that.
I can't think of a good way to write a test for this. Any suggestions please?