danzhewuju opened a new issue, #11293:
URL: https://github.com/apache/paimon/issues/11293

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   
   ### Paimon version
   
   2.2-SNAPSHOT
   
   ### Compute Engine
   
   Flink 2.2 OR Spark 3.5
   
   ### Minimal reproduce step
   
   Run the statements in order so the insert commits a snapshot before either 
tag is created.
   ```sql
   USE paimon.default;
   -- Set the default retention once at the table level.
   CREATE TABLE tag_retention_demo (id INT)
   USING PAIMON
   TBLPROPERTIES ('tag.default-time-retained' = '1d');
   -- Commit a snapshot that both tags can reference.
   INSERT INTO tag_retention_demo VALUES (1);
   -- Omit time_retained so the tag should inherit the table default.
   CALL paimon.sys.create_tag(
       table => 'default.tag_retention_demo',
       tag => 'daily'
   );
   -- Create a second tag on the same snapshot with an explicit duration.
   CALL paimon.sys.create_tag(
       table => 'default.tag_retention_demo',
       tag => 'explicit-retention',
       time_retained => '1h'
   );
   -- Compare the retention values stored for the two tags.
   SELECT tag_name, time_retained
   FROM `tag_retention_demo$tags`
   WHERE tag_name IN ('daily', 'explicit-retention');
   ```
   The `$tags` system table exposes the stored duration immediately. On the 
affected revision, the Spark source path indicates that `daily` will have 
`NULL` retention and `explicit-retention` will have a one-hour duration.
   
   
   ### What doesn't meet your expectations?
   
   **Expected.** The `daily` tag inherits the table's one-day retention period 
when `time_retained` is omitted.
   **Actual.** The tag is created with `time_retained = NULL`. Time-based 
expiration skips it, so a daily tagging job can keep historical snapshots past 
the configured retention period.
   
   ### Anything else?
   
   In production, operators typically configure tag retention once per table 
using `tag.default-time-retained`. Scheduled SQL jobs then call `create_tag` 
without repeating `time_retained` in every statement. With this bug, every tag 
created that way has no retention period, so regular TTL cleanup skips it. Over 
time, a large number of tags can accumulate and keep historical snapshots and 
their data files past the intended retention window.
   
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to