Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-10267

[State] Fix arbitrary iterator access on RocksDBMapIterator

    XMLWordPrintableJSON

Details

    Description

      Currently, RocksDBMapIterator would load 128 entries into local cacheEntries every time if needed. Both RocksDBMapIterator#next() and RocksDBMapIterator#hasNext() action might trigger to load RocksDBEntry into cacheEntries.

      However, if the iterator's size larger than 128 and we continue to access the iterator with following order: hasNext() -> next() -> hasNext() -> remove(), we would meet weird exception when we try to remove the 128th element:

      java.lang.IllegalStateException: The remove operation must be called after a valid next operation.
      

      Since we could not control user's access on iterator, we should fix this bug to avoid unexpected exception.

      Attachments

        Issue Links

          Activity

            People

              yunta Yun Tang
              yunta Yun Tang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: