How to get records whose ttl is -1


#1

hello

how to fetch records whose ttl is -1 , please provide solution.

Thanks


#2

You would need to perform a scan. If you have server v 3.12+ this can be accomplished using predicate filters http://www.aerospike.com/docs/guide/predicate.html otherwise you would need to get the ttl of every record that is passed back to you, and parse it in your client. Another alternative, is to use UDF.

How many records do you need to scan for?


#3

I have 3.13 server, and 500K data


#4

Okay, but what do you plan to do? Do you want to remove the records with the 0 void time? Do you want to reset their TTL to a specific amount of time?


#5

Yes i want to reset their TTL to a specific amount of time.


#6

Code sample given in your same question in stackoverflow.


#7

@rbotzer are you sure th “dirty bin” is required? I’m doing a udf scan but I don’t think bin Val change was required… now I’m worried haha


#8

The aerospike:update function skips the update if a bin assignment didn’t happen. I have an open JIRA for considering a metadata assignment the same way.

I’m quite sure it’s still an issue.

Ronen