我对 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.',
这里有一些非常奇怪的行为。
- 较小的 s 不会发生这种情况
fetchSize
。例如,我可以始终使用 312 或更高的提取大小使其出错,但每次都使用 311 的提取大小。 - 它只发生在某些分区键上。到目前为止,它似乎正在影响最近添加的键。
- 在单个表中,for 的断点
fetchSize
是一致的。例如,我可以运行,SELECT * FROM TableX WHERE myKey = value1
或者两者都将在240SELECT * FROM TableX WHERE myKey = value2
时开始出错,比如说。fetchSize
但是对于TableY
,限制可能是 284。
我在这里真的有点不知所措。我怀疑这与从单个分区返回太多行有关,但我能够从其他分区获取大量数据(例如,fetchSize
20000 的 a 在大多数分区上都可以正常工作)。
重现该问题的简单代码是
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)
});