[ 
https://issues.apache.org/jira/browse/KAFKA-13094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bruno Cadonna updated KAFKA-13094:
----------------------------------
    Description: 
Session windows use internally method {{maintainMs()}} to compute the retention 
time for their changelog topic if users do not provide a retention time 
explicitly with {{Materilaized}}. However, {{maintainMs()}} does not consider 
user-specified grace period when computing the retention time.

The bug can be verified with the following test method:
{code:java}
    @Test
    public void 
shouldUseGapAndGraceAsRetentionTimeIfBothCombinedAreLargerThanDefaultRetentionTime()
 {
        final Duration windowsSize = ofDays(1).minus(ofMillis(1));
        final Duration gracePeriod = ofMillis(2);
        assertEquals(windowsSize.toMillis() + gracePeriod.toMillis(), 
SessionWindows.with(windowsSize).grace(gracePeriod).maintainMs());
    }
{code}   

The 

  was:
Session windows use internally method {{maintainMs()}} to compute the retention 
time for their changelog topic if users do not provide a retention time 
explicitly with {{Materilaized}}. However, {{maintainMs()}} does not consider 
user-specified grace period when computing the retention time.

The bug can be verified with the following test method:
{code:java}
    @Test
    public void 
shouldUseGapAndGraceAsRetentionTimeIfBothCombinedAreLargerThanDefaultRetentionTime()
 {
        final Duration windowsSize = ofDays(1).minus(ofMillis(1));
        final Duration gracePeriod = ofMillis(2);
        assertEquals(windowsSize.toMillis() + gracePeriod.toMillis(), 
SessionWindows.with(windowsSize).grace(gracePeriod).maintainMs());
    }
{code}   


> Session windows do not consider user-specified grace when computing retention 
> time for changelog
> ------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-13094
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13094
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 2.8.0
>            Reporter: Bruno Cadonna
>            Priority: Major
>
> Session windows use internally method {{maintainMs()}} to compute the 
> retention time for their changelog topic if users do not provide a retention 
> time explicitly with {{Materilaized}}. However, {{maintainMs()}} does not 
> consider user-specified grace period when computing the retention time.
> The bug can be verified with the following test method:
> {code:java}
>     @Test
>     public void 
> shouldUseGapAndGraceAsRetentionTimeIfBothCombinedAreLargerThanDefaultRetentionTime()
>  {
>         final Duration windowsSize = ofDays(1).minus(ofMillis(1));
>         final Duration gracePeriod = ofMillis(2);
>         assertEquals(windowsSize.toMillis() + gracePeriod.toMillis(), 
> SessionWindows.with(windowsSize).grace(gracePeriod).maintainMs());
>     }
> {code}   
> The 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to