ableegoldman commented on a change in pull request #9139: URL: https://github.com/apache/kafka/pull/9139#discussion_r500658560
########## File path: streams/src/main/java/org/apache/kafka/streams/state/internals/CachingSessionStore.java ########## @@ -270,25 +335,32 @@ public void close() { private CacheIteratorWrapper(final Bytes key, final long earliestSessionEndTime, - final long latestSessionStartTime) { - this(key, key, earliestSessionEndTime, latestSessionStartTime); + final long latestSessionStartTime, + final boolean forward) { + this(key, key, earliestSessionEndTime, latestSessionStartTime, forward); } private CacheIteratorWrapper(final Bytes keyFrom, final Bytes keyTo, final long earliestSessionEndTime, - final long latestSessionStartTime) { + final long latestSessionStartTime, + final boolean forward) { this.keyFrom = keyFrom; this.keyTo = keyTo; this.latestSessionStartTime = latestSessionStartTime; this.lastSegmentId = cacheFunction.segmentId(maxObservedTimestamp); this.segmentInterval = cacheFunction.getSegmentInterval(); + this.forward = forward; this.currentSegmentId = cacheFunction.segmentId(earliestSessionEndTime); Review comment: Ok I _think_ that for the reverse case, this should be initialized to `cacheFunction.segmentId(maxObservedTimestamp)` and `lastSegmentId` should be initialized to this (`segmentId(earliestSessionEndTime)`). ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org