[ 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 gapSize = ofDays(1); final Duration gracePeriod = ofMillis(2); assertEquals( gapSize.toMillis() + gracePeriod.toMillis(), SessionWindows.with(gapSize).grace(gracePeriod).maintainMs() ); } {code} The test should pass since the retention time of the changelog topic should be gap + grace. However, the test fails. 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 gapSize = ofDays(1); final Duration gracePeriod = ofMillis(2); assertEquals(gapSize.toMillis() + gracePeriod.toMillis(), SessionWindows.with(gapSize).grace(gracePeriod).maintainMs()); } {code} The test should pass since the retention time of the changelog topic should be gap + grace. However, the test fails. > 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 gapSize = ofDays(1); > final Duration gracePeriod = ofMillis(2); > assertEquals( > gapSize.toMillis() + gracePeriod.toMillis(), > SessionWindows.with(gapSize).grace(gracePeriod).maintainMs() > ); > } > {code} > The test should pass since the retention time of the changelog topic should > be gap + grace. However, the test fails. -- This message was sent by Atlassian Jira (v8.3.4#803005)