# Maintain TTL value on record update or add fixed-timestamp expiration (3.10.0)

**URL:** <https://discuss.aerospike.com/t/maintain-ttl-value-on-record-update-or-add-fixed-timestamp-expiration-3-10-0/1285>\
**Category:** Delivered Requests\
**Created:** [May 17, 2015, 6:22am UTC](https://discuss.aerospike.com/t/maintain-ttl-value-on-record-update-or-add-fixed-timestamp-expiration-3-10-0/1285 "2015-05-17T06:22:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manigandham](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/manigandham/32/58_2.png) [@manigandham](https://discuss.aerospike.com/u/manigandham)\
**Post date:** [May 17, 2015, 6:22am UTC](https://discuss.aerospike.com/t/maintain-ttl-value-on-record-update-or-add-fixed-timestamp-expiration-3-10-0/1285/1 "2015-05-17T06:22:34Z")

</div>

Currently the TTLs of a record are based on expiration following a certain timespan after the last update.

The 1 second granularity of TTLs can lead to a race condition where a record will never expire when undergoing lots of writes. It would be helpful to either have a way to set expiration based on an actual timestamp or an option to mark writes as not resetting the existing TTL value.

---

<div class="post-metadata">

**Author:** ![wchu](https://avatars.discourse-cdn.com/v4/letter/w/a5b964/32.png) [@wchu](https://discuss.aerospike.com/u/wchu)\
**Post date:** [May 18, 2015, 5:47am UTC](https://discuss.aerospike.com/t/maintain-ttl-value-on-record-update-or-add-fixed-timestamp-expiration-3-10-0/1285/2 "2015-05-18T05:47:02Z")

</div>

The option we’ve thought about is an additional option where TTL is not touched. Will keep note of this. Thanks.

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [March 24, 2017, 4:12am UTC](https://discuss.aerospike.com/t/maintain-ttl-value-on-record-update-or-add-fixed-timestamp-expiration-3-10-0/1285/3 "2017-03-24T04:12:14Z")

</div>

Ver 3.10.1 introduced TTL = -2, update record without resetting TTL.

---

<div class="post-metadata">

**Author:** ![vijay\_kansal](https://avatars.discourse-cdn.com/v4/letter/v/9e8a1a/32.png) [@vijay\_kansal](https://discuss.aerospike.com/u/vijay_kansal)\
**Post date:** [December 8, 2017, 5:47pm UTC](https://discuss.aerospike.com/t/maintain-ttl-value-on-record-update-or-add-fixed-timestamp-expiration-3-10-0/1285/4 "2017-12-08T17:47:31Z")

</div>

How can we do an update operation without resetting ttl in versions \< 3.10.1 ?

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [December 8, 2017, 6:05pm UTC](https://discuss.aerospike.com/t/maintain-ttl-value-on-record-update-or-add-fixed-timestamp-expiration-3-10-0/1285/5 "2017-12-08T18:05:19Z")

</div>

> [@vijay\_kansal](#):
>
> How can we do an update operation without resetting ttl in versions \< 3.10.1 ?

It wasn’t a feature prior to it becoming a feature.

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [December 9, 2017, 5:40pm UTC](https://discuss.aerospike.com/t/maintain-ttl-value-on-record-update-or-add-fixed-timestamp-expiration-3-10-0/1285/6 "2017-12-09T17:40:23Z")

</div>

On further reflection on your question, you could do this by reading the record ttl and generation first, then update it with the needed bin updates, using the remaining TTL as the record TTL and EXPECT\_GEN\_EQUAL write policy.

However, what is your use case for updating a record while not refreshing its TTL? For example, if you have only 1 second life left on the record, why would you update the record without refreshing its TTL? Could you kindly share your use case?

---

<div class="post-metadata">

**Author:** ![manigandham](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/manigandham/32/58_2.png) [@manigandham](https://discuss.aerospike.com/u/manigandham)\
**Post date:** [February 20, 2020, 6:25pm UTC](https://discuss.aerospike.com/t/maintain-ttl-value-on-record-update-or-add-fixed-timestamp-expiration-3-10-0/1285/7 "2020-02-20T18:25:35Z")

</div>

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