Hazelcast is a unified real-time data platform combining stream processing with a fast data store, allowing customers to act instantly on data-in-motion for real-time insights.
For every full scanned partition, the result set produced by the scan is sorted and trimmed if PagingPredicate is used (QueryResult#orderAndLimit), this is done by returning a sublist of the original result set list (SortingUtil#getSortedSubList).
This is fine for per-partition result sets, but if the result set is reused for a multi-partition scan, as in QueryRunner#runUsingPartitionScanSafely using CallerRunsPartitionScanExecutor, the insertions done to the result set's sublist are in fact going to the original underlying list (see java.util.SubList) which accumulates all the entries from all scanned partitions and this causes OOMEs.
For every full scanned partition, the result set produced by the scan is sorted and trimmed if
PagingPredicate
is used (QueryResult#orderAndLimit
), this is done by returning a sublist of the original result set list (SortingUtil#getSortedSubList
).This is fine for per-partition result sets, but if the result set is reused for a multi-partition scan, as in
QueryRunner#runUsingPartitionScanSafely
usingCallerRunsPartitionScanExecutor
, the insertions done to the result set's sublist are in fact going to the original underlying list (seejava.util.SubList
) which accumulates all the entries from all scanned partitions and this causes OOMEs.