To me it seams that the patch in
THRIFT-837 breaks TFramedTransport. For example the recv_ methods end up getting this exception:
PHP Fatal error: Uncaught exception 'TException' with message 'TSocket: Could not read 4 bytes from 10.50.26.132:9160' in /mnt/hgfs/NFS/code/vendors/thrift/transport/TSocket.php:231
#0 /mnt/hgfs/NFS/code/vendors/thrift/transport/TFramedTransport.php(135): TSocket->readAll(4)
#1 /mnt/hgfs/NFS/code/vendors/thrift/transport/TFramedTransport.php(102): TFramedTransport->readFrame()
#2 [internal function]: TFramedTransport->read(8192)
#3 /mnt/hgfs/NFS/code/vendors/thrift/packages/cassandra/Cassandra.php(752): thrift_protocol_read_binary(Object(TBinaryProtocolAccelerated), 'cassandra_Cassa...', false)
#4 /mnt/hgfs/NFS/code/vendors/thrift/packages/cassandra/Cassandra.php(727): CassandraClient->recv_batch_mutate()
#5 /mnt/hgfs/NFS/code/private/classes/cassandra/base.php(334): CassandraClient->batch_mutate(Array, 1)
#6 /mnt/hgfs/NFS/code/private/classes/cassandra/columnfamily.php(54): Cassandra->batchMutate('agoudarzi_Keysp...', Array, NULL)
THRIFT-837.t(17) in /mnt/hgfs/NFS/code/vendors/thrift/transport/TSocket.php on line 231
Not using the accelerated version works just fine. I agree that prior to this patch users will get TSocket timeout errors for inserts larger than 8k (thrift_protocol's default buffer size) but applying
THRIFT-837 patch breaks communication in TFramedTransport.
I have investigated this and I got the following suspicious points:
1. thrift_protocol does a flush before direct write. Seams OK to flush and them direct write the rest of the data but I am not sure how the Thrift interface on the server side will treat the incomplete flushed buffer in FramedTransport. I say this because I compared the stream_metadata of TProtocol with TProtocolAccelerated and it clearly looks there is an extra flush of data before the large data gets written and flushed.
2. Secondly, I wrote the data once using TProtocol and confirmed on the server side successfully, switched to Accelerated mode and tried to only read. I got exception coming out of thrift_protocol saying TType -114 is not value. I know this is an invalid type but I don't know how it got it.
THRIFT-837 should be re-opened until fix is workable across different versions of Transport. I will comment more if I find something interesting.