[
https://issues.apache.org/jira/browse/FLINK-30475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17650865#comment-17650865
]
David Hrbacek commented on FLINK-30475:
---------------------------------------
[~masteryhx] Thank you for linking the issue. Unfortunately I was unable to
find it before posting this issue and related pull request.
I am wondering wheter used clear method shlould not be matter of configuration
choice?
Because our use-case is to clear millions of entries when clear is called and
this results in very long (tens of minutes) clearing.
> Improved speed of RocksDBMapState clear() using rocksDB.deleteRange
> -------------------------------------------------------------------
>
> Key: FLINK-30475
> URL: https://issues.apache.org/jira/browse/FLINK-30475
> Project: Flink
> Issue Type: Improvement
> Components: Runtime / State Backends
> Affects Versions: 1.16.0
> Reporter: David Hrbacek
> Priority: Major
> Labels: pull-request-available
>
> Currently {{RocksDBMapState#clear()}} is processed via keyRange traversing
> and inserting particular keys into BatchWrite for deletion.
> RocksDb offer much faster way how to delete key range - {{deleteRange}}
> This issue is follow-up for
> [FLINK-9070|https://issues.apache.org/jira/browse/FLINK-9070] where
> {{deleteRange}} was also considered. But at that time it implied slower read,
> it was buggy and not even available in the Java API of RocksDB. All of these
> problems were solved since that time (see also RocksDB [blog article for
> deleteRange|https://rocksdb.org/blog/2018/11/21/delete-range.html])
> Delete range enables to clear {{RocksDBMapState}} for one key in constant
> computational complexity whereas the old solution requires O(n ).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)