Viraj Jasani created PHOENIX-7584:
-------------------------------------
Summary: Conditional TTL on SYSTEM.CDC_STREAM
Key: PHOENIX-7584
URL: https://issues.apache.org/jira/browse/PHOENIX-7584
Project: Phoenix
Issue Type: Improvement
Reporter: Viraj Jasani
SYSTEM.CDC_STREAM consists of partition (region) records and maintains lineage
using split or merge of the regions.
After configurable duration, the records from SYSTEM.CDC_STREAM table should be
removed as the client is expected to read the change stream for specific time
duration. For instance, if the client keeps maxLookback of the base table as 24
hr, the TTL for the CDC Index is expected to be 24 hr. Therefore, once a region
closes due to split or merge, updating SYSTEM.CDC_STREAM record with non-null
PARTITION_END_TIME value, we should purge the partition record from
SYSTEM.CDC_STREAM after 24 hr.
For this purpose, we should define Conditional TTL on SYSTEM.CDC_STREAM as:
{code:java}
TTL = PARTITION_END_TIME IS NOT NULL AND CURRENT_TIME() >=
(PHOENIX_ROW_TIMESTAMP() + (24 * 60 * 60 * 1000)){code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)