Repository navigation
osd: add cls_cxx_map_remove_range() - #15183
Conversation
ebf4bf6 to
0461cc9
Compare
There was a problem hiding this comment.
@cbodley Extra spaces to be removed.
|
@jdurgin ping? |
|
rebased. |
|
rebased after #18610 merged, unit tests passing again |
|
hi @jdurgin, i would love your feedback on this when you have the time. log trimming isn't a bottleneck for rgw, but it's currently way more expensive for the osd than it should be @mattbenjamin mentioned that there had been some issues with range drops in rocksdb that might be relevant to this. if it's still a concern, could you (or @aclamk / @rzarzynski) expand on that? |
|
@jdurgin @neha-ojha ping? |
|
needs rebase |
|
rebased and updated OMAPRMKEYRANGE to the next available value 43 |
There was a problem hiding this comment.
the only thing that worries me about this is the lack of bound on number of entries to be removed in a single transaction. does rocksdb implement this in a way that is constant time, inserting implicit tombstones across the whole range, or is it still linear in the number of keys in the range?
There was a problem hiding this comment.
good question! this was based on the naive assumption that the database would do this more efficiently in bulk than as separate keys/ranges. now that i look more closely at RocksDBStore::RocksDBTransactionImpl::rm_range_keys(), i see that by default (rocksdb_enable_rmrange=false) it will issue a separate rocksdb::WriteBatch::Delete() call for each key. the DeleteRange() path with rocksdb_enable_rmrange=true looks promising, but there appear to be performance issues related to its range tombstones (see meta/rocksdb#3959). i see that @yuyuyu101 was involved in this part of RocksDBStore, maybe you can offer some insight here?
regardless, i'm happy to rework this in a way that's closer to the current strategy, where it lists keys first in order to limit the range we pass to cls_cxx_map_remove_range(), then loops until ENODATA in the client - that would still be a huge improvement over the separate calls to cls_cxx_map_remove_key()
There was a problem hiding this comment.
apparently rocksdb_enable_rmrange is still experimental, though there may be more work on it coming soon (a couple folks attended a rocksdb meetup yesterday and asked the developers about it). So it sounds like we should keep it off for now.
Reworking this to list and then remove_range() like you suggest sounds good.
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
|
@cbodley any update on this? |
Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
uses cls_cxx_map_get_keys() instead of cls_cxx_map_get_vals() to limit the number of keys removed Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
removes the config options rocksdb_enable_rmrange and rocksdb_max_items_rmrange that avoid calls to DeleteRange() Signed-off-by: Casey Bodley <[email protected]>
|
i updated cls_log_trim() and cls_rgw_bilog_trim() to list the range with max=1 in order to detect the ENODATA case. the test cases are passing again, both against the old and new implementations i decided not to introduce the new cls_log_trim2() interfaces for now, because we get most of the wins from rmrange itself; the client just has to send one extra osd op to see ENODATA, rather than the 1 + N/1000 requests needed before i also added a final commit to remove the config options around rmrange - i'm happy to split that into another pr if necessary |
|
this pass an rgw suite in http://pulpito.ceph.com/cbodley-2019-08-07_11:50:06-rgw-wip-19975-distro-basic-smithi/ should it run through rados? |
|
results from a very naive benchmark run against a debug-built vstart cluster with a single osd on nvme: |
|
thanks @liewegas and @tchaikov - this passed the rgw suite, does it need to run through rados? packages are available at https://shaman.ceph.com/builds/ceph/wip-19975/ if you're willing to schedule it for me |
|
@cbodley i think Sage has included this PR in his batch =) |
* refs/pull/15183/head: kv/rocksdb: support rmrange unconditionally cls/rgw: rgw_bi_log_trim() uses cls_cxx_map_remove_range() cls/log: cls_log_trim() uses cls_cxx_map_remove_range() test/cls: add cls_log.trim_by_marker test test/cls: test_cls_log doesn't allocate ObjectOperations test/cls: test_cls_log uses fixture for temporary pool test/cls: add cls_rgw.bi_log_trim test cls/rgw: expose cls_rgw_bilog_list/trim() for single shard test/cls: test_cls_rgw uses cls_rgw_obj_key test/cls: test_cls_rgw doesn't allocate ObjectOperations test/cls: test_cls_rgw uses fixture for temporary pool objclass: add cls_cxx_map_remove_range() librados: add rados_write_op_omap_rm_range2() osdc: add Objecter omap_rm_range() osd: add CEPH_OSD_OP_OMAPRMKEYRANGE to do_osd_ops() osd: add omap_rmkeyrange() to PGTransaction os: add bufferlist overload for omap_rmkeyrange() tracing: add do_osd_op_pre_omaprmkeyrange rados: add CEPH_OSD_OP_OMAPRMKEYRANGE Reviewed-by: Sage Weil <[email protected]>
|
thanks for the help with review and testing! |
|
nautilus backport #30949. |
this adds a new
CEPH_OSD_OP_OMAPRMKEYRANGEfor the ObjectStore'sOP_OMAP_RMKEYRANGE, and exposes it in the cls api ascls_cxx_map_remove_range()and the librados api asrados_write_op_omap_rm_range()andObjectWriteOperation::omap_rm_range()this is used by cls trim operations to avoid sending separate osd ops for each key with
cls_cxx_map_remove_key()Fixes: http://tracker.ceph.com/issues/19975