Hello,
I’m using aerospike community edition version 4.4.0.4, I have records that used as counters with TTL, when i’m updating the record i set the TTL to not be updated, when the record is expired I expected the record to act like a new record but instead I see the old values taken and increment.
My questions is:
Is expired records that gets increment operation takes old value?
Is it a bug?
I do not see in server code (write_master, as_record_get_create, as_index_get_insert_vlock functions) any consideration in TTL before update the record.
I do not see this behavior in version 3.14.0, I used UDF functions to increment record bin’s.
Could you also share a code snip that demonstrates how you are updating the record?
Specifically, I’m looking to see if this is a write through UDF or a regular write. Also the exact policies being used with the transaction.
Your config is a bit complex, it would be huge assist if could you please try finding the simplest configuration that you are able to reproduce this issue with.
I quickly scanned through write path in master, these expired/truncated records are referred to as ‘doomed’ in the source, the main write path checks this early and treats it as a new record when the existing is ‘doomed’.
I see you’ve updated the original post that you are using a UDF, possibly the UDF source failed to perform these checks.
If you are still able to reproduce this issue could you also provide the output of:
asadm -e 'info'
Also could you increase the amount you are sleeping between the operations? TTLs have resolution to the a second so adding a sub-second sleep would have non-deterministic results. See if you can reproduce this with a 15 second delay.
Thanks for your time, for some reason I also failed to reproduced it again locally, I will try to understand what change cause it, but the issue looks like something that I did wrong, I will let you know if I find it.
As I mentioned, expiration has a 1 second resolution, which means the record could take up to 16 seconds (from the time it arrived at the server) to expire. You were only sleeping 15.2 seconds so the result wouldn’t be deterministic. You would need to sleep for at least 16 seconds plus however long the transaction took rounded up to a second.