Support Article
Records not deleted after specified time on setting TTL for DDS
Summary
On setting the Time To Live (TTL) for a Decision DataSet (DDS) from the Specify Time to Live, records are not deleted after the specified time. This occurs for the offerPrecomputes dataset.
Error Messages
Not Applicable
Steps to Reproduce
- Execute a Strategy in a data flow. The Strategy results are sent to a DDS.
- Use a Dynamic System Setting (DSS) to set the Specify Time to Live (30 days).
Root Cause
A software use or operation error.
The TimeToLive (TTL) set from the application was 120 days instead of 30 days. The TTL for the records (not deleted) was still active. Hence, the records were not eligible for removal from the Cassandra table.
Resolution
Here’s the explanation for the reported behavior:
Use the below approach to identify the actual TTL value set for a record when it is inserted in to the C* table by the Pega application
- CQLSH Query to fetch the "TTL" remaining in seconds for a record
Query Syntax: select ttl(data_), [key_column] from <keyspace>.<table> where [use only the exposed columns] limit 10 ALLOW FILTERING;
TTL remaining time in days: tl(data_) / 86400 = x days - CQLSH Query to fetch the WRITETIME (in microseconds) of a record into C* table
Query Syntax: SELECT WRITETIME(data_) from <keyspace>.<table> where [use only the exposed columns];
- Convert the WRITETIME result into the Actual Date and Time
Convert the query result from microseconds to milliseconds before converting the result to the Actual Date and Time.
TTL elapsed time in days: Use the Days calculator to identify the Days Between Two Dates
Ensure to use the 'End Date' as the date when the 'CQLSH Query 1' above is run
- Actual TTL value set from the application
Actual TTL Value in days = "TTL remaining time in days" + "TTL elapsed time in days" = XY days which is the actual TTL value set for this record when it is inserted to the C* table from the Pega application.
Published July 11, 2020 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.