Closed bmuddha closed 1 year ago
Could you set the server's "exp" logging context to detail and run the test again. The server will print a couple new logs, one of which will provide a hex dump of what the client sent the server.
Feb 22 2022 16:08:34 GMT: DEBUG (exp): (exp.c:776) as_exp_filter_build - msg_field_sz 20 msg-dump
000000: 93 01 93 51 02 a4 6f 69 64 78 ce 04 8b 26 40 39 ...Q..oidx...&@9
000010: 97 69 ca .i.
Feb 22 2022 16:08:34 GMT: WARNING (exp): (exp.c:1282) build_count_sz - invalid op_code 105 size 0
Feb 22 2022 16:08:34 GMT: WARNING (scan): (scan.c:706) basic scan job failed filter processing
Well, it's kinda hard to make sense of it, but here's an extra log entry with hex dump
The msgpack breakdown:
93
01 // (1)eq
93
51 // (81)bin
02
a4 6f 69 64 78 // string “oidx”
ce 04 8b 26 40 // uint32
39 // start of extra stuff (not allowed)
97
69 // 105, an invalid op code
ca
The wire instruction is a lisp like msgpack, where OPs are encoded as msgpack lists. You can see the first byte says it's a list of 3 elements (0x93). There's the EQ op, which has 2 parameters, the first of which is the BIN op which has 2 parameters (int type, string name). The 2nd parameter of EQ is an integer, and 0xCE means a uint32
https://github.com/msgpack/msgpack/blob/master/spec.md
That should be the end of the instruction as all parameters have been specified, but we have 4 extra bytes which is confusing the sizer on the server. At this point the server is trying to figure out how much memory the compiled code will take up and it ran into OP code 105 in the "extra" part.
Perhaps the uint32 was meant to be a uint64? In which case, it should be 0xCF.
You are probably right. Look at that: https://github.com/aerospike/aerospike-client-rust/blob/master/src/msgpack/encoder.rs#L344
Fixed in v1.3.0
Hello, I've been fighting with this issue for some time now, and cannot seem to understand what's the root of the problem. Let's imagine we have the following code:
Nothing fancy, though a little lengthy, so the issue arises when one tries to query this set using filter
expressions:eq
filters onoidx
bin, which storesValue::Int
, library just reports that there was aParameter error
while on server one can observe a warningWhat makes this issue interesting, is that it only happens with large positive numbers, yes, with negatives it doesn't happen, no matter how large the number is (e.g. hash of
Sysvar1111111111111111111111111111111111111
), also it doesn't happen with small numbers (not sure what the range is, but it's probably pretty large). I would've thought that this might be a server issue (aerospike works this way may be), but if you make this query via aqlThen everything works out fine. Additionally if one were to use
Statement::add_filter
to add the same filter, then it works with any valid i64 values, without causingParameter error
issue.I'll try to provide any additional context if necessary, thanks.