Support WritePolicy.EXPECT_GEN_LT (less than) (AER-6101)

One could use WritePolicy to only write to an record n amount of times if it was possible to define EXPECT_GEN_LT (less than), without needing to invoke an UDF or an additional up front read.

Would it be possible to support this with future server versions?

A feature that is currently planned for this year is expanding the predicate filter functionality to other aerospike operations like get/put which would enable this functionality not only on generation but also on a counter within a record or other in-memory record metadata such as ‘last-update-time’. A bin counter would have the advantage of changing as a developer would expect but would be at a performance disadvantage since it would require a storage access and a slight space disadvantage since it would require space for the counter in storage.

Cons for using generation:

  1. The maximum value for a generation is 65535 in AP and 1023 in SC.
  2. If you recreate a record that had been previously durably deleted the generation continues from the previously deleted version (+1 for the durable delete change).
  3. The generation doesn’t necessarily change as the programmer may expect. Currently in AP the only exception is durable delete, but in SC there are scenarios where the server will increase the generation (such as re-replications). Typically these are rare.

Knowing these limitations/caveats, are you still be interested in using generation for this purpose.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.

Predicate expressions have been made available to all Aerospike requests as of Aerospike 4.7.0.2.

1 Like

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.