I am trying to update .put() into existing records in Aerospike using the python client.
I was excited to discover that you can actually put into existing records and not update the TTL as shown here (meta params): https://www.aerospike.com/apidocs/python/client.html?highlight=ttl#aerospike.Client.put. I used to do this by reading the TTL and then re-setting it on the new put.
However, I discovered that when you use the aerospike. TTL_DONT_UPDATE option, the TTL resets to the cold-start-evict-ttl that is set on the namespace. How do I avoid that and just maintain the previous TTL unchanged?
StackOverflow: Aerospike TTL updates - Stack Overflow
python client aerospike (2.2.3)
aerospike_config = {'hosts': [(<IP1>, 3000), (<IP2>, 3000)], 'policies': {'timeout': 4.0}}
aerospike_client = aerospike.client(aerospike_config)
aerospike_client.connect()
key = ("namespace", "set", "1234")
aerospike_client.get(key)
# (('namespace', 'set', None, bytearray(b'')), {'gen': 8, 'ttl': 7265085}, {<data>})
aerospike_client.put(key, {<data>}, meta={'ttl': aerospike.TTL_DONT_UPDATE})
aerospike_client.get(key)
# (('namespace', 'set', None, bytearray(b'')), {'gen': 9, 'ttl': 4037004360}, {<data>})
aerospike_client.put(key, {<data>}, meta={'ttl': 7265085})
aerospike_client.get(key)
# (('namespace', 'set', None, bytearray(b'')), {'gen': 10, 'ttl': 7265083}, {<data>})```
* List item