Query by range does not return all data

Hi Pratyyy,

regarding your questions:

  1. No, only when using BETWEEN.

  2. We have inserted the keys through aerospike_put (by using the C client library)

  3. The operations we typically do (apart from the initial bulk insert of the records using aerospike_key_put) are:

  4. we run a query that selects on as_integer_equals(0) for the in_use field (w/ corresponding index). The callback for this query selects the string value in the key bin and returns it to the caller through the user data parameter and returns false to stop the query

  5. after the foreach-query returns, we do an aerospike_key_get using the returned key to select that record.

  6. next, we re-write that record with the in_use field set to (integer) 1 and with a AS_POLICY_GEN_EQ to ensure the record wasn’t modified in between

  7. if the latter operation fails, we retry the whole procedure (up to a certain defined maximum)

Additionally, we have an operation to empty a set (having an API call for this would be highly appreciated, by the way!) that works by iterating over all the records in a set and, in its callback, will re-write that record with a TTL of 1 (we had a tombstoning bug with this previously) and subsequently calls aerospike_key_remove. We have been using this code for quite a while and have verified that it indeed removes the records. It might be that this operation has been called once (or more) on the mentioned set.