waterWang opened a new pull request, #39795: URL: https://github.com/apache/beam/pull/39795
Fix `FlinkOrderedListState` data loss when multiple elements with the same timestamp are added to an `OrderedListState`. **Root cause:** The `readAsMap()` method builds a `TreeMap<Instant, TimestampedValue<T>>` keyed by the element's timestamp. When a timestamp is shared by multiple elements, `Map.put()` silently overwrites the previous entry, destroying data. **Fix:** Change the internal structure to `SortedMap<Instant, List<TimestampedValue<T>>>`, using `computeIfAbsent` to append same-timestamp elements to a list instead of overwriting. All callers (`read()`, `readRange()`, `clearRange()`) are updated to flatten the list via `Iterables.concat()`. Fixes #39782 -- 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]
