*
* @param omap_root_t &omap_root, omap btree root information
* @param Transaction &t, current transaction
- * @param string &first, range start, must alive during the call
- * @param string &last, range end, must alive during the call
+ * @param string &first, range start
+ * @param string &last, range end
*/
using omap_rm_key_range_iertr = base_iertr;
using omap_rm_key_range_ret = omap_rm_key_range_iertr::future<>;
LOG_PREFIX(BtreeOMapManager::omap_rm_key_range);
DEBUGT("{} ~ {}", t, first, last);
assert(first <= last);
- return omap_list(
- omap_root,
- t,
- first,
- last,
- config
- ).si_then([this, &omap_root, &t](auto results) {
+ return seastar::do_with(
+ std::make_optional<std::string>(first),
+ std::make_optional<std::string>(last),
+ [this, &omap_root, &t, config](auto &first, auto &last) {
+ return omap_list(
+ omap_root,
+ t,
+ first,
+ last,
+ config);
+ }).si_then([this, &omap_root, &t](auto results) {
LOG_PREFIX(BtreeOMapManager::omap_rm_key_range);
auto &[complete, kvs] = results;
std::vector<std::string> keys;