在Cassandra node.js驱动程序中使用中等大小的fetchSize时出现帧流错误

时间:2016-09-15 12:53:58

标签: node.js cassandra cassandra-3.0 cassandra-node-driver

我对Cassandra node.js驱动程序有一个奇怪的问题。当我尝试从某些分区中选择数据时,我收到此错误。

Error: There was an problem while parsing streaming frame, opcode 8
    at DriverInternalError.DriverError (C:\Temp\cassandra_test\node_modules\cassandra-driver\lib\errors.js:14:19)
    at new DriverInternalError (C:\Temp\cassandra_test\node_modules\cassandra-driver\lib\errors.js:68:30)
    at Parser._transform (C:\Temp\cassandra_test\node_modules\cassandra-driver\lib\streams.js:149:16)
    at Parser.Transform._read (_stream_transform.js:167:10)
    at Parser.Transform._write (_stream_transform.js:155:12)
    at doWrite (_stream_writable.js:307:12)
    at writeOrBuffer (_stream_writable.js:293:5)
    at Parser.Writable.write (_stream_writable.js:220:11)
    at Protocol.ondata (_stream_readable.js:556:20)
    at emitOne (events.js:96:13)
name: 'DriverInternalError',
stack: 'Error: There was an problem while parsing streaming frame, opcode 8\n    at DriverInternalError.DriverError (C:\\Temp\\cassandra_test\\node_modules\\cassandra-driver\\lib\\errors.js:14:19)\n    at new DriverInternalError (C:\\Temp\\cassandra_test\\node_modules\\cassandra-driver\\lib\\errors.js:68:30)\n    at Parser._transform (C:\\Temp\\cassandra_test\\node_modules\\cassandra-driver\\lib\\streams.js:149:16)\n    at Parser.Transform._read (_stream_transform.js:167:10)\n    at Parser.Transform._write (_stream_transform.js:155:12)\n    at doWrite (_stream_writable.js:307:12)\n    at writeOrBuffer (_stream_writable.js:293:5)\n    at Parser.Writable.write (_stream_writable.js:220:11)\n    at Protocol.ondata (_stream_readable.js:556:20)\n    at emitOne (events.js:96:13)',
message: 'There was an problem while parsing streaming frame, opcode 8',
info: 'Represents a bug inside the driver or in a Cassandra host.',

这里有一些非常奇怪的行为。

  • fetchSize s不会发生这种情况。例如,我可以使用312或更高的提取大小来确保错误输出,但每次使用的提取大小为311。
  • 仅适用于某些分区键。到目前为止,它似乎正在影响最近添加的密钥。
  • 在单个表格中,fetchSize的断点是一致的。例如,我可以运行SELECT * FROM TableX WHERE myKey = value1SELECT * FROM TableX WHERE myKey = value2,并且两者都会在fetchSize的240开始出错。但对于TableY,限制可能是284。

我真的很茫然。我怀疑它与从单个分区返回太多行有关,但是我能够从其他分区获得大量数据(例如,在大多数分区上,20000的fetchSize工作正常。)

重现问题的一小段代码是

var cassandra = require('cassandra-driver')
var client = new cassandra.Client({ contactPoints: ['node1', 'node2', 'node3'], keyspace: 'ks' });
var query = 'SELECT * FROM TableX WHERE myKey = :value';
client.eachRow(query, { value: 'someValue' }, { prepare: true, fetchSize: 500 }, function(n, row) {
    console.log(row);
}, function(err) {
    console.log(err)
});

1 个答案:

答案 0 :(得分:1)

正如OP所讨论的,它看起来像驱动程序3.1.3版中的错误:

更多信息:https://datastax-oss.atlassian.net/browse/NODEJS-310

现已修复v3.1.4 of the driver