diff --git a/CMakeLists.txt b/CMakeLists.txt index e61a849f49..fd7ad63c39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ set(CMAKE_CXX_EXTENSIONS ON CACHE INTERNAL "") set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(Seastar_TESTING ON CACHE BOOL "" FORCE) -set(Seastar_API_LEVEL 6 CACHE STRING "" FORCE) +set(Seastar_API_LEVEL 7 CACHE STRING "" FORCE) add_subdirectory(seastar) # System libraries dependencies diff --git a/backlog_controller.hh b/backlog_controller.hh index 90e8f33aad..b601935c79 100644 --- a/backlog_controller.hh +++ b/backlog_controller.hh @@ -39,7 +39,6 @@ class backlog_controller { public: struct scheduling_group { seastar::scheduling_group cpu = default_scheduling_group(); - seastar::io_priority_class io = default_priority_class(); }; future<> shutdown() { _update_timer.cancel(); diff --git a/checked-file-impl.hh b/checked-file-impl.hh index a25128c5e3..4580ebbdb9 100644 --- a/checked-file-impl.hh +++ b/checked-file-impl.hh @@ -21,27 +21,27 @@ public: : file_impl(*get_file_impl(f)), _error_handler(error_handler), _file(f) { } - virtual future write_dma(uint64_t pos, const void* buffer, size_t len, const io_priority_class& pc) override { + virtual future write_dma(uint64_t pos, const void* buffer, size_t len, io_intent* intent) override { return do_io_check(_error_handler, [&] { - return get_file_impl(_file)->write_dma(pos, buffer, len, pc); + return get_file_impl(_file)->write_dma(pos, buffer, len, intent); }); } - virtual future write_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { + virtual future write_dma(uint64_t pos, std::vector iov, io_intent* intent) override { return do_io_check(_error_handler, [&] { - return get_file_impl(_file)->write_dma(pos, iov, pc); + return get_file_impl(_file)->write_dma(pos, iov, intent); }); } - virtual future read_dma(uint64_t pos, void* buffer, size_t len, const io_priority_class& pc) override { + virtual future read_dma(uint64_t pos, void* buffer, size_t len, io_intent* intent) override { return do_io_check(_error_handler, [&] { - return get_file_impl(_file)->read_dma(pos, buffer, len, pc); + return get_file_impl(_file)->read_dma(pos, buffer, len, intent); }); } - virtual future read_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { + virtual future read_dma(uint64_t pos, std::vector iov, io_intent* intent) override { return do_io_check(_error_handler, [&] { - return get_file_impl(_file)->read_dma(pos, iov, pc); + return get_file_impl(_file)->read_dma(pos, iov, intent); }); } @@ -99,9 +99,9 @@ public: }); } - virtual future> dma_read_bulk(uint64_t offset, size_t range_size, const io_priority_class& pc) override { + virtual future> dma_read_bulk(uint64_t offset, size_t range_size, io_intent* intent) override { return do_io_check(_error_handler, [&] { - return get_file_impl(_file)->dma_read_bulk(offset, range_size, pc); + return get_file_impl(_file)->dma_read_bulk(offset, range_size, intent); }); } private: diff --git a/compaction/compaction.cc b/compaction/compaction.cc index e03417e79b..f39c8182c9 100644 --- a/compaction/compaction.cc +++ b/compaction/compaction.cc @@ -37,7 +37,6 @@ #include "compaction_manager.hh" #include "schema/schema.hh" #include "db/system_keyspace.hh" -#include "service/priority_manager.hh" #include "db_clock.hh" #include "mutation/mutation_compactor.hh" #include "leveled_manifest.hh" @@ -472,7 +471,6 @@ protected: mutation_source_metadata _ms_metadata = {}; compaction_sstable_replacer_fn _replacer; run_id _run_identifier; - ::io_priority_class _io_priority; // optional clone of sstable set to be used for expiration purposes, so it will be set if expiration is enabled. std::optional _sstable_set; // used to incrementally calculate max purgeable timestamp, as we iterate through decorated keys. @@ -505,7 +503,6 @@ protected: , _can_split_large_partition(descriptor.can_split_large_partition) , _replacer(std::move(descriptor.replacer)) , _run_identifier(descriptor.run_identifier) - , _io_priority(descriptor.io_priority) , _sstable_set(std::move(descriptor.all_sstables_snapshot)) , _selector(_sstable_set ? _sstable_set->make_incremental_selector() : std::optional{}) , _compacting_for_max_purgeable_func(std::unordered_set(_sstables.begin(), _sstables.end())) @@ -584,12 +581,11 @@ protected: compaction_writer create_gc_compaction_writer() const { auto sst = _sstable_creator(this_shard_id()); - auto&& priority = _io_priority; auto monitor = std::make_unique(sst, _table_s, maximum_timestamp(), _sstable_level); sstable_writer_config cfg = _table_s.configure_writer("garbage_collection"); cfg.run_identifier = _run_identifier; cfg.monitor = monitor.get(); - auto writer = sst->get_writer(*schema(), partitions_per_sstable(), cfg, get_encoding_stats(), priority); + auto writer = sst->get_writer(*schema(), partitions_per_sstable(), cfg, get_encoding_stats()); return compaction_writer(std::move(monitor), std::move(writer), std::move(sst)); } @@ -1043,7 +1039,6 @@ public: _permit, query::full_partition_range, _schema->full_slice(), - _io_priority, tracing::trace_state_ptr(), ::streamed_mutation::forwarding::no, ::mutation_reader::forwarding::no, @@ -1063,7 +1058,7 @@ public: setup_new_sstable(sst); sstable_writer_config cfg = make_sstable_writer_config(compaction_type::Reshape); - return compaction_writer{sst->get_writer(*_schema, partitions_per_sstable(), cfg, get_encoding_stats(), _io_priority), sst}; + return compaction_writer{sst->get_writer(*_schema, partitions_per_sstable(), cfg, get_encoding_stats()), sst}; } virtual void stop_sstable_writer(compaction_writer* writer) override { @@ -1089,7 +1084,6 @@ public: _permit, query::full_partition_range, _schema->full_slice(), - _io_priority, tracing::trace_state_ptr(), ::streamed_mutation::forwarding::no, ::mutation_reader::forwarding::no, @@ -1111,7 +1105,7 @@ public: auto monitor = std::make_unique(sst, _table_s, maximum_timestamp(), _sstable_level); sstable_writer_config cfg = make_sstable_writer_config(_type); cfg.monitor = monitor.get(); - return compaction_writer{std::move(monitor), sst->get_writer(*_schema, partitions_per_sstable(), cfg, get_encoding_stats(), _io_priority), sst}; + return compaction_writer{std::move(monitor), sst->get_writer(*_schema, partitions_per_sstable(), cfg, get_encoding_stats()), sst}; } virtual void stop_sstable_writer(compaction_writer* writer) override { @@ -1478,7 +1472,7 @@ public: } flat_mutation_reader_v2 make_sstable_reader() const override { - auto crawling_reader = _compacting->make_crawling_reader(_schema, _permit, _io_priority, nullptr); + auto crawling_reader = _compacting->make_crawling_reader(_schema, _permit, nullptr); return make_flat_mutation_reader_v2(std::move(crawling_reader), _options.operation_mode, _validation_errors); } @@ -1497,7 +1491,7 @@ public: return end_consumer; } return [this, end_consumer = std::move(end_consumer)] (flat_mutation_reader_v2 reader) mutable -> future<> { - auto cfg = mutation_writer::segregate_config{_io_priority, memory::stats().total_memory() / 10}; + auto cfg = mutation_writer::segregate_config{memory::stats().total_memory() / 10}; return mutation_writer::segregate_by_partition(std::move(reader), cfg, [consumer = std::move(end_consumer), this] (flat_mutation_reader_v2 rd) { ++_bucket_count; @@ -1574,7 +1568,6 @@ public: _permit, query::full_partition_range, _schema->full_slice(), - _io_priority, nullptr, ::streamed_mutation::forwarding::no, ::mutation_reader::forwarding::no); @@ -1607,7 +1600,7 @@ public: auto cfg = make_sstable_writer_config(compaction_type::Reshard); // sstables generated for a given shard will share the same run identifier. cfg.run_identifier = _run_identifiers.at(shard); - return compaction_writer{sst->get_writer(*_schema, partitions_per_sstable(shard), cfg, get_encoding_stats(), _io_priority, shard), sst}; + return compaction_writer{sst->get_writer(*_schema, partitions_per_sstable(shard), cfg, get_encoding_stats(), shard), sst}; } void stop_sstable_writer(compaction_writer* writer) override { @@ -1687,7 +1680,7 @@ static future scrub_sstables_validate_mode(sstables::compacti for (const auto& sst : descriptor.sstables) { clogger.info("Scrubbing in validate mode {}", sst->get_filename()); - validation_errors += co_await sst->validate(permit, descriptor.io_priority, cdata.abort, [&schema] (sstring what) { + validation_errors += co_await sst->validate(permit, cdata.abort, [&schema] (sstring what) { scrub_compaction::report_validation_error(compaction_type::Scrub, *schema, what); }); // Did validation actually finish because aborted? diff --git a/compaction/compaction.hh b/compaction/compaction.hh index 9655f4138a..4db5442216 100644 --- a/compaction/compaction.hh +++ b/compaction/compaction.hh @@ -13,7 +13,6 @@ #include "compaction/compaction_descriptor.hh" #include "gc_clock.hh" #include "compaction_weight_registration.hh" -#include "service/priority_manager.hh" #include "utils/UUID.hh" #include "table_state.hh" #include diff --git a/compaction/compaction_descriptor.hh b/compaction/compaction_descriptor.hh index 449b581ce7..a51b2cf997 100644 --- a/compaction/compaction_descriptor.hh +++ b/compaction/compaction_descriptor.hh @@ -155,8 +155,6 @@ struct compaction_descriptor { compaction_sstable_creator_fn creator; compaction_sstable_replacer_fn replacer; - ::io_priority_class io_priority = default_priority_class(); - // Denotes if this compaction task is comprised solely of completely expired SSTables sstables::has_only_fully_expired has_only_fully_expired = has_only_fully_expired::no; @@ -166,7 +164,6 @@ struct compaction_descriptor { static constexpr uint64_t default_max_sstable_bytes = std::numeric_limits::max(); explicit compaction_descriptor(std::vector sstables, - ::io_priority_class io_priority, int level = default_level, uint64_t max_sstable_bytes = default_max_sstable_bytes, run_id run_identifier = run_id::create_random_id(), @@ -178,18 +175,15 @@ struct compaction_descriptor { , run_identifier(run_identifier) , options(options) , owned_ranges(std::move(owned_ranges_)) - , io_priority(io_priority) {} explicit compaction_descriptor(sstables::has_only_fully_expired has_only_fully_expired, - std::vector sstables, - ::io_priority_class io_priority) + std::vector sstables) : sstables(std::move(sstables)) , level(default_level) , max_sstable_bytes(default_max_sstable_bytes) , run_identifier(run_id::create_random_id()) , options(compaction_type_options::make_regular()) - , io_priority(io_priority) , has_only_fully_expired(has_only_fully_expired) {} diff --git a/compaction/compaction_manager.cc b/compaction/compaction_manager.cc index 3cbbad7ad7..fbfd5598cf 100644 --- a/compaction/compaction_manager.cc +++ b/compaction/compaction_manager.cc @@ -774,7 +774,7 @@ compaction_manager::~compaction_manager() { future<> compaction_manager::update_throughput(uint32_t value_mbs) { uint64_t bps = ((uint64_t)(value_mbs != 0 ? value_mbs : std::numeric_limits::max())) << 20; - return compaction_sg().io.update_bandwidth(bps).then_wrapped([value_mbs] (auto f) { + return compaction_sg().cpu.update_io_bandwidth(bps).then_wrapped([value_mbs] (auto f) { if (f.failed()) { cmlog.warn("Couldn't update compaction bandwidth: {}", f.get_exception()); } else if (value_mbs != 0) { @@ -1186,8 +1186,7 @@ private: }); auto get_next_job = [&] () -> std::optional { - auto& iop = service::get_local_streaming_priority(); // run reshape in maintenance mode - auto desc = t.get_compaction_strategy().get_reshaping_job(reshape_candidates, t.schema(), iop, sstables::reshape_mode::strict); + auto desc = t.get_compaction_strategy().get_reshaping_job(reshape_candidates, t.schema(), sstables::reshape_mode::strict); return desc.sstables.size() ? std::make_optional(std::move(desc)) : std::nullopt; }; @@ -1341,7 +1340,7 @@ private: auto sstable_level = sst->get_sstable_level(); auto run_identifier = sst->run_identifier(); // FIXME: this compaction should run with maintenance priority. - auto descriptor = sstables::compaction_descriptor({ sst }, service::get_local_compaction_priority(), + auto descriptor = sstables::compaction_descriptor({ sst }, sstable_level, sstables::compaction_descriptor::default_max_sstable_bytes, run_identifier, _options, _owned_ranges_ptr); // Releases reference to cleaned sstable such that respective used disk space can be freed. @@ -1439,7 +1438,6 @@ private: try { auto desc = sstables::compaction_descriptor( { sst }, - _cm.maintenance_sg().io, sst->get_sstable_level(), sstables::compaction_descriptor::default_max_sstable_bytes, sst->run_identifier(), diff --git a/compaction/compaction_strategy.cc b/compaction/compaction_strategy.cc index bcefa2549a..9be7910184 100644 --- a/compaction/compaction_strategy.cc +++ b/compaction/compaction_strategy.cc @@ -39,14 +39,14 @@ namespace sstables { compaction_descriptor compaction_strategy_impl::make_major_compaction_job(std::vector candidates, int level, uint64_t max_sstable_bytes) { // run major compaction in maintenance priority - return compaction_descriptor(std::move(candidates), service::get_local_streaming_priority(), level, max_sstable_bytes); + return compaction_descriptor(std::move(candidates), level, max_sstable_bytes); } std::vector compaction_strategy_impl::get_cleanup_compaction_jobs(table_state& table_s, std::vector candidates) const { // The default implementation is suboptimal and causes the writeamp problem described issue in #10097. // The compaction strategy relying on it should strive to implement its own method, to make cleanup bucket aware. return boost::copy_range>(candidates | boost::adaptors::transformed([] (const shared_sstable& sst) { - return compaction_descriptor({ sst }, service::get_local_compaction_priority(), + return compaction_descriptor({ sst }, sst->get_sstable_level(), sstables::compaction_descriptor::default_max_sstable_bytes, sst->run_identifier()); })); } @@ -75,7 +75,7 @@ reader_consumer_v2 compaction_strategy_impl::make_interposer_consumer(const muta } compaction_descriptor -compaction_strategy_impl::get_reshaping_job(std::vector input, schema_ptr schema, const ::io_priority_class& iop, reshape_mode mode) const { +compaction_strategy_impl::get_reshaping_job(std::vector input, schema_ptr schema, reshape_mode mode) const { return compaction_descriptor(); } @@ -665,7 +665,7 @@ compaction_descriptor date_tiered_compaction_strategy::get_sstables_for_compacti if (!sstables.empty()) { date_tiered_manifest::logger.debug("datetiered: Compacting {} out of {} sstables", sstables.size(), candidates.size()); - return sstables::compaction_descriptor(std::move(sstables), service::get_local_compaction_priority()); + return sstables::compaction_descriptor(std::move(sstables)); } // filter out sstables which droppable tombstone ratio isn't greater than the defined threshold. @@ -681,7 +681,7 @@ compaction_descriptor date_tiered_compaction_strategy::get_sstables_for_compacti auto it = std::min_element(candidates.begin(), candidates.end(), [] (auto& i, auto& j) { return i->get_stats_metadata().min_timestamp < j->get_stats_metadata().min_timestamp; }); - return sstables::compaction_descriptor({ *it }, service::get_local_compaction_priority()); + return sstables::compaction_descriptor({ *it }); } std::unique_ptr date_tiered_compaction_strategy::make_backlog_tracker() const { @@ -746,8 +746,8 @@ compaction_backlog_tracker compaction_strategy::make_backlog_tracker() const { } sstables::compaction_descriptor -compaction_strategy::get_reshaping_job(std::vector input, schema_ptr schema, const ::io_priority_class& iop, reshape_mode mode) const { - return _compaction_strategy_impl->get_reshaping_job(std::move(input), schema, iop, mode); +compaction_strategy::get_reshaping_job(std::vector input, schema_ptr schema, reshape_mode mode) const { + return _compaction_strategy_impl->get_reshaping_job(std::move(input), schema, mode); } uint64_t compaction_strategy::adjust_partition_estimate(const mutation_source_metadata& ms_meta, uint64_t partition_estimate) const { diff --git a/compaction/compaction_strategy.hh b/compaction/compaction_strategy.hh index 5bd9ef0c2e..b3e37d5c42 100644 --- a/compaction/compaction_strategy.hh +++ b/compaction/compaction_strategy.hh @@ -126,7 +126,7 @@ public: // // The caller should also pass a maximum number of SSTables which is the maximum amount of // SSTables that can be added into a single job. - compaction_descriptor get_reshaping_job(std::vector input, schema_ptr schema, const ::io_priority_class& iop, reshape_mode mode) const; + compaction_descriptor get_reshaping_job(std::vector input, schema_ptr schema, reshape_mode mode) const; }; diff --git a/compaction/compaction_strategy_impl.hh b/compaction/compaction_strategy_impl.hh index 6342b6f203..eed3173a34 100644 --- a/compaction/compaction_strategy_impl.hh +++ b/compaction/compaction_strategy_impl.hh @@ -73,6 +73,6 @@ public: return false; } - virtual compaction_descriptor get_reshaping_job(std::vector input, schema_ptr schema, const ::io_priority_class& iop, reshape_mode mode) const; + virtual compaction_descriptor get_reshaping_job(std::vector input, schema_ptr schema, reshape_mode mode) const; }; } diff --git a/compaction/leveled_compaction_strategy.cc b/compaction/leveled_compaction_strategy.cc index 9f7bfe9e23..57b7dfe2d1 100644 --- a/compaction/leveled_compaction_strategy.cc +++ b/compaction/leveled_compaction_strategy.cc @@ -61,7 +61,7 @@ compaction_descriptor leveled_compaction_strategy::get_sstables_for_compaction(t auto gc_before2 = j->get_gc_before_for_drop_estimation(compaction_time, table_s.get_tombstone_gc_state()); return i->estimate_droppable_tombstone_ratio(gc_before1) < j->estimate_droppable_tombstone_ratio(gc_before2); }); - return sstables::compaction_descriptor({ sst }, service::get_local_compaction_priority(), sst->get_sstable_level()); + return sstables::compaction_descriptor({ sst }, sst->get_sstable_level()); } return {}; } @@ -145,7 +145,7 @@ int64_t leveled_compaction_strategy::estimated_pending_compactions(table_state& } compaction_descriptor -leveled_compaction_strategy::get_reshaping_job(std::vector input, schema_ptr schema, const ::io_priority_class& iop, reshape_mode mode) const { +leveled_compaction_strategy::get_reshaping_job(std::vector input, schema_ptr schema, reshape_mode mode) const { std::array, leveled_manifest::MAX_LEVELS> level_info; auto is_disjoint = [schema] (const std::vector& sstables, unsigned tolerance) -> std::tuple { @@ -162,7 +162,7 @@ leveled_compaction_strategy::get_reshaping_job(std::vector input // This is really unexpected, so we'll just compact it all to fix it auto ideal_level = ideal_level_for_input(input, max_sstable_size_in_bytes); - compaction_descriptor desc(std::move(input), iop, ideal_level, max_sstable_size_in_bytes); + compaction_descriptor desc(std::move(input), ideal_level, max_sstable_size_in_bytes); desc.options = compaction_type_options::make_reshape(); return desc; } @@ -193,14 +193,14 @@ leveled_compaction_strategy::get_reshaping_job(std::vector input unsigned ideal_level = ideal_level_for_input(level_info[0], max_sstable_size_in_bytes); leveled_manifest::logger.info("Reshaping {} disjoint sstables in level 0 into level {}", level_info[0].size(), ideal_level); - compaction_descriptor desc(std::move(input), iop, ideal_level, max_sstable_size_in_bytes); + compaction_descriptor desc(std::move(input), ideal_level, max_sstable_size_in_bytes); desc.options = compaction_type_options::make_reshape(); return desc; } if (level_info[0].size() > offstrategy_threshold) { size_tiered_compaction_strategy stcs(_stcs_options); - return stcs.get_reshaping_job(std::move(level_info[0]), schema, iop, mode); + return stcs.get_reshaping_job(std::move(level_info[0]), schema, mode); } for (unsigned level = leveled_manifest::MAX_LEVELS - 1; level > 0; --level) { @@ -211,7 +211,7 @@ leveled_compaction_strategy::get_reshaping_job(std::vector input auto [disjoint, overlapping_sstables] = is_disjoint(level_info[level], tolerance(level)); if (!disjoint) { leveled_manifest::logger.warn("Turns out that level {} is not disjoint, found {} overlapping SSTables, so the level will be entirely compacted on behalf of {}.{}", level, overlapping_sstables, schema->ks_name(), schema->cf_name()); - compaction_descriptor desc(std::move(level_info[level]), iop, level, max_sstable_size_in_bytes); + compaction_descriptor desc(std::move(level_info[level]), level, max_sstable_size_in_bytes); desc.options = compaction_type_options::make_reshape(); return desc; } @@ -231,7 +231,7 @@ leveled_compaction_strategy::get_cleanup_compaction_jobs(table_state& table_s, s if (levels[level].empty()) { continue; } - ret.push_back(compaction_descriptor(std::move(levels[level]), service::get_local_compaction_priority(), level, _max_sstable_size_in_mb * 1024 * 1024)); + ret.push_back(compaction_descriptor(std::move(levels[level]), level, _max_sstable_size_in_mb * 1024 * 1024)); } return ret; } diff --git a/compaction/leveled_compaction_strategy.hh b/compaction/leveled_compaction_strategy.hh index 6c4980b17d..fea2ce297c 100644 --- a/compaction/leveled_compaction_strategy.hh +++ b/compaction/leveled_compaction_strategy.hh @@ -73,7 +73,7 @@ public: virtual std::unique_ptr make_backlog_tracker() const override; - virtual compaction_descriptor get_reshaping_job(std::vector input, schema_ptr schema, const ::io_priority_class& iop, reshape_mode mode) const override; + virtual compaction_descriptor get_reshaping_job(std::vector input, schema_ptr schema, reshape_mode mode) const override; }; } diff --git a/compaction/leveled_manifest.hh b/compaction/leveled_manifest.hh index 8252c4658a..4dbf64b711 100644 --- a/compaction/leveled_manifest.hh +++ b/compaction/leveled_manifest.hh @@ -17,7 +17,6 @@ #include "log.hh" #include #include -#include "service/priority_manager.hh" class leveled_manifest { table_state& _table_s; @@ -149,8 +148,7 @@ public: if (info.can_promote) { info.candidates = get_overlapping_starved_sstables(next_level, std::move(info.candidates), compaction_counter); } - return sstables::compaction_descriptor(std::move(info.candidates), - service::get_local_compaction_priority(), next_level, _max_sstable_size_in_bytes); + return sstables::compaction_descriptor(std::move(info.candidates), next_level, _max_sstable_size_in_bytes); } else { logger.debug("No compaction candidates for L{}", level); return sstables::compaction_descriptor(); @@ -214,8 +212,7 @@ public: _table_s.min_compaction_threshold(), _schema->max_compaction_threshold(), _stcs_options); if (!most_interesting.empty()) { logger.debug("L0 is too far behind, performing size-tiering there first"); - return sstables::compaction_descriptor(std::move(most_interesting), - service::get_local_compaction_priority()); + return sstables::compaction_descriptor(std::move(most_interesting)); } } auto descriptor = get_descriptor_for_level(i, last_compacted_keys, compaction_counter); @@ -229,8 +226,7 @@ public: auto info = get_candidates_for(0, last_compacted_keys); if (!info.candidates.empty()) { auto next_level = get_next_level(info.candidates, info.can_promote); - return sstables::compaction_descriptor(std::move(info.candidates), - service::get_local_compaction_priority(), next_level, _max_sstable_size_in_bytes); + return sstables::compaction_descriptor(std::move(info.candidates), next_level, _max_sstable_size_in_bytes); } } diff --git a/compaction/size_tiered_compaction_strategy.cc b/compaction/size_tiered_compaction_strategy.cc index 701cc85917..3bce7e8dc0 100644 --- a/compaction/size_tiered_compaction_strategy.cc +++ b/compaction/size_tiered_compaction_strategy.cc @@ -155,13 +155,13 @@ size_tiered_compaction_strategy::get_sstables_for_compaction(table_state& table_ if (is_any_bucket_interesting(buckets, min_threshold)) { std::vector most_interesting = most_interesting_bucket(std::move(buckets), min_threshold, max_threshold); - return sstables::compaction_descriptor(std::move(most_interesting), service::get_local_compaction_priority()); + return sstables::compaction_descriptor(std::move(most_interesting)); } // If we are not enforcing min_threshold explicitly, try any pair of SStables in the same tier. if (!table_s.compaction_enforce_min_threshold() && is_any_bucket_interesting(buckets, 2)) { std::vector most_interesting = most_interesting_bucket(std::move(buckets), 2, max_threshold); - return sstables::compaction_descriptor(std::move(most_interesting), service::get_local_compaction_priority()); + return sstables::compaction_descriptor(std::move(most_interesting)); } if (!table_s.tombstone_gc_enabled()) { @@ -185,7 +185,7 @@ size_tiered_compaction_strategy::get_sstables_for_compaction(table_state& table_ auto it = std::min_element(sstables.begin(), sstables.end(), [] (auto& i, auto& j) { return i->get_stats_metadata().min_timestamp < j->get_stats_metadata().min_timestamp; }); - return sstables::compaction_descriptor({ *it }, service::get_local_compaction_priority()); + return sstables::compaction_descriptor({ *it }); } return sstables::compaction_descriptor(); } @@ -229,7 +229,7 @@ size_tiered_compaction_strategy::most_interesting_bucket(const std::vector input, schema_ptr schema, const ::io_priority_class& iop, reshape_mode mode) const +size_tiered_compaction_strategy::get_reshaping_job(std::vector input, schema_ptr schema, reshape_mode mode) const { size_t offstrategy_threshold = std::max(schema->min_compaction_threshold(), 4); size_t max_sstables = std::max(schema->max_compaction_threshold(), int(offstrategy_threshold)); @@ -245,7 +245,7 @@ size_tiered_compaction_strategy::get_reshaping_job(std::vector i // All sstables can be reshaped at once if the amount of overlapping will not cause memory usage to be high, // which is possible because partitioned set is able to incrementally open sstables during compaction if (sstable_set_overlapping_count(schema, input) <= max_sstables) { - compaction_descriptor desc(std::move(input), iop); + compaction_descriptor desc(std::move(input)); desc.options = compaction_type_options::make_reshape(); return desc; } @@ -261,7 +261,7 @@ size_tiered_compaction_strategy::get_reshaping_job(std::vector i }); bucket.resize(max_sstables); } - compaction_descriptor desc(std::move(bucket), iop); + compaction_descriptor desc(std::move(bucket)); desc.options = compaction_type_options::make_reshape(); return desc; } @@ -289,7 +289,7 @@ size_tiered_compaction_strategy::get_cleanup_compaction_jobs(table_state& table_ unsigned needed = std::min(remaining, max_threshold); std::vector sstables; std::move(it, it + needed, std::back_inserter(sstables)); - ret.push_back(compaction_descriptor(std::move(sstables), service::get_local_compaction_priority())); + ret.push_back(compaction_descriptor(std::move(sstables))); std::advance(it, needed); } } diff --git a/compaction/size_tiered_compaction_strategy.hh b/compaction/size_tiered_compaction_strategy.hh index 24ae4eefaa..dec492aea3 100644 --- a/compaction/size_tiered_compaction_strategy.hh +++ b/compaction/size_tiered_compaction_strategy.hh @@ -129,7 +129,7 @@ public: virtual std::unique_ptr make_backlog_tracker() const override; - virtual compaction_descriptor get_reshaping_job(std::vector input, schema_ptr schema, const ::io_priority_class& iop, reshape_mode mode) const override; + virtual compaction_descriptor get_reshaping_job(std::vector input, schema_ptr schema, reshape_mode mode) const override; friend class ::size_tiered_backlog_tracker; }; diff --git a/compaction/time_window_compaction_strategy.cc b/compaction/time_window_compaction_strategy.cc index 18859eb8f7..bee376f450 100644 --- a/compaction/time_window_compaction_strategy.cc +++ b/compaction/time_window_compaction_strategy.cc @@ -138,7 +138,7 @@ reader_consumer_v2 time_window_compaction_strategy::make_interposer_consumer(con } compaction_descriptor -time_window_compaction_strategy::get_reshaping_job(std::vector input, schema_ptr schema, const ::io_priority_class& iop, reshape_mode mode) const { +time_window_compaction_strategy::get_reshaping_job(std::vector input, schema_ptr schema, reshape_mode mode) const { std::vector single_window; std::vector multi_window; @@ -192,7 +192,7 @@ time_window_compaction_strategy::get_reshaping_job(std::vector i }); multi_window.resize(max_sstables); } - compaction_descriptor desc(std::move(multi_window), iop); + compaction_descriptor desc(std::move(multi_window)); desc.options = compaction_type_options::make_reshape(); return desc; } @@ -211,14 +211,14 @@ time_window_compaction_strategy::get_reshaping_job(std::vector i } // reuse STCS reshape logic which will only compact similar-sized files, to increase overall efficiency // when reshaping time buckets containing a huge amount of files - auto desc = size_tiered_compaction_strategy(_stcs_options).get_reshaping_job(std::move(ssts), schema, iop, mode); + auto desc = size_tiered_compaction_strategy(_stcs_options).get_reshaping_job(std::move(ssts), schema, mode); if (!desc.sstables.empty()) { return desc; } } } if (!single_window.empty()) { - compaction_descriptor desc(std::move(single_window), iop); + compaction_descriptor desc(std::move(single_window)); desc.options = compaction_type_options::make_reshape(); return desc; } @@ -244,7 +244,7 @@ time_window_compaction_strategy::get_sstables_for_compaction(table_state& table_ auto expired = table_s.fully_expired_sstables(candidates, compaction_time); if (!expired.empty()) { clogger.debug("[{}] Going to compact {} expired sstables", fmt::ptr(this), expired.size()); - return compaction_descriptor(has_only_fully_expired::yes, std::vector(expired.begin(), expired.end()), service::get_local_compaction_priority()); + return compaction_descriptor(has_only_fully_expired::yes, std::vector(expired.begin(), expired.end())); } // Keep checking for fully_expired_sstables until we don't find // any among the candidates, meaning they are either already compacted @@ -256,7 +256,7 @@ time_window_compaction_strategy::get_sstables_for_compaction(table_state& table_ auto compaction_candidates = get_next_non_expired_sstables(table_s, control, std::move(candidates), compaction_time); clogger.debug("[{}] Going to compact {} non-expired sstables", fmt::ptr(this), compaction_candidates.size()); - return compaction_descriptor(std::move(compaction_candidates), service::get_local_compaction_priority()); + return compaction_descriptor(std::move(compaction_candidates)); } time_window_compaction_strategy::bucket_compaction_mode diff --git a/compaction/time_window_compaction_strategy.hh b/compaction/time_window_compaction_strategy.hh index 1705e222f3..2f153917a7 100644 --- a/compaction/time_window_compaction_strategy.hh +++ b/compaction/time_window_compaction_strategy.hh @@ -16,7 +16,6 @@ #include "timestamp.hh" #include "exceptions/exceptions.hh" #include "sstables/shared_sstable.hh" -#include "service/priority_manager.hh" namespace sstables { @@ -172,7 +171,7 @@ public: return true; } - virtual compaction_descriptor get_reshaping_job(std::vector input, schema_ptr schema, const ::io_priority_class& iop, reshape_mode mode) const override; + virtual compaction_descriptor get_reshaping_job(std::vector input, schema_ptr schema, reshape_mode mode) const override; }; } diff --git a/configure.py b/configure.py index 1651d737e6..5625b22fc5 100755 --- a/configure.py +++ b/configure.py @@ -862,7 +862,6 @@ scylla_core = (['message/messaging_service.cc', 'utils/big_decimal.cc', 'types/types.cc', 'validation.cc', - 'service/priority_manager.cc', 'service/migration_manager.cc', 'service/tablet_allocator.cc', 'service/storage_proxy.cc', @@ -1640,7 +1639,7 @@ def configure_seastar(build_dir, mode, mode_config): '-DSeastar_CXX_FLAGS=SHELL:{}'.format(mode_config['lib_cflags']), '-DSeastar_LD_FLAGS={}'.format(semicolon_separated(mode_config['lib_ldflags'], mode_config['cxx_ld_flags'])), '-DSeastar_CXX_DIALECT=gnu++20', - '-DSeastar_API_LEVEL=6', + '-DSeastar_API_LEVEL=7', '-DSeastar_UNUSED_RESULT_ERROR=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DSeastar_SCHEDULING_GROUPS_COUNT=16', diff --git a/db/commitlog/commitlog.cc b/db/commitlog/commitlog.cc index d1dc71b5da..0adb64e02c 100644 --- a/db/commitlog/commitlog.cc +++ b/db/commitlog/commitlog.cc @@ -52,7 +52,6 @@ #include "log.hh" #include "commitlog_entry.hh" #include "commitlog_extensions.hh" -#include "service/priority_manager.hh" #include "serializer.hh" #include @@ -281,8 +280,8 @@ public: // NOT overrides. Nothing virtual. Will rely on exact type template - auto dma_write(uint64_t pos, const CharType* buffer, size_t len, const io_priority_class& pc = default_priority_class(), io_intent* intent = nullptr) noexcept; - auto dma_write(uint64_t pos, std::vector iov, const io_priority_class& pc = default_priority_class(), io_intent* intent = nullptr) noexcept; + auto dma_write(uint64_t pos, const CharType* buffer, size_t len, io_intent* intent = nullptr) noexcept; + auto dma_write(uint64_t pos, std::vector iov, io_intent* intent = nullptr) noexcept; auto truncate(uint64_t length) noexcept; auto allocate(uint64_t position, uint64_t length) noexcept; @@ -577,15 +576,15 @@ auto db::commitlog::segment_manager::named_file::make_awaiter(future f, } template -auto db::commitlog::segment_manager::named_file::dma_write(uint64_t pos, const CharType* buffer, size_t len, const io_priority_class& pc, io_intent* intent) noexcept { - return make_awaiter(file::dma_write(pos, buffer, len, pc, intent), [this, pos](size_t res) { +auto db::commitlog::segment_manager::named_file::dma_write(uint64_t pos, const CharType* buffer, size_t len, io_intent* intent) noexcept { + return make_awaiter(file::dma_write(pos, buffer, len, intent), [this, pos](size_t res) { maybe_update_size(pos + res); return res; }); } -auto db::commitlog::segment_manager::named_file::dma_write(uint64_t pos, std::vector iov, const io_priority_class& pc, io_intent* intent) noexcept { - return make_awaiter(file::dma_write(pos, std::move(iov), pc, intent), [this, pos](size_t res) { +auto db::commitlog::segment_manager::named_file::dma_write(uint64_t pos, std::vector iov, io_intent* intent) noexcept { + return make_awaiter(file::dma_write(pos, std::move(iov), intent), [this, pos](size_t res) { maybe_update_size(pos + res); return res; }); @@ -1023,8 +1022,6 @@ public: co_return; } - auto&& priority_class = service::get_local_commitlog_priority(); - auto finally = defer([&] () noexcept { _segment_manager->notify_memory_written(size); _segment_manager->totals.buffer_list_bytes -= buf.size_bytes(); @@ -1038,7 +1035,7 @@ public: for (;;) { auto current = *view.begin(); try { - auto bytes = co_await _file.dma_write(off, current.data(), current.size(), priority_class); + auto bytes = co_await _file.dma_write(off, current.data(), current.size()); _segment_manager->totals.bytes_written += bytes; _segment_manager->totals.active_size_on_disk += bytes; ++_segment_manager->totals.cycle_count; @@ -1716,7 +1713,7 @@ future db::commitlog::segment_manager: v.emplace_back(iovec{ buf.get_write(), s}); m += s; } - auto s = co_await f.dma_write(max_size - rem, std::move(v), service::get_local_commitlog_priority()); + auto s = co_await f.dma_write(max_size - rem, std::move(v)); if (!s) [[unlikely]] { on_internal_error(clogger, format("dma_write returned 0: max_size={} rem={} iovec.n={}", max_size, rem, n)); } @@ -2551,14 +2548,13 @@ const db::commitlog::config& db::commitlog::active_config() const { // No commit_io_check needed in the log reader since the database will fail // on error at startup if required future<> -db::commitlog::read_log_file(sstring filename, sstring pfx, seastar::io_priority_class read_io_prio_class, commit_load_reader_func next, position_type off, const db::extensions* exts) { +db::commitlog::read_log_file(sstring filename, sstring pfx, commit_load_reader_func next, position_type off, const db::extensions* exts) { struct work { private: - file_input_stream_options make_file_input_stream_options(seastar::io_priority_class read_io_prio_class) { + file_input_stream_options make_file_input_stream_options() { file_input_stream_options fo; fo.buffer_size = db::commitlog::segment::default_size; fo.read_ahead = 10; - fo.io_priority_class = read_io_prio_class; return fo; } public: @@ -2578,8 +2574,8 @@ db::commitlog::read_log_file(sstring filename, sstring pfx, seastar::io_priority bool failed = false; fragmented_temporary_buffer::reader frag_reader; - work(file f, descriptor din, commit_load_reader_func fn, seastar::io_priority_class read_io_prio_class, position_type o = 0) - : f(f), d(din), func(std::move(fn)), fin(make_file_input_stream(f, 0, make_file_input_stream_options(read_io_prio_class))), start_off(o) { + work(file f, descriptor din, commit_load_reader_func fn, position_type o = 0) + : f(f), d(din), func(std::move(fn)), fin(make_file_input_stream(f, 0, make_file_input_stream_options())), start_off(o) { } work(work&&) = default; @@ -2878,7 +2874,7 @@ db::commitlog::read_log_file(sstring filename, sstring pfx, seastar::io_priority f = make_checked_file(commit_error_handler, std::move(f)); descriptor d(filename, pfx); - work w(std::move(f), d, std::move(next), read_io_prio_class, off); + work w(std::move(f), d, std::move(next), off); co_await w.read_file(); } diff --git a/db/commitlog/commitlog.hh b/db/commitlog/commitlog.hh index 65c907713e..99e57b87f6 100644 --- a/db/commitlog/commitlog.hh +++ b/db/commitlog/commitlog.hh @@ -386,7 +386,7 @@ public: } }; - static future<> read_log_file(sstring filename, sstring prefix, seastar::io_priority_class read_io_prio_class, commit_load_reader_func, position_type = 0, const db::extensions* = nullptr); + static future<> read_log_file(sstring filename, sstring prefix, commit_load_reader_func, position_type = 0, const db::extensions* = nullptr); private: commitlog(config); diff --git a/db/commitlog/commitlog_replayer.cc b/db/commitlog/commitlog_replayer.cc index 019d885ad7..122ff458b3 100644 --- a/db/commitlog/commitlog_replayer.cc +++ b/db/commitlog/commitlog_replayer.cc @@ -25,7 +25,6 @@ #include "converting_mutation_partition_applier.hh" #include "schema/schema_registry.hh" #include "commitlog_entry.hh" -#include "service/priority_manager.hh" #include "db/extensions.hh" #include "utils/fragmented_temporary_buffer.hh" #include "validation.hh" @@ -194,7 +193,7 @@ db::commitlog_replayer::impl::recover(sstring file, const sstring& fname_prefix) auto s = make_lw_shared(); auto& exts = _db.local().extensions(); - return db::commitlog::read_log_file(file, fname_prefix, service::get_local_commitlog_priority(), + return db::commitlog::read_log_file(file, fname_prefix, std::bind(&impl::process, this, s.get(), std::placeholders::_1), p, &exts).then_wrapped([s](future<> f) { try { diff --git a/db/hints/manager.cc b/db/hints/manager.cc index 003b048c3e..c357c10a36 100644 --- a/db/hints/manager.cc +++ b/db/hints/manager.cc @@ -26,7 +26,6 @@ #include "utils/disk-error-handler.hh" #include "utils/lister.hh" #include "db/timeout_clock.hh" -#include "service/priority_manager.hh" #include "replica/database.hh" #include "service_permit.hh" #include "utils/directories.hh" @@ -1035,7 +1034,7 @@ bool manager::end_point_hints_manager::sender::send_one_file(const sstring& fnam lw_shared_ptr ctx_ptr = make_lw_shared(_last_schema_ver_to_column_mapping); try { - commitlog::read_log_file(fname, manager::FILENAME_PREFIX, service::get_local_streaming_priority(), [this, secs_since_file_mod, &fname, ctx_ptr] (commitlog::buffer_and_replay_position buf_rp) -> future<> { + commitlog::read_log_file(fname, manager::FILENAME_PREFIX, [this, secs_since_file_mod, &fname, ctx_ptr] (commitlog::buffer_and_replay_position buf_rp) -> future<> { auto& buf = buf_rp.buffer; auto& rp = buf_rp.position; diff --git a/db/size_estimates_virtual_reader.hh b/db/size_estimates_virtual_reader.hh index f46fff083a..d56018d339 100644 --- a/db/size_estimates_virtual_reader.hh +++ b/db/size_estimates_virtual_reader.hh @@ -8,7 +8,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include #include "readers/flat_mutation_reader_fwd.hh" #include "readers/flat_mutation_reader_v2.hh" #include "db/system_keyspace.hh" @@ -61,7 +60,6 @@ struct virtual_reader { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { diff --git a/db/view/build_progress_virtual_reader.hh b/db/view/build_progress_virtual_reader.hh index 2309176402..37c188bff6 100644 --- a/db/view/build_progress_virtual_reader.hh +++ b/db/view/build_progress_virtual_reader.hh @@ -54,7 +54,6 @@ class build_progress_virtual_reader { replica::column_family& scylla_views_build_progress, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) @@ -70,7 +69,6 @@ class build_progress_virtual_reader { std::move(permit), range, slice, - pc, std::move(trace_state), fwd, fwd_mr)) @@ -192,7 +190,6 @@ public: reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { @@ -202,7 +199,6 @@ public: _db.find_column_family(s->ks_name(), system_keyspace::v3::SCYLLA_VIEWS_BUILDS_IN_PROGRESS), range, slice, - pc, std::move(trace_state), fwd, fwd_mr)); diff --git a/db/view/view.cc b/db/view/view.cc index 12a4f72429..6ca37a5821 100644 --- a/db/view/view.cc +++ b/db/view/view.cc @@ -1898,7 +1898,6 @@ future<> view_builder::initialize_reader_at_current_token(build_step& step) { _permit, step.prange, step.pslice, - default_priority_class(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); diff --git a/db/view/view_update_generator.cc b/db/view/view_update_generator.cc index 7bbb0c92b2..4ba4c58fb0 100644 --- a/db/view/view_update_generator.cc +++ b/db/view/view_update_generator.cc @@ -10,7 +10,6 @@ #include #include "replica/database.hh" #include "view_update_generator.hh" -#include "service/priority_manager.hh" #include "utils/error_injection.hh" #include "db/view/view_updating_consumer.hh" #include "sstables/sstables.hh" @@ -147,11 +146,10 @@ future<> view_update_generator::start() { reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr ts, streamed_mutation::forwarding fwd_ms, mutation_reader::forwarding fwd_mr) { - return ssts->make_range_sstable_reader(s, std::move(permit), pr, ps, pc, std::move(ts), fwd_ms, fwd_mr, *_progress_tracker); + return ssts->make_range_sstable_reader(s, std::move(permit), pr, ps, std::move(ts), fwd_ms, fwd_mr, *_progress_tracker); }); auto [staging_sstable_reader, staging_sstable_reader_handle] = make_manually_paused_evictable_reader_v2( std::move(ms), @@ -159,7 +157,6 @@ future<> view_update_generator::start() { permit, query::full_partition_range, s->full_slice(), - service::get_local_streaming_priority(), nullptr, ::mutation_reader::forwarding::no); auto close_sr = deferred_close(staging_sstable_reader); diff --git a/db/virtual_table.cc b/db/virtual_table.cc index 55ce67b1f3..227d8350a4 100644 --- a/db/virtual_table.cc +++ b/db/virtual_table.cc @@ -40,7 +40,6 @@ mutation_source memtable_filling_virtual_table::as_mutation_source() { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { @@ -54,15 +53,15 @@ mutation_source memtable_filling_virtual_table::as_mutation_source() { auto units = make_lw_shared(permit.consume_memory(0)); - auto populate = [this, mt = make_lw_shared(schema()), s, units, range, slice, pc, trace_state, fwd, fwd_mr] () mutable { + auto populate = [this, mt = make_lw_shared(schema()), s, units, range, slice, trace_state, fwd, fwd_mr] () mutable { auto mutation_sink = [units, mt] (mutation m) mutable { mt->apply(m); units->units.add(units->units.permit().consume_memory(mt->occupancy().used_space() - units->memory_used)); units->memory_used = mt->occupancy().used_space(); }; - return execute(mutation_sink).then([this, mt, s, units, &range, &slice, &pc, &trace_state, &fwd, &fwd_mr] () { - auto rd = mt->as_data_source().make_reader_v2(s, units->units.permit(), range, slice, pc, trace_state, fwd, fwd_mr); + return execute(mutation_sink).then([this, mt, s, units, &range, &slice, &trace_state, &fwd, &fwd_mr] () { + auto rd = mt->as_data_source().make_reader_v2(s, units->units.permit(), range, slice, trace_state, fwd, fwd_mr); if (!_shard_aware) { rd = make_filtering_reader(std::move(rd), [this] (const dht::decorated_key& dk) -> bool { @@ -84,7 +83,6 @@ mutation_source streaming_virtual_table::as_mutation_source() { reader_permit permit, const dht::partition_range& pr, const query::partition_slice& query_slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { diff --git a/index/built_indexes_virtual_reader.hh b/index/built_indexes_virtual_reader.hh index cc304d1bec..b7a3b1b636 100644 --- a/index/built_indexes_virtual_reader.hh +++ b/index/built_indexes_virtual_reader.hh @@ -103,7 +103,6 @@ class built_indexes_virtual_reader { replica::column_family& built_views, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) @@ -116,7 +115,6 @@ class built_indexes_virtual_reader { std::move(permit), range, _view_names_slice, - pc, std::move(trace_state), fwd, fwd_mr)) { @@ -217,7 +215,6 @@ public: reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { @@ -228,7 +225,6 @@ public: _db.find_column_family(s->ks_name(), system_keyspace::v3::BUILT_VIEWS), range, slice, - pc, std::move(trace_state), fwd, fwd_mr); diff --git a/main.cc b/main.cc index 946ec54855..720ac34893 100644 --- a/main.cc +++ b/main.cc @@ -1137,8 +1137,8 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl // we need the getter since updateable_value is not shard-safe (#7316) auto get_cm_cfg = sharded_parameter([&] { return compaction_manager::config { - .compaction_sched_group = compaction_manager::scheduling_group{dbcfg.compaction_scheduling_group, service::get_local_compaction_priority()}, - .maintenance_sched_group = compaction_manager::scheduling_group{dbcfg.streaming_scheduling_group, service::get_local_streaming_priority()}, + .compaction_sched_group = compaction_manager::scheduling_group{dbcfg.compaction_scheduling_group}, + .maintenance_sched_group = compaction_manager::scheduling_group{dbcfg.streaming_scheduling_group}, .available_memory = dbcfg.available_memory, .static_shares = cfg->compaction_static_shares, .throughput_mb_per_sec = cfg->compaction_throughput_mb_per_sec, diff --git a/multishard_mutation_query.cc b/multishard_mutation_query.cc index 88ff09baee..32c6e2be6f 100644 --- a/multishard_mutation_query.cc +++ b/multishard_mutation_query.cc @@ -7,7 +7,6 @@ */ #include "schema/schema_registry.hh" -#include "service/priority_manager.hh" #include "multishard_mutation_query.hh" #include "mutation_query.hh" #include "replica/database.hh" @@ -245,7 +244,6 @@ public: reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) override; @@ -304,7 +302,6 @@ flat_mutation_reader_v2 read_context::create_reader( reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { const auto shard = this_shard_id(); @@ -348,7 +345,7 @@ flat_mutation_reader_v2 read_context::create_reader( rm.state = reader_state::used; - return table.as_mutation_source().make_reader_v2(std::move(schema), rm.rparts->permit, *rm.rparts->range, *rm.rparts->slice, pc, + return table.as_mutation_source().make_reader_v2(std::move(schema), rm.rparts->permit, *rm.rparts->range, *rm.rparts->slice, std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr); } @@ -718,7 +715,7 @@ future> read_page( cmd.partition_limit); auto reader = make_multishard_combining_reader_v2(ctx, s, ctx->permit(), ranges.front(), cmd.slice, - service::get_local_sstable_query_read_priority(), trace_state, mutation_reader::forwarding(ranges.size() > 1)); + trace_state, mutation_reader::forwarding(ranges.size() > 1)); if (ranges.size() > 1) { reader = make_flat_mutation_reader_v2(s, ctx->permit(), std::move(reader), ranges); } diff --git a/mutation/mutation_partition.cc b/mutation/mutation_partition.cc index 14f6d720bc..2aa19c5cc9 100644 --- a/mutation/mutation_partition.cc +++ b/mutation/mutation_partition.cc @@ -19,7 +19,6 @@ #include "reversibly_mergeable.hh" #include "mutation_fragment.hh" #include "mutation_query.hh" -#include "service/priority_manager.hh" #include "mutation_compactor.hh" #include "counters.hh" #include "row_cache.hh" @@ -2515,7 +2514,7 @@ future counter_write_query(schema_ptr s, const mutation_source& so const query::partition_slice& slice, tracing::trace_state_ptr trace_ptr) : range(dht::partition_range::make_singular(dk)) - , reader(source.make_reader_v2(s, std::move(permit), range, slice, service::get_local_sstable_query_read_priority(), + , reader(source.make_reader_v2(s, std::move(permit), range, slice, std::move(trace_ptr), streamed_mutation::forwarding::no, mutation_reader::forwarding::no)) { } diff --git a/mutation/mutation_partition_v2.cc b/mutation/mutation_partition_v2.cc index ebf8f500f2..753a11718e 100644 --- a/mutation/mutation_partition_v2.cc +++ b/mutation/mutation_partition_v2.cc @@ -19,7 +19,6 @@ #include "reversibly_mergeable.hh" #include "mutation_fragment.hh" #include "mutation_query.hh" -#include "service/priority_manager.hh" #include "mutation_compactor.hh" #include "counters.hh" #include "row_cache.hh" diff --git a/mutation_query.cc b/mutation_query.cc index 18df460e0d..6ea98d0895 100644 --- a/mutation_query.cc +++ b/mutation_query.cc @@ -9,7 +9,6 @@ #include "mutation_query.hh" #include "gc_clock.hh" #include "mutation/mutation_partition_serializer.hh" -#include "service/priority_manager.hh" #include "query-result-writer.hh" reconcilable_result::~reconcilable_result() {} diff --git a/mutation_writer/partition_based_splitting_writer.cc b/mutation_writer/partition_based_splitting_writer.cc index f6e3bc7439..feb956a60e 100644 --- a/mutation_writer/partition_based_splitting_writer.cc +++ b/mutation_writer/partition_based_splitting_writer.cc @@ -18,7 +18,6 @@ class partition_sorting_mutation_writer { schema_ptr _schema; reader_permit _permit; reader_consumer_v2 _consumer; - const io_priority_class& _pc; size_t _max_memory; bucket_writer_v2 _bucket_writer; std::optional _last_bucket_key; @@ -41,7 +40,7 @@ private: } future<> flush_memtable() { - co_await _consumer(_memtable->make_flush_reader(_schema, _permit, _pc)); + co_await _consumer(_memtable->make_flush_reader(_schema, _permit)); _memtable = make_lw_shared(_schema); } @@ -75,7 +74,6 @@ public: : _schema(std::move(schema)) , _permit(std::move(permit)) , _consumer(std::move(consumer)) - , _pc(cfg.pc) , _max_memory(cfg.max_memory) , _bucket_writer(_schema, _permit, _consumer) , _memtable(make_lw_shared(_schema)) diff --git a/mutation_writer/partition_based_splitting_writer.hh b/mutation_writer/partition_based_splitting_writer.hh index 59b075d3a7..5484a91a9d 100644 --- a/mutation_writer/partition_based_splitting_writer.hh +++ b/mutation_writer/partition_based_splitting_writer.hh @@ -8,7 +8,6 @@ #pragma once -#include #include #include "feed_writers.hh" @@ -16,9 +15,6 @@ namespace mutation_writer { struct segregate_config { - // For flushing the memtable which does the in-memory segregation (sorting) - // part. - const io_priority_class& pc; // Maximum amount of memory to be used by the in-memory segregation // (sorting) structures. Partitions can be split across partitions size_t max_memory; diff --git a/querier.hh b/querier.hh index 4b1cc3a5c5..c30fa7cfc4 100644 --- a/querier.hh +++ b/querier.hh @@ -82,13 +82,13 @@ public: { } querier_base(schema_ptr schema, reader_permit permit, dht::partition_range range, - query::partition_slice slice, const mutation_source& ms, const io_priority_class& pc, tracing::trace_state_ptr trace_ptr, + query::partition_slice slice, const mutation_source& ms, tracing::trace_state_ptr trace_ptr, querier_config config) : _schema(std::move(schema)) , _permit(std::move(permit)) , _range(make_lw_shared(std::move(range))) , _slice(std::make_unique(std::move(slice))) - , _reader(ms.make_reader_v2(_schema, _permit, *_range, *_slice, pc, std::move(trace_ptr), streamed_mutation::forwarding::no, mutation_reader::forwarding::no)) + , _reader(ms.make_reader_v2(_schema, _permit, *_range, *_slice, std::move(trace_ptr), streamed_mutation::forwarding::no, mutation_reader::forwarding::no)) , _query_ranges(*_range) , _qr_config(std::move(config)) { } @@ -153,10 +153,9 @@ public: reader_permit permit, dht::partition_range range, query::partition_slice slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_ptr, querier_config config = {}) - : querier_base(schema, permit, std::move(range), std::move(slice), ms, pc, std::move(trace_ptr), std::move(config)) + : querier_base(schema, permit, std::move(range), std::move(slice), ms, std::move(trace_ptr), std::move(config)) , _compaction_state(make_lw_shared(*schema, gc_clock::time_point{}, *_slice, 0, 0)) { } diff --git a/read_context.hh b/read_context.hh index fe1ad71d5e..6cd97d9489 100644 --- a/read_context.hh +++ b/read_context.hh @@ -123,7 +123,6 @@ class read_context final : public enable_lw_shared_from_this { const dht::partition_range& _range; const query::partition_slice& _slice; std::optional _native_slice; - const io_priority_class& _pc; tracing::trace_state_ptr _trace_state; mutation_reader::forwarding _fwd_mr; bool _range_query; @@ -149,7 +148,6 @@ public: reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) : _cache(cache) @@ -157,7 +155,6 @@ public: , _permit(std::move(permit)) , _range(range) , _slice(slice) - , _pc(pc) , _trace_state(std::move(trace_state)) , _fwd_mr(fwd_mr) , _range_query(!query::is_single_partition(range)) @@ -189,7 +186,6 @@ public: bool is_reversed() const { return _slice.options.contains(query::partition_slice::option::reversed); } // Returns a slice in the native format (for reversed reads, in native-reversed format). const query::partition_slice& native_slice() const { return is_reversed() ? *_native_slice : _slice; } - const io_priority_class& pc() const { return _pc; } tracing::trace_state_ptr trace_state() const { return _trace_state; } mutation_reader::forwarding fwd_mr() const { return _fwd_mr; } bool is_range_query() const { return _range_query; } diff --git a/reader_concurrency_semaphore.cc b/reader_concurrency_semaphore.cc index a4273e7ffe..ff1fa223cb 100644 --- a/reader_concurrency_semaphore.cc +++ b/reader_concurrency_semaphore.cc @@ -1568,20 +1568,20 @@ public: tracking_file_impl(tracking_file_impl&&) = default; tracking_file_impl& operator=(tracking_file_impl&&) = default; - virtual future write_dma(uint64_t pos, const void* buffer, size_t len, const io_priority_class& pc) override { - return get_file_impl(_tracked_file)->write_dma(pos, buffer, len, pc); + virtual future write_dma(uint64_t pos, const void* buffer, size_t len, io_intent* intent) override { + return get_file_impl(_tracked_file)->write_dma(pos, buffer, len, intent); } - virtual future write_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { - return get_file_impl(_tracked_file)->write_dma(pos, std::move(iov), pc); + virtual future write_dma(uint64_t pos, std::vector iov, io_intent* intent) override { + return get_file_impl(_tracked_file)->write_dma(pos, std::move(iov), intent); } - virtual future read_dma(uint64_t pos, void* buffer, size_t len, const io_priority_class& pc) override { - return get_file_impl(_tracked_file)->read_dma(pos, buffer, len, pc); + virtual future read_dma(uint64_t pos, void* buffer, size_t len, io_intent* intent) override { + return get_file_impl(_tracked_file)->read_dma(pos, buffer, len, intent); } - virtual future read_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { - return get_file_impl(_tracked_file)->read_dma(pos, iov, pc); + virtual future read_dma(uint64_t pos, std::vector iov, io_intent* intent) override { + return get_file_impl(_tracked_file)->read_dma(pos, iov, intent); } virtual future<> flush(void) override { @@ -1620,9 +1620,9 @@ public: return get_file_impl(_tracked_file)->list_directory(std::move(next)); } - virtual future> dma_read_bulk(uint64_t offset, size_t range_size, const io_priority_class& pc) override { - return _permit.request_memory(range_size).then([this, offset, range_size, &pc] (reader_permit::resource_units units) { - return get_file_impl(_tracked_file)->dma_read_bulk(offset, range_size, pc).then([units = std::move(units)] (temporary_buffer buf) mutable { + virtual future> dma_read_bulk(uint64_t offset, size_t range_size, io_intent* intent) override { + return _permit.request_memory(range_size).then([this, offset, range_size, intent] (reader_permit::resource_units units) { + return get_file_impl(_tracked_file)->dma_read_bulk(offset, range_size, intent).then([units = std::move(units)] (temporary_buffer buf) mutable { return make_ready_future>(make_tracked_temporary_buffer(std::move(buf), std::move(units))); }); }); diff --git a/readers/evictable.hh b/readers/evictable.hh index c29bdb79c8..474f02a9fa 100644 --- a/readers/evictable.hh +++ b/readers/evictable.hh @@ -13,10 +13,6 @@ #include "schema/schema_fwd.hh" #include "seastarx.hh" -namespace seastar { -class io_priority_class; -} - class reader_permit; class mutation_source; @@ -41,7 +37,6 @@ flat_mutation_reader_v2 make_auto_paused_evictable_reader_v2( reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr); @@ -49,7 +44,7 @@ class evictable_reader_v2; class evictable_reader_handle_v2 { friend std::pair make_manually_paused_evictable_reader_v2(mutation_source, schema_ptr, reader_permit, - const dht::partition_range&, const query::partition_slice&, const io_priority_class&, tracing::trace_state_ptr, mutation_reader::forwarding); + const dht::partition_range&, const query::partition_slice&, tracing::trace_state_ptr, mutation_reader::forwarding); private: evictable_reader_v2* _r; @@ -78,6 +73,5 @@ std::pair make_manually_pau reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr); diff --git a/readers/multi_range.hh b/readers/multi_range.hh index df6fca6ee5..83b9b1edfb 100644 --- a/readers/multi_range.hh +++ b/readers/multi_range.hh @@ -11,7 +11,6 @@ #include "dht/i_partitioner_fwd.hh" #include #include -#include #include "readers/flat_mutation_reader_fwd.hh" #include "tracing/trace_state.hh" @@ -38,7 +37,7 @@ namespace query { flat_mutation_reader_v2 make_flat_multi_range_reader( schema_ptr s, reader_permit permit, mutation_source source, const dht::partition_range_vector& ranges, - const query::partition_slice& slice, const io_priority_class& pc = default_priority_class(), + const query::partition_slice& slice, tracing::trace_state_ptr trace_state = nullptr, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::yes); @@ -53,6 +52,5 @@ make_flat_multi_range_reader( mutation_source source, std::function()> generator, const query::partition_slice& slice, - const io_priority_class& pc = default_priority_class(), tracing::trace_state_ptr trace_state = nullptr, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::yes); diff --git a/readers/multishard.cc b/readers/multishard.cc index 7f69aab2e1..96779fc6b8 100644 --- a/readers/multishard.cc +++ b/readers/multishard.cc @@ -213,7 +213,6 @@ private: mutation_source _ms; const dht::partition_range* _pr; const query::partition_slice& _ps; - const io_priority_class& _pc; tracing::global_trace_state_ptr _trace_state; const mutation_reader::forwarding _fwd_mr; reader_concurrency_semaphore::inactive_read_handle _irh; @@ -251,7 +250,6 @@ public: reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr); virtual future<> fill_buffer() override; @@ -397,7 +395,6 @@ flat_mutation_reader_v2 evictable_reader_v2::recreate_reader() { _permit, *range, *slice, - _pc, _trace_state, streamed_mutation::forwarding::no, _fwd_mr); @@ -547,7 +544,6 @@ evictable_reader_v2::evictable_reader_v2( reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) : impl(std::move(schema), std::move(permit)) @@ -555,7 +551,6 @@ evictable_reader_v2::evictable_reader_v2( , _ms(std::move(ms)) , _pr(&pr) , _ps(ps) - , _pc(pc) , _trace_state(std::move(trace_state)) , _fwd_mr(fwd_mr) , _tri_cmp(*_schema) @@ -671,11 +666,10 @@ flat_mutation_reader_v2 make_auto_paused_evictable_reader_v2( reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { return make_flat_mutation_reader_v2(evictable_reader_v2::auto_pause::yes, std::move(ms), std::nullopt, std::move(schema), std::move(permit), pr, ps, - pc, std::move(trace_state), fwd_mr); + std::move(trace_state), fwd_mr); } std::pair make_manually_paused_evictable_reader_v2( @@ -684,11 +678,10 @@ std::pair make_manually_pau reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { auto reader = std::make_unique(evictable_reader_v2::auto_pause::no, std::move(ms), std::nullopt, std::move(schema), std::move(permit), pr, ps, - pc, std::move(trace_state), fwd_mr); + std::move(trace_state), fwd_mr); auto handle = evictable_reader_handle_v2(*reader.get()); return std::pair(flat_mutation_reader_v2(std::move(reader)), handle); } @@ -710,7 +703,6 @@ private: const unsigned _shard; foreign_ptr> _pr; const query::partition_slice& _ps; - const io_priority_class& _pc; tracing::global_trace_state_ptr _trace_state; const mutation_reader::forwarding _fwd_mr; std::optional> _read_ahead; @@ -727,7 +719,6 @@ public: unsigned shard, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) : impl(std::move(schema), std::move(permit)) @@ -735,7 +726,6 @@ public: , _shard(shard) , _pr(make_foreign(make_lw_shared(pr))) , _ps(ps) - , _pc(pc) , _trace_state(std::move(trace_state)) , _fwd_mr(fwd_mr) { } @@ -817,18 +807,17 @@ future<> shard_reader_v2::do_fill_buffer() { reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr ts, streamed_mutation::forwarding, mutation_reader::forwarding fwd_mr) { - return lifecycle_policy->create_reader(std::move(s), std::move(permit), pr, ps, pc, std::move(ts), fwd_mr); + return lifecycle_policy->create_reader(std::move(s), std::move(permit), pr, ps, std::move(ts), fwd_mr); }); auto s = gs.get(); auto permit = co_await _lifecycle_policy->obtain_reader_permit(s, "shard-reader", timeout(), _trace_state); if (permit.needs_readmission()) { co_await permit.wait_readmission(); } - auto underlying_reader = _lifecycle_policy->create_reader(s, permit, *_pr, _ps, _pc, _trace_state, _fwd_mr); + auto underlying_reader = _lifecycle_policy->create_reader(s, permit, *_pr, _ps, _trace_state, _fwd_mr); std::exception_ptr ex; @@ -851,7 +840,7 @@ future<> shard_reader_v2::do_fill_buffer() { } auto rreader = make_foreign(std::make_unique(evictable_reader_v2::auto_pause::yes, std::move(ms), - std::move(underlying_reader), s, std::move(permit), *_pr, _ps, _pc, _trace_state, _fwd_mr)); + std::move(underlying_reader), s, std::move(permit), *_pr, _ps, _trace_state, _fwd_mr)); try { tracing::trace(_trace_state, "Creating shard reader on shard: {}", this_shard_id()); @@ -989,7 +978,6 @@ public: reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr); @@ -1088,7 +1076,6 @@ multishard_combining_reader_v2::multishard_combining_reader_v2( reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) : impl(std::move(s), std::move(permit)), _sharder(sharder) { @@ -1097,7 +1084,7 @@ multishard_combining_reader_v2::multishard_combining_reader_v2( _shard_readers.reserve(_sharder.shard_count()); for (unsigned i = 0; i < _sharder.shard_count(); ++i) { - _shard_readers.emplace_back(std::make_unique(_schema, _permit, lifecycle_policy, i, pr, ps, pc, trace_state, fwd_mr)); + _shard_readers.emplace_back(std::make_unique(_schema, _permit, lifecycle_policy, i, pr, ps, trace_state, fwd_mr)); } } @@ -1153,11 +1140,10 @@ flat_mutation_reader_v2 make_multishard_combining_reader_v2( reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { const dht::sharder& sharder = schema->get_sharder(); - return make_flat_mutation_reader_v2(sharder, std::move(lifecycle_policy), std::move(schema), std::move(permit), pr, ps, pc, + return make_flat_mutation_reader_v2(sharder, std::move(lifecycle_policy), std::move(schema), std::move(permit), pr, ps, std::move(trace_state), fwd_mr); } @@ -1168,9 +1154,8 @@ flat_mutation_reader_v2 make_multishard_combining_reader_v2_for_tests( reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { - return make_flat_mutation_reader_v2(sharder, std::move(lifecycle_policy), std::move(schema), std::move(permit), pr, ps, pc, + return make_flat_mutation_reader_v2(sharder, std::move(lifecycle_policy), std::move(schema), std::move(permit), pr, ps, std::move(trace_state), fwd_mr); } diff --git a/readers/multishard.hh b/readers/multishard.hh index 2b1882ccc2..55480ec041 100644 --- a/readers/multishard.hh +++ b/readers/multishard.hh @@ -14,10 +14,6 @@ #include "tracing/trace_state.hh" #include "seastarx.hh" -namespace seastar { -class io_priority_class; -} - /// Reader lifecycle policy for the mulitshard combining reader. /// /// This policy is expected to make sure any additional resource the readers @@ -53,7 +49,6 @@ public: reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) = 0; @@ -131,7 +126,6 @@ flat_mutation_reader_v2 make_multishard_combining_reader_v2( reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state = nullptr, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::no); @@ -142,7 +136,6 @@ flat_mutation_reader_v2 make_multishard_combining_reader_v2_for_tests( reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state = nullptr, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::no); diff --git a/readers/mutation_readers.cc b/readers/mutation_readers.cc index 3bcf18c3b7..d109902356 100644 --- a/readers/mutation_readers.cc +++ b/readers/mutation_readers.cc @@ -515,11 +515,10 @@ public: const dht::partition_range& first_range, Generator generator, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state) : impl(s, std::move(permit)) , _generator(std::move(generator)) - , _reader(source.make_reader_v2(s, _permit, first_range, slice, pc, trace_state, streamed_mutation::forwarding::no, mutation_reader::forwarding::yes)) + , _reader(source.make_reader_v2(s, _permit, first_range, slice, trace_state, streamed_mutation::forwarding::no, mutation_reader::forwarding::yes)) { } @@ -576,7 +575,6 @@ public: class forwardable_empty_mutation_reader : public flat_mutation_reader_v2::impl { mutation_source _source; const query::partition_slice& _slice; - const io_priority_class& _pc; tracing::trace_state_ptr _trace_state; flat_mutation_reader_v2_opt _reader; public: @@ -584,12 +582,10 @@ public: reader_permit permit, mutation_source source, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state) : impl(s, std::move(permit)) , _source(std::move(source)) , _slice(slice) - , _pc(pc) , _trace_state(std::move(trace_state)) { _end_of_stream = true; } @@ -610,7 +606,7 @@ public: } virtual future<> fast_forward_to(const dht::partition_range& pr) override { if (!_reader) { - _reader = _source.make_reader_v2(_schema, _permit, pr, _slice, _pc, std::move(_trace_state), streamed_mutation::forwarding::no, + _reader = _source.make_reader_v2(_schema, _permit, pr, _slice, std::move(_trace_state), streamed_mutation::forwarding::no, mutation_reader::forwarding::yes); _end_of_stream = false; return make_ready_future<>(); @@ -639,7 +635,7 @@ public: }; flat_mutation_reader_v2 make_flat_multi_range_reader(schema_ptr s, reader_permit permit, mutation_source source, const dht::partition_range_vector& ranges, - const query::partition_slice& slice, const io_priority_class& pc, + const query::partition_slice& slice, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { @@ -660,16 +656,16 @@ make_flat_multi_range_reader(schema_ptr s, reader_permit permit, mutation_source if (ranges.empty()) { if (fwd_mr) { - return make_flat_mutation_reader_v2(std::move(s), std::move(permit), std::move(source), slice, pc, + return make_flat_mutation_reader_v2(std::move(s), std::move(permit), std::move(source), slice, std::move(trace_state)); } else { return make_empty_flat_reader_v2(std::move(s), std::move(permit)); } } else if (ranges.size() == 1) { - return source.make_reader_v2(std::move(s), std::move(permit), ranges.front(), slice, pc, std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr); + return source.make_reader_v2(std::move(s), std::move(permit), ranges.front(), slice, std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr); } else { return make_flat_mutation_reader_v2>(std::move(s), std::move(permit), std::move(source), - ranges.front(), adapter(std::next(ranges.cbegin()), ranges.cend()), slice, pc, std::move(trace_state)); + ranges.front(), adapter(std::next(ranges.cbegin()), ranges.cend()), slice, std::move(trace_state)); } } @@ -680,7 +676,6 @@ make_flat_multi_range_reader( mutation_source source, std::function()> generator, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { class adapter { @@ -709,13 +704,13 @@ make_flat_multi_range_reader( auto* first_range = adapted_generator(); if (!first_range) { if (fwd_mr) { - return make_flat_mutation_reader_v2(std::move(s), std::move(permit), std::move(source), slice, pc, std::move(trace_state)); + return make_flat_mutation_reader_v2(std::move(s), std::move(permit), std::move(source), slice, std::move(trace_state)); } else { return make_empty_flat_reader_v2(std::move(s), std::move(permit)); } } else { return make_flat_mutation_reader_v2>(std::move(s), std::move(permit), std::move(source), - *first_range, std::move(adapted_generator), slice, pc, std::move(trace_state)); + *first_range, std::move(adapted_generator), slice, std::move(trace_state)); } } @@ -1192,7 +1187,6 @@ mutation_source make_empty_mutation_source() { reader_permit permit, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr tr, streamed_mutation::forwarding fwd, mutation_reader::forwarding) { @@ -1209,14 +1203,13 @@ mutation_source make_combined_mutation_source(std::vector adden reader_permit permit, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr tr, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) { std::vector rd; rd.reserve(addends.size()); for (auto&& ms : addends) { - rd.emplace_back(ms.make_reader_v2(s, permit, pr, slice, pc, tr, fwd_sm, fwd_mr)); + rd.emplace_back(ms.make_reader_v2(s, permit, pr, slice, tr, fwd_sm, fwd_mr)); } return make_combined_reader(s, std::move(permit), std::move(rd), fwd_sm, fwd_mr); }); diff --git a/readers/mutation_source.hh b/readers/mutation_source.hh index e309694f36..4be2f1bb9d 100644 --- a/readers/mutation_source.hh +++ b/readers/mutation_source.hh @@ -8,7 +8,6 @@ #pragma once -#include #include "dht/i_partitioner.hh" #include "query-request.hh" #include "tracing/trace_state.hh" @@ -42,12 +41,10 @@ partition_presence_checker make_default_partition_presence_checker() { // Partition-range forwarding is not yet supported in reverse mode. class mutation_source { using partition_range = const dht::partition_range&; - using io_priority = const io_priority_class&; using flat_reader_v2_factory_type = std::function; @@ -66,36 +63,22 @@ public: , _presence_checker_factory(make_lw_shared>(std::move(pcf))) { } - mutation_source(std::function fn) : mutation_source([fn = std::move(fn)] (schema_ptr s, reader_permit permit, partition_range range, const query::partition_slice& slice, - io_priority pc, tracing::trace_state_ptr tr, streamed_mutation::forwarding fwd, mutation_reader::forwarding) { - return fn(std::move(s), std::move(permit), range, slice, pc, std::move(tr), fwd); - }) {} - mutation_source(std::function fn) - : mutation_source([fn = std::move(fn)] (schema_ptr s, - reader_permit permit, - partition_range range, - const query::partition_slice& slice, - io_priority pc, - tracing::trace_state_ptr, - streamed_mutation::forwarding fwd, - mutation_reader::forwarding) { - assert(!fwd); - return fn(std::move(s), std::move(permit), range, slice, pc); + return fn(std::move(s), std::move(permit), range, slice, std::move(tr), fwd); }) {} mutation_source(std::function fn) : mutation_source([fn = std::move(fn)] (schema_ptr s, reader_permit permit, partition_range range, const query::partition_slice& slice, - io_priority, tracing::trace_state_ptr, streamed_mutation::forwarding fwd, mutation_reader::forwarding) { @@ -107,7 +90,6 @@ public: reader_permit permit, partition_range range, const query::partition_slice&, - io_priority, tracing::trace_state_ptr, streamed_mutation::forwarding fwd, mutation_reader::forwarding) { @@ -126,13 +108,12 @@ public: reader_permit permit, partition_range range, const query::partition_slice& slice, - io_priority pc = default_priority_class(), tracing::trace_state_ptr trace_state = nullptr, streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::yes) const { return mutation_fragment_v1_stream( - (*_fn)(std::move(s), std::move(permit), range, slice, pc, std::move(trace_state), fwd, fwd_mr)); + (*_fn)(std::move(s), std::move(permit), range, slice, std::move(trace_state), fwd, fwd_mr)); } mutation_fragment_v1_stream @@ -155,12 +136,11 @@ public: reader_permit permit, partition_range range, const query::partition_slice& slice, - io_priority pc = default_priority_class(), tracing::trace_state_ptr trace_state = nullptr, streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::yes) const { - return (*_fn)(std::move(s), std::move(permit), range, slice, pc, std::move(trace_state), fwd, fwd_mr); + return (*_fn)(std::move(s), std::move(permit), range, slice, std::move(trace_state), fwd, fwd_mr); } flat_mutation_reader_v2 diff --git a/repair/repair.cc b/repair/repair.cc index 63a0bde1ed..911201e8c3 100644 --- a/repair/repair.cc +++ b/repair/repair.cc @@ -15,7 +15,6 @@ #include "gms/inet_address.hh" #include "utils/fb_utilities.hh" #include "gms/gossiper.hh" -#include "service/priority_manager.hh" #include "message/messaging_service.hh" #include "sstables/sstables.hh" #include "replica/database.hh" diff --git a/repair/row_level.cc b/repair/row_level.cc index 3c5d5fb513..4097445752 100644 --- a/repair/row_level.cc +++ b/repair/row_level.cc @@ -20,7 +20,6 @@ #include "utils/xx_hasher.hh" #include "utils/UUID.hh" #include "utils/hash.hh" -#include "service/priority_manager.hh" #include "replica/database.hh" #include #include @@ -291,7 +290,6 @@ private: reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr, streamed_mutation::forwarding, mutation_reader::forwarding fwd_mr) { @@ -304,7 +302,6 @@ private: _permit, _range, _schema->full_slice(), - service::get_local_streaming_priority(), {}, mutation_reader::forwarding::no); return rd; diff --git a/replica/database.cc b/replica/database.cc index b104a1bf6c..3bf001a0d1 100644 --- a/replica/database.cc +++ b/replica/database.cc @@ -321,7 +321,7 @@ database::database(const db::config& cfg, database_config dbcfg, service::migrat , _system_dirty_memory_manager(*this, 10 << 20, cfg.unspooled_dirty_soft_limit(), default_scheduling_group()) , _dirty_memory_manager(*this, dbcfg.available_memory * 0.50, cfg.unspooled_dirty_soft_limit(), dbcfg.statement_scheduling_group) , _dbcfg(dbcfg) - , _flush_sg(backlog_controller::scheduling_group{dbcfg.memtable_scheduling_group, service::get_local_memtable_flush_priority()}) + , _flush_sg(backlog_controller::scheduling_group{dbcfg.memtable_scheduling_group}) , _memtable_controller(make_flush_controller(_cfg, _flush_sg, [this, limit = float(_dirty_memory_manager.throttle_threshold())] { auto backlog = (_dirty_memory_manager.unspooled_dirty_memory()) / limit; if (_dirty_memory_manager.has_extraneous_flushes_requested()) { @@ -460,10 +460,6 @@ float backlog_controller::backlog_of_shares(float shares) const { void backlog_controller::update_controller(float shares) { _scheduling_group.cpu.set_shares(shares); - if (!_inflight_update.available()) { - return; // next timer will fix it - } - _inflight_update = _scheduling_group.io.update_shares(uint32_t(shares)); } @@ -2805,7 +2801,6 @@ flat_mutation_reader_v2 make_multishard_streaming_reader(distributedid(); - return make_multishard_combining_reader_v2(make_shared(db, table_id), std::move(s), std::move(permit), pr, ps, pc, + return make_multishard_combining_reader_v2(make_shared(db, table_id), std::move(s), std::move(permit), pr, ps, std::move(trace_state), fwd_mr); }); auto&& full_slice = schema->full_slice(); return make_flat_multi_range_reader(schema, std::move(permit), std::move(ms), - std::move(range_generator), std::move(full_slice), service::get_local_streaming_priority(), {}, mutation_reader::forwarding::no); + std::move(range_generator), std::move(full_slice), {}, mutation_reader::forwarding::no); } std::ostream& operator<<(std::ostream& os, gc_clock::time_point tp) { diff --git a/replica/database.hh b/replica/database.hh index c24dded72b..efb2a9ce4f 100644 --- a/replica/database.hh +++ b/replica/database.hh @@ -590,7 +590,6 @@ private: lw_shared_ptr sstables, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) const; @@ -614,7 +613,6 @@ private: const reader_permit& permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, const tracing::trace_state_ptr& trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, @@ -664,13 +662,10 @@ public: // Note: for data queries use query() instead. // The 'range' parameter must be live as long as the reader is used. // Mutations returned by the reader will all have given schema. - // If I/O needs to be issued to read anything in the specified range, the operations - // will be scheduled under the priority class given by pc. flat_mutation_reader_v2 make_reader_v2(schema_ptr schema, reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc = default_priority_class(), tracing::trace_state_ptr trace_state = nullptr, streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::yes) const; @@ -679,7 +674,6 @@ public: std::vector& sst, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc = default_priority_class(), tracing::trace_state_ptr trace_state = nullptr, streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::yes) const; @@ -1078,7 +1072,7 @@ public: private: future do_push_view_replica_updates(shared_ptr gen, schema_ptr s, mutation m, db::timeout_clock::time_point timeout, mutation_source source, - tracing::trace_state_ptr tr_state, reader_concurrency_semaphore& sem, const io_priority_class& io_priority, query::partition_slice::option_set custom_opts) const; + tracing::trace_state_ptr tr_state, reader_concurrency_semaphore& sem, query::partition_slice::option_set custom_opts) const; std::vector affected_views(shared_ptr gen, const schema_ptr& base, const mutation& update) const; future<> generate_and_propagate_view_updates(shared_ptr gen, const schema_ptr& base, reader_permit permit, diff --git a/replica/distributed_loader.cc b/replica/distributed_loader.cc index 40d333fe14..d248ff3aaa 100644 --- a/replica/distributed_loader.cc +++ b/replica/distributed_loader.cc @@ -26,7 +26,6 @@ #include "sstables/sstables.hh" #include "sstables/sstables_manager.hh" #include "sstables/sstable_directory.hh" -#include "service/priority_manager.hh" #include "auth/common.hh" #include "tracing/trace_keyspace_helper.hh" #include "db/view/view_update_checks.hh" @@ -222,7 +221,7 @@ distribute_reshard_jobs(sstables::sstable_directory::sstable_open_info_vector so // A creator function must be passed that will create an SSTable object in the correct shard, // and an I/O priority must be specified. future<> reshard(sstables::sstable_directory& dir, sstables::sstable_directory::sstable_open_info_vector shared_info, replica::table& table, - sstables::compaction_sstable_creator_fn creator, io_priority_class iop, compaction::owned_ranges_ptr owned_ranges_ptr) + sstables::compaction_sstable_creator_fn creator, compaction::owned_ranges_ptr owned_ranges_ptr) { // Resharding doesn't like empty sstable sets, so bail early. There is nothing // to reshard in this shard. @@ -253,7 +252,7 @@ future<> reshard(sstables::sstable_directory& dir, sstables::sstable_directory:: auto& t = table.as_table_state(); co_await coroutine::parallel_for_each(buckets, [&] (std::vector& sstlist) mutable { return table.get_compaction_manager().run_custom_job(table.as_table_state(), sstables::compaction_type::Reshard, "Reshard compaction", [&] (sstables::compaction_data& info) -> future<> { - sstables::compaction_descriptor desc(sstlist, iop); + sstables::compaction_descriptor desc(sstlist); desc.options = sstables::compaction_type_options::make_reshard(); desc.creator = creator; desc.owned_ranges = owned_ranges_ptr; @@ -268,7 +267,7 @@ future<> reshard(sstables::sstable_directory& dir, sstables::sstable_directory:: future<> run_resharding_jobs(sharded& dir, std::vector reshard_jobs, sharded& db, sstring ks_name, sstring table_name, sstables::compaction_sstable_creator_fn creator, - io_priority_class iop, compaction::owned_ranges_ptr owned_ranges_ptr) { + compaction::owned_ranges_ptr owned_ranges_ptr) { uint64_t total_size = boost::accumulate(reshard_jobs | boost::adaptors::transformed(std::mem_fn(&reshard_shard_descriptor::size)), uint64_t(0)); if (total_size == 0) { @@ -286,7 +285,7 @@ future<> run_resharding_jobs(sharded& dir, std::vec if (owned_ranges_ptr) { local_owned_ranges_ptr = make_lw_shared(*owned_ranges_ptr); } - co_await ::replica::reshard(d, std::move(info_vec), table, creator, iop, std::move(local_owned_ranges_ptr)); + co_await ::replica::reshard(d, std::move(info_vec), table, creator, std::move(local_owned_ranges_ptr)); co_await d.move_foreign_sstables(dir); })); @@ -300,10 +299,10 @@ future<> run_resharding_jobs(sharded& dir, std::vec // - The second part calls each shard's distributed object to reshard the SSTables they were // assigned. future<> -distributed_loader::reshard(sharded& dir, sharded& db, sstring ks_name, sstring table_name, sstables::compaction_sstable_creator_fn creator, io_priority_class iop, compaction::owned_ranges_ptr owned_ranges_ptr) { +distributed_loader::reshard(sharded& dir, sharded& db, sstring ks_name, sstring table_name, sstables::compaction_sstable_creator_fn creator, compaction::owned_ranges_ptr owned_ranges_ptr) { auto all_jobs = co_await collect_all_shared_sstables(dir, db, ks_name, table_name, owned_ranges_ptr); auto destinations = co_await distribute_reshard_jobs(std::move(all_jobs)); - co_await run_resharding_jobs(dir, std::move(destinations), db, ks_name, table_name, std::move(creator), iop, std::move(owned_ranges_ptr)); + co_await run_resharding_jobs(dir, std::move(destinations), db, ks_name, table_name, std::move(creator), std::move(owned_ranges_ptr)); } future @@ -317,7 +316,7 @@ highest_version_seen(sharded& dir, sstables::sstabl using sstable_filter_func_t = std::function; future reshape(sstables::sstable_directory& dir, replica::table& table, sstables::compaction_sstable_creator_fn creator, - sstables::reshape_mode mode, sstable_filter_func_t filter, io_priority_class iop) + sstables::reshape_mode mode, sstable_filter_func_t filter) { uint64_t reshaped_size = 0; @@ -326,7 +325,7 @@ future reshape(sstables::sstable_directory& dir, replica::table& table | boost::adaptors::filtered([&filter] (const auto& sst) { return filter(sst); })); - auto desc = table.get_compaction_strategy().get_reshaping_job(std::move(reshape_candidates), table.schema(), iop, mode); + auto desc = table.get_compaction_strategy().get_reshaping_job(std::move(reshape_candidates), table.schema(), mode); if (desc.sstables.empty()) { break; } @@ -375,12 +374,12 @@ future reshape(sstables::sstable_directory& dir, replica::table& table future<> distributed_loader::reshape(sharded& dir, sharded& db, sstables::reshape_mode mode, sstring ks_name, sstring table_name, sstables::compaction_sstable_creator_fn creator, - std::function filter, io_priority_class iop) { + std::function filter) { auto start = std::chrono::steady_clock::now(); - auto total_size = co_await dir.map_reduce0([&db, ks_name = std::move(ks_name), table_name = std::move(table_name), creator = std::move(creator), mode, filter, iop] (sstables::sstable_directory& d) { + auto total_size = co_await dir.map_reduce0([&db, ks_name = std::move(ks_name), table_name = std::move(table_name), creator = std::move(creator), mode, filter] (sstables::sstable_directory& d) { auto& table = db.local().find_column_family(ks_name, table_name); - return ::replica::reshape(d, table, creator, mode, filter, iop); + return ::replica::reshape(d, table, creator, mode, filter); }, uint64_t(0), std::plus()); if (total_size > 0) { @@ -440,8 +439,7 @@ distributed_loader::process_upload_dir(distributed& db, distr sharded_parameter([&global_table] { return std::ref(global_table->get_sstables_manager()); }), sharded_parameter([&global_table] { return global_table->schema(); }), sharded_parameter([&global_table] { return global_table->get_storage_options_ptr(); }), - upload, service::get_local_streaming_priority(), - &error_handler_gen_for_upload_dir + upload, &error_handler_gen_for_upload_dir ).get(); auto stop_directory = deferred_stop(directory); @@ -478,12 +476,9 @@ distributed_loader::process_upload_dir(distributed& db, distr // - split the keyspace local ranges per compaction_group as done in table::perform_cleanup_compaction // so that cleanup can be considered per compaction group auto owned_ranges_ptr = compaction::make_owned_ranges_ptr(db.local().get_keyspace_local_ranges(ks)); - reshard(directory, db, ks, cf, make_sstable, - service::get_local_streaming_priority(), - owned_ranges_ptr).get(); + reshard(directory, db, ks, cf, make_sstable, owned_ranges_ptr).get(); reshape(directory, db, sstables::reshape_mode::strict, ks, cf, make_sstable, - [] (const sstables::shared_sstable&) { return true; }, - service::get_local_streaming_priority()).get(); + [] (const sstables::shared_sstable&) { return true; }).get(); // Move to staging directory to avoid clashes with future uploads. Unique generation number ensures no collisions. const bool use_view_update_path = db::view::check_needs_view_update_path(sys_dist_ks.local(), db.local().get_token_metadata(), *global_table, streaming::stream_reason::repair).get0(); @@ -508,8 +503,7 @@ distributed_loader::get_sstables_from_upload_dir(distributed& sharded_parameter([&global_table] { return std::ref(global_table->get_sstables_manager()); }), sharded_parameter([&global_table] { return global_table->schema(); }), sharded_parameter([&global_table] { return global_table->get_storage_options_ptr(); }), - upload, service::get_local_streaming_priority(), - &error_handler_gen_for_upload_dir + upload, &error_handler_gen_for_upload_dir ).get(); auto stop = deferred_stop(directory); @@ -605,7 +599,7 @@ future<> table_populator::start_subdir(sstring subdir) { sharded_parameter([&global_table] { return std::ref(global_table->get_sstables_manager()); }), sharded_parameter([&global_table] { return global_table->schema(); }), sharded_parameter([&global_table] { return global_table->get_storage_options_ptr(); }), - fs::path(sstdir), default_priority_class(), + fs::path(sstdir), default_io_error_handler_gen() ); @@ -662,7 +656,7 @@ future<> table_populator::populate_subdir(sstring subdir, allow_offstrategy_comp }).get0(); return make_sstable(*_global_table, sstdir, gen, _highest_version); - }, default_priority_class()); + }); // The node is offline at this point so we are very lenient with what we consider // offstrategy. @@ -679,7 +673,7 @@ future<> table_populator::populate_subdir(sstring subdir, allow_offstrategy_comp co_await distributed_loader::reshape(directory, _db, sstables::reshape_mode::relaxed, _ks, _cf, [this, sstdir] (shard_id shard) { auto gen = _global_table->calculate_generation_for_new_table(); return make_sstable(*_global_table, sstdir, gen, _highest_version); - }, eligible_for_reshape_on_boot, default_priority_class()); + }, eligible_for_reshape_on_boot); co_await directory.invoke_on_all([this, &eligible_for_reshape_on_boot, do_allow_offstrategy_compaction] (sstables::sstable_directory& dir) -> future<> { co_await dir.do_for_each_sstable([this, &eligible_for_reshape_on_boot, do_allow_offstrategy_compaction] (sstables::shared_sstable sst) { diff --git a/replica/distributed_loader.hh b/replica/distributed_loader.hh index 7ef265589c..d7855721c9 100644 --- a/replica/distributed_loader.hh +++ b/replica/distributed_loader.hh @@ -67,9 +67,9 @@ class distributed_loader { friend class table_populator; static future<> reshape(sharded& dir, sharded& db, sstables::reshape_mode mode, - sstring ks_name, sstring table_name, sstables::compaction_sstable_creator_fn creator, std::function filter, io_priority_class iop); + sstring ks_name, sstring table_name, sstables::compaction_sstable_creator_fn creator, std::function filter); static future<> reshard(sharded& dir, sharded& db, sstring ks_name, sstring table_name, sstables::compaction_sstable_creator_fn creator, - io_priority_class iop, compaction::owned_ranges_ptr owned_ranges_ptr = nullptr); + compaction::owned_ranges_ptr owned_ranges_ptr = nullptr); static future<> process_sstable_dir(sharded& dir, sstables::sstable_directory::process_flags flags); static future<> lock_table(sharded& dir, sharded& db, sstring ks_name, sstring cf_name); static future make_sstables_available(sstables::sstable_directory& dir, diff --git a/replica/memtable-sstable.hh b/replica/memtable-sstable.hh index b3b3608cc5..29532c9117 100644 --- a/replica/memtable-sstable.hh +++ b/replica/memtable-sstable.hh @@ -14,7 +14,6 @@ #include "sstables/shared_sstable.hh" #include -#include class flat_mutation_reader_v2; class reader_permit; @@ -34,16 +33,14 @@ write_memtable_to_sstable(flat_mutation_reader_v2 reader, memtable& mt, sstables::shared_sstable sst, size_t estimated_partitions, sstables::write_monitor& monitor, - sstables::sstable_writer_config& cfg, - const seastar::io_priority_class& pc); + sstables::sstable_writer_config& cfg); seastar::future<> write_memtable_to_sstable(reader_permit permit, memtable& mt, sstables::shared_sstable sst, sstables::write_monitor& mon, - sstables::sstable_writer_config& cfg, - const seastar::io_priority_class& pc = seastar::default_priority_class()); + sstables::sstable_writer_config& cfg); seastar::future<> write_memtable_to_sstable(memtable& mt, diff --git a/replica/memtable.cc b/replica/memtable.cc index 0511fff5f7..a9246af37c 100644 --- a/replica/memtable.cc +++ b/replica/memtable.cc @@ -364,10 +364,9 @@ protected: flat_mutation_reader_v2 delegate_reader(reader_permit permit, const dht::partition_range& delegate, const query::partition_slice& slice, - const io_priority_class& pc, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { - auto ret = _memtable->_underlying->make_reader_v2(_schema, std::move(permit), delegate, slice, pc, nullptr, fwd, fwd_mr); + auto ret = _memtable->_underlying->make_reader_v2(_schema, std::move(permit), delegate, slice, nullptr, fwd, fwd_mr); _memtable = {}; _last = {}; return ret; @@ -400,7 +399,6 @@ public: class scanning_reader final : public flat_mutation_reader_v2::impl, private iterator_reader { std::optional _delegate_range; flat_mutation_reader_v2_opt _delegate; - const io_priority_class& _pc; const query::partition_slice& _slice; mutation_reader::forwarding _fwd_mr; @@ -436,11 +434,9 @@ public: reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, mutation_reader::forwarding fwd_mr) : impl(s, std::move(permit)) , iterator_reader(s, std::move(m), range) - , _pc(pc) , _slice(slice) , _fwd_mr(fwd_mr) { } @@ -450,7 +446,7 @@ public: if (!_delegate) { _delegate_range = get_delegate_range(); if (_delegate_range) { - _delegate = delegate_reader(_permit, *_delegate_range, _slice, _pc, streamed_mutation::forwarding::no, _fwd_mr); + _delegate = delegate_reader(_permit, *_delegate_range, _slice, streamed_mutation::forwarding::no, _fwd_mr); } else { auto key_and_snp = read_section()(region(), [&] () -> std::optional> { memtable_entry *e = fetch_entry(); @@ -704,7 +700,6 @@ memtable::make_flat_reader_opt(schema_ptr s, reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state_ptr, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { @@ -734,7 +729,7 @@ memtable::make_flat_reader_opt(schema_ptr s, rd.upgrade_schema(s); return rd; } else { - auto res = make_flat_mutation_reader_v2(std::move(s), shared_from_this(), std::move(permit), range, slice, pc, fwd_mr); + auto res = make_flat_mutation_reader_v2(std::move(s), shared_from_this(), std::move(permit), range, slice, fwd_mr); if (fwd == streamed_mutation::forwarding::yes) { return make_forwardable(std::move(res)); } else { @@ -744,13 +739,13 @@ memtable::make_flat_reader_opt(schema_ptr s, } flat_mutation_reader_v2 -memtable::make_flush_reader(schema_ptr s, reader_permit permit, const io_priority_class& pc) { +memtable::make_flush_reader(schema_ptr s, reader_permit permit) { if (!_merged_into_cache) { return make_flat_mutation_reader_v2(std::move(s), std::move(permit), shared_from_this()); } else { auto& full_slice = s->full_slice(); return make_flat_mutation_reader_v2(std::move(s), shared_from_this(), std::move(permit), - query::full_partition_range, full_slice, pc, mutation_reader::forwarding::no); + query::full_partition_range, full_slice, mutation_reader::forwarding::no); } } @@ -812,11 +807,10 @@ mutation_source memtable::as_data_source() { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { - return mt->make_flat_reader(std::move(s), std::move(permit), range, slice, pc, std::move(trace_state), fwd, fwd_mr); + return mt->make_flat_reader(std::move(s), std::move(permit), range, slice, std::move(trace_state), fwd, fwd_mr); }); } diff --git a/replica/memtable.hh b/replica/memtable.hh index c02a9f8340..a2ed39a3b9 100644 --- a/replica/memtable.hh +++ b/replica/memtable.hh @@ -236,11 +236,10 @@ public: reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc = default_priority_class(), tracing::trace_state_ptr trace_state_ptr = nullptr, streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::yes) { - if (auto reader_opt = make_flat_reader_opt(s, permit, range, slice, pc, std::move(trace_state_ptr), fwd, fwd_mr)) { + if (auto reader_opt = make_flat_reader_opt(s, permit, range, slice, std::move(trace_state_ptr), fwd, fwd_mr)) { return std::move(*reader_opt); } [[unlikely]] return make_empty_flat_reader_v2(std::move(s), std::move(permit)); @@ -251,7 +250,6 @@ public: reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc = default_priority_class(), tracing::trace_state_ptr trace_state_ptr = nullptr, streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::yes); @@ -263,7 +261,7 @@ public: return make_flat_reader(s, std::move(permit), range, full_slice); } - flat_mutation_reader_v2 make_flush_reader(schema_ptr, reader_permit permit, const io_priority_class& pc = default_priority_class()); + flat_mutation_reader_v2 make_flush_reader(schema_ptr, reader_permit permit); mutation_source as_data_source(); diff --git a/replica/table.cc b/replica/table.cc index 959d4ca86e..1660a797be 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -20,7 +20,6 @@ #include "replica/compaction_group.hh" #include "sstables/sstables.hh" #include "sstables/sstables_manager.hh" -#include "service/priority_manager.hh" #include "db/schema_tables.hh" #include "cell_locking.hh" #include "utils/logalloc.hh" @@ -94,7 +93,6 @@ table::make_sstable_reader(schema_ptr s, lw_shared_ptr sstables, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) const { @@ -109,9 +107,9 @@ table::make_sstable_reader(schema_ptr s, } return sstables->create_single_key_sstable_reader(const_cast(this), std::move(s), std::move(permit), - _stats.estimated_sstable_per_read, pr, slice, pc, std::move(trace_state), fwd, fwd_mr); + _stats.estimated_sstable_per_read, pr, slice, std::move(trace_state), fwd, fwd_mr); } else { - return sstables->make_local_shard_sstable_reader(std::move(s), std::move(permit), pr, slice, pc, + return sstables->make_local_shard_sstable_reader(std::move(s), std::move(permit), pr, slice, std::move(trace_state), fwd, fwd_mr); } } @@ -184,14 +182,13 @@ table::add_memtables_to_reader_list(std::vector& reader const reader_permit& permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, const tracing::trace_state_ptr& trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, std::function reserve_fn) const { auto add_memtables_from_cg = [&] (compaction_group& cg) mutable { for (auto&& mt: *cg.memtables()) { - if (auto reader_opt = mt->make_flat_reader_opt(s, permit, range, slice, pc, trace_state, fwd, fwd_mr)) { + if (auto reader_opt = mt->make_flat_reader_opt(s, permit, range, slice, trace_state, fwd, fwd_mr)) { readers.emplace_back(std::move(*reader_opt)); } } @@ -217,12 +214,11 @@ table::make_reader_v2(schema_ptr s, reader_permit permit, const dht::partition_range& range, const query::partition_slice& query_slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) const { if (_virtual_reader) [[unlikely]] { - return (*_virtual_reader).make_reader_v2(s, std::move(permit), range, query_slice, pc, trace_state, fwd, fwd_mr); + return (*_virtual_reader).make_reader_v2(s, std::move(permit), range, query_slice, trace_state, fwd, fwd_mr); } bool reversed = query_slice.is_reversed(); @@ -257,17 +253,17 @@ table::make_reader_v2(schema_ptr s, // https://github.com/scylladb/scylla/issues/309 // https://github.com/scylladb/scylla/issues/185 - add_memtables_to_reader_list(readers, s, permit, range, slice, pc, trace_state, fwd, fwd_mr, [&] (size_t memtable_count) { + add_memtables_to_reader_list(readers, s, permit, range, slice, trace_state, fwd, fwd_mr, [&] (size_t memtable_count) { readers.reserve(memtable_count + 1); }); const auto bypass_cache = slice.options.contains(query::partition_slice::option::bypass_cache); if (cache_enabled() && !bypass_cache && !(reversed && _config.reversed_reads_auto_bypass_cache())) { - if (auto reader_opt = _cache.make_reader_opt(s, permit, range, slice, pc, std::move(trace_state), fwd, fwd_mr)) { + if (auto reader_opt = _cache.make_reader_opt(s, permit, range, slice, std::move(trace_state), fwd, fwd_mr)) { readers.emplace_back(std::move(*reader_opt)); } } else { - readers.emplace_back(make_sstable_reader(s, permit, _sstables, range, slice, pc, std::move(trace_state), fwd, fwd_mr)); + readers.emplace_back(make_sstable_reader(s, permit, _sstables, range, slice, std::move(trace_state), fwd, fwd_mr)); } auto rd = make_combined_reader(s, permit, std::move(readers), fwd, fwd_mr); @@ -301,43 +297,40 @@ flat_mutation_reader_v2 table::make_streaming_reader(schema_ptr s, reader_permit permit, const dht::partition_range_vector& ranges) const { auto& slice = s->full_slice(); - auto& pc = service::get_local_streaming_priority(); auto source = mutation_source([this] (schema_ptr s, reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { + tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { std::vector readers; - add_memtables_to_reader_list(readers, s, permit, range, slice, pc, trace_state, fwd, fwd_mr, [&] (size_t memtable_count) { + add_memtables_to_reader_list(readers, s, permit, range, slice, trace_state, fwd, fwd_mr, [&] (size_t memtable_count) { readers.reserve(memtable_count + 1); }); - readers.emplace_back(make_sstable_reader(s, permit, _sstables, range, slice, pc, std::move(trace_state), fwd, fwd_mr)); + readers.emplace_back(make_sstable_reader(s, permit, _sstables, range, slice, std::move(trace_state), fwd, fwd_mr)); return make_combined_reader(s, std::move(permit), std::move(readers), fwd, fwd_mr); }); - return make_flat_multi_range_reader(s, std::move(permit), std::move(source), ranges, slice, pc, nullptr, mutation_reader::forwarding::no); + return make_flat_multi_range_reader(s, std::move(permit), std::move(source), ranges, slice, nullptr, mutation_reader::forwarding::no); } flat_mutation_reader_v2 table::make_streaming_reader(schema_ptr schema, reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, mutation_reader::forwarding fwd_mr) const { - const auto& pc = service::get_local_streaming_priority(); auto trace_state = tracing::trace_state_ptr(); const auto fwd = streamed_mutation::forwarding::no; std::vector readers; - add_memtables_to_reader_list(readers, schema, permit, range, slice, pc, trace_state, fwd, fwd_mr, [&] (size_t memtable_count) { + add_memtables_to_reader_list(readers, schema, permit, range, slice, trace_state, fwd, fwd_mr, [&] (size_t memtable_count) { readers.reserve(memtable_count + 1); }); - readers.emplace_back(make_sstable_reader(schema, permit, _sstables, range, slice, pc, std::move(trace_state), fwd, fwd_mr)); + readers.emplace_back(make_sstable_reader(schema, permit, _sstables, range, slice, std::move(trace_state), fwd, fwd_mr)); return make_combined_reader(std::move(schema), std::move(permit), std::move(readers), fwd, fwd_mr); } flat_mutation_reader_v2 table::make_streaming_reader(schema_ptr schema, reader_permit permit, const dht::partition_range& range, lw_shared_ptr sstables) const { auto& slice = schema->full_slice(); - const auto& pc = service::get_local_streaming_priority(); auto trace_state = tracing::trace_state_ptr(); const auto fwd = streamed_mutation::forwarding::no; const auto fwd_mr = mutation_reader::forwarding::no; - return sstables->make_range_sstable_reader(std::move(schema), std::move(permit), range, slice, pc, + return sstables->make_range_sstable_reader(std::move(schema), std::move(permit), range, slice, std::move(trace_state), fwd, fwd_mr); } @@ -878,7 +871,6 @@ table::try_flush_memtable_to_sstable(compaction_group& cg, lw_shared_ptr future<> { std::exception_ptr ex; try { - auto&& priority = service::get_local_memtable_flush_priority(); sstables::sstable_writer_config cfg = get_sstables_manager().configure_writer("memtable"); cfg.backup = incremental_backups_enabled(); @@ -889,7 +881,7 @@ table::try_flush_memtable_to_sstable(compaction_group& cg, lw_shared_ptrget_max_timestamp()); - co_return co_await write_memtable_to_sstable(std::move(reader), *old, newtab, estimated_partitions, monitor, cfg, priority); + co_return co_await write_memtable_to_sstable(std::move(reader), *old, newtab, estimated_partitions, monitor, cfg); } catch (...) { ex = std::current_exception(); } @@ -899,8 +891,7 @@ table::try_flush_memtable_to_sstable(compaction_group& cg, lw_shared_ptrmake_flush_reader( old->schema(), - compaction_concurrency_semaphore().make_tracking_only_permit(old->schema().get(), "try_flush_memtable_to_sstable()", db::no_timeout, {}), - service::get_local_memtable_flush_priority())); + compaction_concurrency_semaphore().make_tracking_only_permit(old->schema().get(), "try_flush_memtable_to_sstable()", db::no_timeout, {}))); // Switch back to default scheduling group for post-flush actions, to avoid them being staved by the memtable flush // controller. Cache update does not affect the input of the memtable cpu controller, so it can be subject to @@ -1589,11 +1580,10 @@ table::sstables_as_snapshot_source() { reader_permit permit, const dht::partition_range& r, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { - auto reader = make_sstable_reader(std::move(s), std::move(permit), sst_set, r, slice, pc, std::move(trace_state), fwd, fwd_mr); + auto reader = make_sstable_reader(std::move(s), std::move(permit), sst_set, r, slice, std::move(trace_state), fwd, fwd_mr); return make_compacting_reader( std::move(reader), gc_clock::now(), @@ -2296,21 +2286,19 @@ write_memtable_to_sstable(flat_mutation_reader_v2 reader, memtable& mt, sstables::shared_sstable sst, size_t estimated_partitions, sstables::write_monitor& monitor, - sstables::sstable_writer_config& cfg, - const io_priority_class& pc) { + sstables::sstable_writer_config& cfg) { cfg.replay_position = mt.replay_position(); cfg.monitor = &monitor; cfg.origin = "memtable"; schema_ptr s = reader.schema(); - return sst->write_components(std::move(reader), estimated_partitions, s, cfg, mt.get_encoding_stats(), pc); + return sst->write_components(std::move(reader), estimated_partitions, s, cfg, mt.get_encoding_stats()); } future<> write_memtable_to_sstable(reader_permit permit, memtable& mt, sstables::shared_sstable sst, sstables::write_monitor& monitor, - sstables::sstable_writer_config& cfg, - const io_priority_class& pc) { - return write_memtable_to_sstable(mt.make_flush_reader(mt.schema(), std::move(permit), pc), mt, std::move(sst), mt.partition_count(), monitor, cfg, pc); + sstables::sstable_writer_config& cfg) { + return write_memtable_to_sstable(mt.make_flush_reader(mt.schema(), std::move(permit)), mt, std::move(sst), mt.partition_count(), monitor, cfg); } future<> @@ -2400,8 +2388,7 @@ table::query(schema_ptr s, if (!querier_opt) { query::querier_base::querier_config conf(_config.tombstone_warn_threshold); - querier_opt = query::querier(as_mutation_source(), s, permit, range, qs.cmd.slice, - service::get_local_sstable_query_read_priority(), trace_state, conf); + querier_opt = query::querier(as_mutation_source(), s, permit, range, qs.cmd.slice, trace_state, conf); } auto& q = *querier_opt; @@ -2455,8 +2442,7 @@ table::mutation_query(schema_ptr s, } if (!querier_opt) { query::querier_base::querier_config conf(_config.tombstone_warn_threshold); - querier_opt = query::querier(as_mutation_source(), s, permit, range, cmd.slice, - service::get_local_sstable_query_read_priority(), trace_state, conf); + querier_opt = query::querier(as_mutation_source(), s, permit, range, cmd.slice, trace_state, conf); } auto& q = *querier_opt; @@ -2490,11 +2476,10 @@ table::as_mutation_source() const { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { - return this->make_reader_v2(std::move(s), std::move(permit), range, slice, pc, std::move(trace_state), fwd, fwd_mr); + return this->make_reader_v2(std::move(s), std::move(permit), range, slice, std::move(trace_state), fwd, fwd_mr); }); } @@ -2570,13 +2555,12 @@ table::make_reader_v2_excluding_sstables(schema_ptr s, std::vector& excluded, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) const { std::vector readers; - add_memtables_to_reader_list(readers, s, permit, range, slice, pc, trace_state, fwd, fwd_mr, [&] (size_t memtable_count) { + add_memtables_to_reader_list(readers, s, permit, range, slice, trace_state, fwd, fwd_mr, [&] (size_t memtable_count) { readers.reserve(memtable_count + 1); }); @@ -2589,7 +2573,7 @@ table::make_reader_v2_excluding_sstables(schema_ptr s, effective_sstables->insert(sst); }); - readers.emplace_back(make_sstable_reader(s, permit, std::move(effective_sstables), range, slice, pc, std::move(trace_state), fwd, fwd_mr)); + readers.emplace_back(make_sstable_reader(s, permit, std::move(effective_sstables), range, slice, std::move(trace_state), fwd, fwd_mr)); return make_combined_reader(s, std::move(permit), std::move(readers), fwd, fwd_mr); } @@ -2646,7 +2630,7 @@ future table::push_view_replica_updates(shared_ptr table::do_push_view_replica_updates(shared_ptr gen, schema_ptr s, mutation m, db::timeout_clock::time_point timeout, mutation_source source, - tracing::trace_state_ptr tr_state, reader_concurrency_semaphore& sem, const io_priority_class& io_priority, query::partition_slice::option_set custom_opts) const { + tracing::trace_state_ptr tr_state, reader_concurrency_semaphore& sem, query::partition_slice::option_set custom_opts) const { if (!_config.view_update_concurrency_semaphore->current()) { // We don't have resources to generate view updates for this write. If we reached this point, we failed to // throttle the client. The memory queue is already full, waiting on the semaphore would cause this node to @@ -2705,7 +2689,7 @@ future table::do_push_view_replica_updates(shared_ptrgenerate_and_propagate_view_updates(gen, base, std::move(permit), std::move(views), std::move(m), std::move(reader), tr_state, now); tracing::trace(tr_state, "View updates for {}.{} were generated and propagated", base->ks_name(), base->cf_name()); // return the local partition/row lock we have taken so it @@ -2718,7 +2702,7 @@ future table::do_push_view_replica_updates(shared_ptr table::push_view_replica_updates(shared_ptr gen, const schema_ptr& s, mutation&& m, db::timeout_clock::time_point timeout, tracing::trace_state_ptr tr_state, reader_concurrency_semaphore& sem) const { return do_push_view_replica_updates(std::move(gen), s, std::move(m), timeout, as_mutation_source(), - std::move(tr_state), sem, service::get_local_sstable_query_read_priority(), {}); + std::move(tr_state), sem, {}); } future @@ -2732,7 +2716,6 @@ table::stream_view_replica_updates(shared_ptr g as_mutation_source_excluding(excluded_sstables), tracing::trace_state_ptr(), *_config.streaming_read_concurrency_semaphore, - service::get_local_streaming_priority(), query::partition_slice::option_set::of()); } @@ -2742,11 +2725,10 @@ table::as_mutation_source_excluding(std::vector& ssts) reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { - return this->make_reader_v2_excluding_sstables(std::move(s), std::move(permit), ssts, range, slice, pc, std::move(trace_state), fwd, fwd_mr); + return this->make_reader_v2_excluding_sstables(std::move(s), std::move(permit), ssts, range, slice, std::move(trace_state), fwd, fwd_mr); }); } diff --git a/row_cache.cc b/row_cache.cc index 817e02051e..db319e8c8e 100644 --- a/row_cache.cc +++ b/row_cache.cc @@ -44,7 +44,7 @@ static schema_ptr to_query_domain(const query::partition_slice& slice, schema_pt flat_mutation_reader_v2 row_cache::create_underlying_reader(read_context& ctx, mutation_source& src, const dht::partition_range& pr) { schema_ptr entry_schema = to_query_domain(ctx.slice(), _schema); - auto reader = src.make_reader_v2(entry_schema, ctx.permit(), pr, ctx.slice(), ctx.pc(), ctx.trace_state(), streamed_mutation::forwarding::yes); + auto reader = src.make_reader_v2(entry_schema, ctx.permit(), pr, ctx.slice(), ctx.trace_state(), streamed_mutation::forwarding::yes); ctx.on_underlying_created(); return reader; } @@ -725,13 +725,12 @@ row_cache::make_reader_opt(schema_ptr s, reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { auto make_context = [&] { - return std::make_unique(*this, s, std::move(permit), range, slice, pc, trace_state, fwd_mr); + return std::make_unique(*this, s, std::move(permit), range, slice, trace_state, fwd_mr); }; if (query::is_single_partition(range) && !fwd_mr) { diff --git a/row_cache.hh b/row_cache.hh index 7e293f7b3c..10ecd35df3 100644 --- a/row_cache.hh +++ b/row_cache.hh @@ -361,11 +361,10 @@ public: reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc = default_priority_class(), tracing::trace_state_ptr trace_state = nullptr, streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::no) { - if (auto reader_opt = make_reader_opt(s, permit, range, slice, pc, std::move(trace_state), fwd, fwd_mr)) { + if (auto reader_opt = make_reader_opt(s, permit, range, slice, std::move(trace_state), fwd, fwd_mr)) { return std::move(*reader_opt); } [[unlikely]] return make_empty_flat_reader_v2(std::move(s), std::move(permit)); @@ -376,7 +375,6 @@ public: reader_permit permit, const dht::partition_range&, const query::partition_slice&, - const io_priority_class& = default_priority_class(), tracing::trace_state_ptr trace_state = nullptr, streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::no); diff --git a/scylla-gdb.py b/scylla-gdb.py index e61e563d1b..61991c0540 100755 --- a/scylla-gdb.py +++ b/scylla-gdb.py @@ -3518,6 +3518,21 @@ class scylla_io_queues(gdb.Command): gdb.write("{}\t{}\n".format(indent, scylla_io_queues.ticket(entry['_ticket']))) def _get_classes_infos(self, ioq): + # Starting from 5.3 priority classes are removed and IO inherits its name and + # shares from the respective sched group, so should the infos. Not to rely on + # gdb.parse_and_eval() to fail searching for _infos, use the secret knowledge: + # commitlog gained its sched group at the same time, so if not present, we're + # on some older version and should fallback to io-prio _infos (or worse) + infos = {} + commitlog_met = False + for tq in get_local_task_queues(): + name = str(tq['_name']) + if name == '"commitlog"': + commitlog_met = True + infos[int(tq['_id'])] = { 'name': name, 'shares': int(tq['_shares']) } + if commitlog_met: + return infos + try: return std_array(gdb.parse_and_eval('seastar::io_priority_class::_infos')) except gdb.error: diff --git a/service/CMakeLists.txt b/service/CMakeLists.txt index 5202482ac0..99dc61dbe2 100644 --- a/service/CMakeLists.txt +++ b/service/CMakeLists.txt @@ -12,7 +12,6 @@ target_sources(service paxos/prepare_response.cc paxos/prepare_summary.cc paxos/proposal.cc - priority_manager.cc qos/qos_common.cc qos/service_level_controller.cc qos/standard_service_level_distributed_data_accessor.cc diff --git a/service/priority_manager.cc b/service/priority_manager.cc deleted file mode 100644 index e4ee34b716..0000000000 --- a/service/priority_manager.cc +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2016-present ScyllaDB - */ -/* - * SPDX-License-Identifier: AGPL-3.0-or-later - */ -#include "priority_manager.hh" -#include - -namespace service { -priority_manager& get_local_priority_manager() { - static thread_local priority_manager pm = priority_manager(); - return pm; -} - -priority_manager::priority_manager() - : _commitlog_priority(::io_priority_class::register_one("commitlog", 1000)) - , _mt_flush_priority(::io_priority_class::register_one("memtable_flush", 1000)) - , _streaming_priority(::io_priority_class::register_one("streaming", 200)) - , _sstable_query_read(::io_priority_class::register_one("query", 1000)) - , _compaction_priority(::io_priority_class::register_one("compaction", 1000)) -{} - -} diff --git a/service/priority_manager.hh b/service/priority_manager.hh deleted file mode 100644 index d41f1956dd..0000000000 --- a/service/priority_manager.hh +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2016-present ScyllaDB - */ -/* - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -#pragma once - -#include - -#include "seastarx.hh" - -namespace service { -class priority_manager { - ::io_priority_class _commitlog_priority; - ::io_priority_class _mt_flush_priority; - ::io_priority_class _streaming_priority; - ::io_priority_class _sstable_query_read; - ::io_priority_class _compaction_priority; - -public: - const ::io_priority_class& - commitlog_priority() const { - return _commitlog_priority; - } - - const ::io_priority_class& - memtable_flush_priority() const { - return _mt_flush_priority; - } - - const ::io_priority_class& - streaming_priority() const { - return _streaming_priority; - } - - const ::io_priority_class& - sstable_query_read_priority() const { - return _sstable_query_read; - } - - const ::io_priority_class& - compaction_priority() const { - return _compaction_priority; - } - - priority_manager(); -}; - -priority_manager& get_local_priority_manager(); -const inline ::io_priority_class& -get_local_commitlog_priority() { - return get_local_priority_manager().commitlog_priority(); -} - -const inline ::io_priority_class& -get_local_memtable_flush_priority() { - return get_local_priority_manager().memtable_flush_priority(); -} - -const inline ::io_priority_class& -get_local_streaming_priority() { - return get_local_priority_manager().streaming_priority(); -} - -const inline ::io_priority_class& -get_local_sstable_query_read_priority() { - return get_local_priority_manager().sstable_query_read_priority(); -} - -const inline ::io_priority_class& -get_local_compaction_priority() { - return get_local_priority_manager().compaction_priority(); -} -} diff --git a/service/qos/service_level_controller.cc b/service/qos/service_level_controller.cc index e1041e596f..66eb0a384e 100644 --- a/service/qos/service_level_controller.cc +++ b/service/qos/service_level_controller.cc @@ -10,7 +10,6 @@ #include #include #include "service_level_controller.hh" -#include "service/priority_manager.hh" #include "message/messaging_service.hh" #include "db/system_distributed_keyspace.hh" #include "utils/fb_utilities.hh" diff --git a/service/storage_service.cc b/service/storage_service.cc index 1aaeda5e37..7e9aae8d14 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -59,7 +59,6 @@ #include "cdc/generation_service.hh" #include "repair/repair.hh" #include "repair/row_level.hh" -#include "service/priority_manager.hh" #include "gms/generation-number.hh" #include #include diff --git a/sstables/index_reader.hh b/sstables/index_reader.hh index ad6767c601..85accd43f0 100644 --- a/sstables/index_reader.hh +++ b/sstables/index_reader.hh @@ -335,7 +335,7 @@ std::unique_ptr promoted_index::make_cursor(shared_sstab return std::make_unique(*sst->get_schema(), _promoted_index_start, _promoted_index_size, promoted_index_cache_metrics, permit, - *ck_values_fixed_lengths, cached_file_ptr, options.io_priority_class, _num_blocks, trace_state); + *ck_values_fixed_lengths, cached_file_ptr, _num_blocks, trace_state); } auto file = make_tracked_index_file(*sst, permit, std::move(trace_state), caching); @@ -427,7 +427,6 @@ struct index_bound { class index_reader { shared_sstable _sstable; reader_permit _permit; - const io_priority_class& _pc; tracing::trace_state_ptr _trace_state; std::unique_ptr _local_index_cache; // Used when caching is disabled partition_index_cache& _index_cache; @@ -757,20 +756,17 @@ private: file_input_stream_options options; options.buffer_size = _sstable->sstable_buffer_size; options.read_ahead = 2; - options.io_priority_class = _pc; options.dynamic_adjustments = _sstable->_index_history; return options; } public: index_reader(shared_sstable sst, reader_permit permit, - const io_priority_class& pc = default_priority_class(), tracing::trace_state_ptr trace_state = {}, use_caching caching = use_caching::yes, bool single_partition_read = false) : _sstable(std::move(sst)) , _permit(std::move(permit)) - , _pc(pc) , _trace_state(std::move(trace_state)) , _local_index_cache(caching ? nullptr : std::make_unique(_sstable->manager().get_cache_tracker().get_lru(), diff --git a/sstables/integrity_checked_file_impl.cc b/sstables/integrity_checked_file_impl.cc index fb8bcafac8..ac5d926a87 100644 --- a/sstables/integrity_checked_file_impl.cc +++ b/sstables/integrity_checked_file_impl.cc @@ -41,7 +41,7 @@ static sstring report_zeroed_4k_aligned_blocks(const temporary_buffer& b } future -integrity_checked_file_impl::write_dma(uint64_t pos, const void* buffer, size_t len, const io_priority_class& pc) { +integrity_checked_file_impl::write_dma(uint64_t pos, const void* buffer, size_t len, io_intent* intent) { auto wbuf = temporary_buffer(static_cast(buffer), len); auto ret = report_zeroed_4k_aligned_blocks(wbuf); @@ -50,8 +50,8 @@ integrity_checked_file_impl::write_dma(uint64_t pos, const void* buffer, size_t "reason: 4k block(s) zeroed, follow their offsets: {}", _fname, len, pos, ret); } - return get_file_impl(_file)->write_dma(pos, buffer, len, pc) - .then([this, pos, wbuf = std::move(wbuf), buffer = static_cast(buffer), len, &pc] (size_t ret) mutable { + return get_file_impl(_file)->write_dma(pos, buffer, len, intent) + .then([this, pos, wbuf = std::move(wbuf), buffer = static_cast(buffer), len, intent] (size_t ret) mutable { if (ret != len) { sstlog.error("integrity check failed for {}, stage: after write finished, write: {} bytes to offset {}, " \ "reason: only {} bytes were written.", _fname, len, pos, ret); @@ -72,7 +72,7 @@ integrity_checked_file_impl::write_dma(uint64_t pos, const void* buffer, size_t return make_ready_future(ret); } - return _file.dma_read_exactly(pos, len, pc).then([this, pos, wbuf = std::move(wbuf), len, ret] (auto rbuf) mutable { + return _file.dma_read_exactly(pos, len, intent).then([this, pos, wbuf = std::move(wbuf), len, ret] (auto rbuf) mutable { if (rbuf.size() != len) { sstlog.error("integrity check failed for {}, stage: read after write finished, write: {} bytes to offset {}, " \ "reason: only able to read {} bytes for further verification", _fname, len, pos, rbuf.size()); @@ -96,9 +96,9 @@ integrity_checked_file_impl::write_dma(uint64_t pos, const void* buffer, size_t } future -integrity_checked_file_impl::write_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) { +integrity_checked_file_impl::write_dma(uint64_t pos, std::vector iov, io_intent* intent) { // TODO: check integrity before and after file_impl::write_dma() like write_dma() above. - return get_file_impl(_file)->write_dma(pos, iov, pc); + return get_file_impl(_file)->write_dma(pos, iov, intent); } inline file make_integrity_checked_file(std::string_view name, file f) { diff --git a/sstables/integrity_checked_file_impl.hh b/sstables/integrity_checked_file_impl.hh index 6301d099c5..e9a6c34f22 100644 --- a/sstables/integrity_checked_file_impl.hh +++ b/sstables/integrity_checked_file_impl.hh @@ -22,16 +22,16 @@ class integrity_checked_file_impl : public file_impl { public: integrity_checked_file_impl(sstring fname, file f); - virtual future write_dma(uint64_t pos, const void* buffer, size_t len, const io_priority_class& pc) override; + virtual future write_dma(uint64_t pos, const void* buffer, size_t len, io_intent*) override; - virtual future write_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override; + virtual future write_dma(uint64_t pos, std::vector iov, io_intent*) override; - virtual future read_dma(uint64_t pos, void* buffer, size_t len, const io_priority_class& pc) override { - return get_file_impl(_file)->read_dma(pos, buffer, len, pc); + virtual future read_dma(uint64_t pos, void* buffer, size_t len, io_intent* intent) override { + return get_file_impl(_file)->read_dma(pos, buffer, len, intent); } - virtual future read_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { - return get_file_impl(_file)->read_dma(pos, iov, pc); + virtual future read_dma(uint64_t pos, std::vector iov, io_intent* intent) override { + return get_file_impl(_file)->read_dma(pos, iov, intent); } virtual future<> flush(void) override { @@ -72,8 +72,8 @@ public: return get_file_impl(_file)->list_directory(next); } - virtual future> dma_read_bulk(uint64_t offset, size_t range_size, const io_priority_class& pc) override { - return get_file_impl(_file)->dma_read_bulk(offset, range_size, pc); + virtual future> dma_read_bulk(uint64_t offset, size_t range_size, io_intent* intent) override { + return get_file_impl(_file)->dma_read_bulk(offset, range_size, intent); } private: sstring _fname; diff --git a/sstables/kl/reader.cc b/sstables/kl/reader.cc index b68c7ab969..8f71c75ea0 100644 --- a/sstables/kl/reader.cc +++ b/sstables/kl/reader.cc @@ -87,7 +87,6 @@ public: class mp_row_consumer_k_l { reader_permit _permit; tracing::trace_state_ptr _trace_state; - const io_priority_class& _pc; public: using proceed = data_consumer::proceed; @@ -380,13 +379,11 @@ public: const schema_ptr schema, reader_permit permit, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, const shared_sstable& sst) : _permit(std::move(permit)) , _trace_state(std::move(trace_state)) - , _pc(pc) , _reader(reader) , _sst(sst) , _schema(schema) @@ -399,11 +396,10 @@ public: mp_row_consumer_k_l(mp_row_consumer_reader_k_l* reader, const schema_ptr schema, reader_permit permit, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, const shared_sstable& sst) - : mp_row_consumer_k_l(reader, schema, std::move(permit), schema->full_slice(), pc, std::move(trace_state), fwd, sst) { } + : mp_row_consumer_k_l(reader, schema, std::move(permit), schema->full_slice(), std::move(trace_state), fwd, sst) { } // Consume the row's key and deletion_time. The latter determines if the // row is a tombstone, and if so, when it has been deleted. @@ -915,10 +911,6 @@ public: sstlog.trace("mp_row_consumer_k_l {}: advance_context({})", fmt::ptr(this), _ck_ranges_walker->lower_bound()); return _ck_ranges_walker->lower_bound(); } - // Under which priority class to place I/O coming from this consumer - const io_priority_class& io_priority() const { - return _pc; - } // The permit for this read reader_permit& permit() { @@ -1161,13 +1153,12 @@ public: reader_permit permit, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, read_monitor& mon) : mp_row_consumer_reader_k_l(std::move(schema), permit, std::move(sst)) - , _consumer(this, _schema, std::move(permit), slice, pc, std::move(trace_state), fwd, _sst) + , _consumer(this, _schema, std::move(permit), slice, std::move(trace_state), fwd, _sst) // FIXME: I want to add `&& fwd_mr == mutation_reader::forwarding::no` below // but can't because many call sites use the default value for // `mutation_reader::forwarding` which is `yes`. @@ -1196,7 +1187,7 @@ private: index_reader& get_index_reader() { if (!_index_reader) { auto caching = use_caching(global_cache_index_pages && !_slice.options.contains(query::partition_slice::option::bypass_cache)); - _index_reader = std::make_unique(_sst, _consumer.permit(), _consumer.io_priority(), + _index_reader = std::make_unique(_sst, _consumer.permit(), _consumer.trace_state(), caching, _single_partition_read); } return *_index_reader; @@ -1501,13 +1492,12 @@ flat_mutation_reader_v2 make_reader( reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, read_monitor& monitor) { return make_flat_mutation_reader_v2( - std::move(sstable), std::move(schema), std::move(permit), range, slice, pc, std::move(trace_state), fwd, fwd_mr, monitor); + std::move(sstable), std::move(schema), std::move(permit), range, slice, std::move(trace_state), fwd, fwd_mr, monitor); } class crawling_sstable_mutation_reader : public mp_row_consumer_reader_k_l { @@ -1520,11 +1510,10 @@ class crawling_sstable_mutation_reader : public mp_row_consumer_reader_k_l { public: crawling_sstable_mutation_reader(shared_sstable sst, schema_ptr schema, reader_permit permit, - const io_priority_class &pc, tracing::trace_state_ptr trace_state, read_monitor& mon) : mp_row_consumer_reader_k_l(std::move(schema), permit, std::move(sst)) - , _consumer(this, _schema, std::move(permit), _schema->full_slice(), pc, std::move(trace_state), streamed_mutation::forwarding::no, _sst) + , _consumer(this, _schema, std::move(permit), _schema->full_slice(), std::move(trace_state), streamed_mutation::forwarding::no, _sst) , _context(data_consume_rows(*_schema, _sst, _consumer)) , _monitor(mon) { _monitor.on_read_started(_context->reader_position()); @@ -1567,10 +1556,9 @@ flat_mutation_reader_v2 make_crawling_reader( shared_sstable sstable, schema_ptr schema, reader_permit permit, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, read_monitor& monitor) { - return make_flat_mutation_reader_v2(std::move(sstable), std::move(schema), std::move(permit), pc, + return make_flat_mutation_reader_v2(std::move(sstable), std::move(schema), std::move(permit), std::move(trace_state), monitor); } diff --git a/sstables/kl/reader.hh b/sstables/kl/reader.hh index 941b651161..f429cba0f1 100644 --- a/sstables/kl/reader.hh +++ b/sstables/kl/reader.hh @@ -11,7 +11,6 @@ #include "readers/flat_mutation_reader_fwd.hh" #include "readers/flat_mutation_reader_v2.hh" #include "sstables/progress_monitor.hh" -#include namespace sstables { namespace kl { @@ -22,7 +21,6 @@ flat_mutation_reader_v2 make_reader( reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, @@ -34,7 +32,6 @@ flat_mutation_reader_v2 make_crawling_reader( shared_sstable sstable, schema_ptr schema, reader_permit permit, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, read_monitor& monitor); diff --git a/sstables/mx/bsearch_clustered_cursor.hh b/sstables/mx/bsearch_clustered_cursor.hh index 856c608394..7e62ac2993 100644 --- a/sstables/mx/bsearch_clustered_cursor.hh +++ b/sstables/mx/bsearch_clustered_cursor.hh @@ -159,7 +159,6 @@ public: uint64_t _promoted_index_size; metrics& _metrics; const pi_index_type _blocks_count; - const io_priority_class _pc; cached_file& _cached_file; data_consumer::primitive_consumer _primitive_parser; clustering_parser _clustering_parser; @@ -193,7 +192,7 @@ private: } future read_block_offset(pi_index_type idx, tracing::trace_state_ptr trace_state) { - _stream = _cached_file.read(_promoted_index_start + get_offset_entry_pos(idx), _pc, _permit, trace_state); + _stream = _cached_file.read(_promoted_index_start + get_offset_entry_pos(idx), _permit, trace_state); return _stream.next_page_view().then([this] (cached_file::page_view page) { temporary_buffer buf = page.get_buf(); static_assert(noexcept(std::declval().read_32(buf))); @@ -209,7 +208,7 @@ private: // Postconditions: // - block.start is engaged and valid. future<> read_block_start(promoted_index_block& block, tracing::trace_state_ptr trace_state) { - _stream = _cached_file.read(_promoted_index_start + block.offset, _pc, _permit, trace_state); + _stream = _cached_file.read(_promoted_index_start + block.offset, _permit, trace_state); _clustering_parser.reset(); return consume_stream(_stream, _clustering_parser).then([this, &block] { auto mem_before = block.memory_usage(); @@ -221,7 +220,7 @@ private: // Postconditions: // - block.end is engaged, all fields in the block are valid future<> read_block(promoted_index_block& block, tracing::trace_state_ptr trace_state) { - _stream = _cached_file.read(_promoted_index_start + block.offset, _pc, _permit, trace_state); + _stream = _cached_file.read(_promoted_index_start + block.offset, _permit, trace_state); _block_parser.reset(); return consume_stream(_stream, _block_parser).then([this, &block] { auto mem_before = block.memory_usage(); @@ -267,7 +266,6 @@ public: reader_permit permit, column_values_fixed_lengths cvfl, cached_file& f, - io_priority_class pc, pi_index_type blocks_count) : _blocks(block_comparator{s}) , _s(s) @@ -275,7 +273,6 @@ public: , _promoted_index_size(promoted_index_size) , _metrics(m) , _blocks_count(blocks_count) - , _pc(pc) , _cached_file(f) , _primitive_parser(permit) , _clustering_parser(s, permit, cvfl, true) @@ -441,7 +438,6 @@ public: reader_permit permit, column_values_fixed_lengths cvfl, seastar::shared_ptr f, - io_priority_class pc, pi_index_type blocks_count, tracing::trace_state_ptr trace_state) : _s(s) @@ -454,7 +450,6 @@ public: std::move(permit), std::move(cvfl), *_cached_file, - pc, blocks_count) , _trace_state(std::move(trace_state)) { } diff --git a/sstables/mx/partition_reversing_data_source.cc b/sstables/mx/partition_reversing_data_source.cc index a63e77f225..66e0ddf1b3 100644 --- a/sstables/mx/partition_reversing_data_source.cc +++ b/sstables/mx/partition_reversing_data_source.cc @@ -365,7 +365,6 @@ class partition_reversing_data_source_impl final : public data_source_impl { const schema& _schema; shared_sstable _sst; index_reader& _ir; - const ::io_priority_class& _io_priority; reader_permit _permit; tracing::trace_state_ptr _trace_state; std::optional _partition_header_context; @@ -403,10 +402,10 @@ class partition_reversing_data_source_impl final : public data_source_impl { } _state = state::RANGE_END; private: input_stream data_stream(size_t start, size_t end) { - return _sst->data_stream(start, end - start, _io_priority, _permit, _trace_state, {}); + return _sst->data_stream(start, end - start, _permit, _trace_state, {}); } future> data_read(uint64_t start, uint64_t end) { - return _sst->data_read(start, end - start, _io_priority, _permit); + return _sst->data_read(start, end - start, _permit); } future> last_row_stream(size_t row_size) { if (_cached_read.size() < row_size) { @@ -457,12 +456,10 @@ public: uint64_t partition_start, size_t partition_len, reader_permit permit, - const io_priority_class& io_priority, tracing::trace_state_ptr trace_state) : _schema(s) , _sst(std::move(sst)) , _ir(ir) - , _io_priority(io_priority) , _permit(std::move(permit)) , _trace_state(std::move(trace_state)) , _partition_start(partition_start) @@ -606,9 +603,9 @@ public: }; partition_reversing_data_source make_partition_reversing_data_source(const schema& s, shared_sstable sst, index_reader& ir, uint64_t pos, size_t len, - reader_permit permit, const io_priority_class& io_priority, tracing::trace_state_ptr trace_state) { + reader_permit permit, tracing::trace_state_ptr trace_state) { auto source_impl = std::make_unique( - s, std::move(sst), ir, pos, len, std::move(permit), io_priority, trace_state); + s, std::move(sst), ir, pos, len, std::move(permit), trace_state); auto& curr_pos = source_impl->current_position_in_sstable(); return partition_reversing_data_source { .the_source = seastar::data_source{std::move(source_impl)}, diff --git a/sstables/mx/partition_reversing_data_source.hh b/sstables/mx/partition_reversing_data_source.hh index 18e6117aaa..4e26c2182c 100644 --- a/sstables/mx/partition_reversing_data_source.hh +++ b/sstables/mx/partition_reversing_data_source.hh @@ -9,7 +9,6 @@ #pragma once #include -#include #include "reader_permit.hh" #include "sstables/index_reader.hh" #include "sstables/shared_sstable.hh" @@ -45,7 +44,7 @@ struct partition_reversing_data_source { // The source must be closed before destruction unless `get()` was never called. partition_reversing_data_source make_partition_reversing_data_source( const schema& s, shared_sstable sst, index_reader& ir, uint64_t pos, size_t len, - reader_permit permit, const io_priority_class& io_priority, tracing::trace_state_ptr trace_state); + reader_permit permit, tracing::trace_state_ptr trace_state); } } diff --git a/sstables/mx/reader.cc b/sstables/mx/reader.cc index 7e5e1c0d4c..5bb8b8eb71 100644 --- a/sstables/mx/reader.cc +++ b/sstables/mx/reader.cc @@ -49,7 +49,6 @@ class mp_row_consumer_m { reader_permit _permit; const shared_sstable& _sst; tracing::trace_state_ptr _trace_state; - const io_priority_class& _pc; public: mp_row_consumer_reader_mx* _reader; @@ -204,14 +203,12 @@ public: const schema_ptr schema, reader_permit permit, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, const shared_sstable& sst) : _permit(std::move(permit)) , _sst(sst) , _trace_state(std::move(trace_state)) - , _pc(pc) , _reader(reader) , _schema(schema) , _slice(slice) @@ -225,11 +222,10 @@ public: mp_row_consumer_m(mp_row_consumer_reader_mx* reader, const schema_ptr schema, reader_permit permit, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, const shared_sstable& sst) - : mp_row_consumer_m(reader, schema, std::move(permit), schema->full_slice(), pc, std::move(trace_state), fwd, sst) + : mp_row_consumer_m(reader, schema, std::move(permit), schema->full_slice(), std::move(trace_state), fwd, sst) { } ~mp_row_consumer_m() {} @@ -651,11 +647,6 @@ public: return position_in_partition_view::for_partition_start(); } - // Under which priority class to place I/O coming from this consumer - const io_priority_class& io_priority() const { - return _pc; - } - // The permit for this read reader_permit& permit() { return _permit; @@ -686,7 +677,6 @@ requires requires( bound_kind kind, sstables::bound_kind_m kind_m) { { c.permit() } -> std::convertible_to; - { c.io_priority() } -> std::same_as; { c.trace_state() } -> std::same_as; { c.consume_partition_start(pk_view, deltime) } -> std::same_as; { c.consume_static_row_start() } -> std::same_as; @@ -1314,7 +1304,6 @@ public: reader_permit permit, const dht::partition_range& pr, value_or_reference slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, @@ -1322,7 +1311,7 @@ public: : mp_row_consumer_reader_mx(std::move(schema), permit, std::move(sst)) , _slice_holder(std::move(slice)) , _slice(_slice_holder.get()) - , _consumer(this, _schema, std::move(permit), _slice, pc, std::move(trace_state), fwd, _sst) + , _consumer(this, _schema, std::move(permit), _slice, std::move(trace_state), fwd, _sst) // FIXME: I want to add `&& fwd_mr == mutation_reader::forwarding::no` below // but can't because many call sites use the default value for // `mutation_reader::forwarding` which is `yes`. @@ -1361,7 +1350,7 @@ private: index_reader& get_index_reader() { if (!_index_reader) { auto caching = use_caching(global_cache_index_pages && !_slice.options.contains(query::partition_slice::option::bypass_cache)); - _index_reader = std::make_unique(_sst, _consumer.permit(), _consumer.io_priority(), + _index_reader = std::make_unique(_sst, _consumer.permit(), _consumer.trace_state(), caching, _single_partition_read); } return *_index_reader; @@ -1724,7 +1713,6 @@ static flat_mutation_reader_v2 make_reader( reader_permit permit, const dht::partition_range& range, value_or_reference slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, @@ -1737,12 +1725,12 @@ static flat_mutation_reader_v2 make_reader( if (slice.get().is_reversed()) { return make_flat_mutation_reader_v2( std::move(sstable), schema, std::move(permit), range, - legacy_reverse_slice_to_native_reverse_slice(*schema, slice.get()), pc, std::move(trace_state), fwd, fwd_mr, monitor); + legacy_reverse_slice_to_native_reverse_slice(*schema, slice.get()), std::move(trace_state), fwd, fwd_mr, monitor); } return make_flat_mutation_reader_v2( std::move(sstable), std::move(schema), std::move(permit), range, - std::move(slice), pc, std::move(trace_state), fwd, fwd_mr, monitor); + std::move(slice), std::move(trace_state), fwd, fwd_mr, monitor); } flat_mutation_reader_v2 make_reader( @@ -1751,13 +1739,12 @@ flat_mutation_reader_v2 make_reader( reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, read_monitor& monitor) { return make_reader(std::move(sstable), std::move(schema), std::move(permit), range, - value_or_reference(slice), pc, std::move(trace_state), fwd, fwd_mr, monitor); + value_or_reference(slice), std::move(trace_state), fwd, fwd_mr, monitor); } flat_mutation_reader_v2 make_reader( @@ -1766,13 +1753,12 @@ flat_mutation_reader_v2 make_reader( reader_permit permit, const dht::partition_range& range, query::partition_slice&& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, read_monitor& monitor) { return make_reader(std::move(sstable), std::move(schema), std::move(permit), range, - value_or_reference(std::move(slice)), pc, std::move(trace_state), fwd, fwd_mr, monitor); + value_or_reference(std::move(slice)), std::move(trace_state), fwd, fwd_mr, monitor); } class mx_crawling_sstable_mutation_reader : public mp_row_consumer_reader_mx { @@ -1785,11 +1771,10 @@ class mx_crawling_sstable_mutation_reader : public mp_row_consumer_reader_mx { public: mx_crawling_sstable_mutation_reader(shared_sstable sst, schema_ptr schema, reader_permit permit, - const io_priority_class &pc, tracing::trace_state_ptr trace_state, read_monitor& mon) : mp_row_consumer_reader_mx(std::move(schema), permit, std::move(sst)) - , _consumer(this, _schema, std::move(permit), _schema->full_slice(), pc, std::move(trace_state), streamed_mutation::forwarding::no, _sst) + , _consumer(this, _schema, std::move(permit), _schema->full_slice(), std::move(trace_state), streamed_mutation::forwarding::no, _sst) , _context(data_consume_rows(*_schema, _sst, _consumer)) , _monitor(mon) { _monitor.on_read_started(_context->reader_position()); @@ -1830,10 +1815,9 @@ flat_mutation_reader_v2 make_crawling_reader( shared_sstable sstable, schema_ptr schema, reader_permit permit, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, read_monitor& monitor) { - return make_flat_mutation_reader_v2(std::move(sstable), std::move(schema), std::move(permit), pc, + return make_flat_mutation_reader_v2(std::move(sstable), std::move(schema), std::move(permit), std::move(trace_state), monitor); } @@ -1875,7 +1859,6 @@ public: private: schema_ptr _schema; reader_permit _permit; - const io_priority_class& _pc; std::function _error_handler; // For static-compact tables C* stores the only row in the static row but in our representation they're regular rows. const bool _treat_static_row_as_regular; @@ -1922,10 +1905,9 @@ private: } public: - validating_consumer(const schema_ptr schema, reader_permit permit, const io_priority_class& pc, const shared_sstable& sst, std::function error_handler) + validating_consumer(const schema_ptr schema, reader_permit permit, const shared_sstable& sst, std::function error_handler) : _schema(schema) , _permit(std::move(permit)) - , _pc(pc) , _error_handler(std::move(error_handler)) , _treat_static_row_as_regular(_schema->is_static_compact_table() && (!sst->has_scylla_component() || sst->features().is_enabled(sstable_feature::CorrectStaticCompact))) // See #4139 @@ -1935,7 +1917,6 @@ public: } const reader_permit& permit() const { return _permit; } - const io_priority_class& io_priority() const { return _pc; } tracing::trace_state_ptr trace_state() { return {}; } uint64_t error_count() const { return _error_count; } position_in_partition_view current_position() const { return _current_pos; } @@ -2069,15 +2050,14 @@ public: future validate( shared_sstable sstable, reader_permit permit, - const io_priority_class& pc, abort_source& abort, std::function error_handler) { auto schema = sstable->get_schema(); - validating_consumer consumer(schema, permit, pc, sstable, std::move(error_handler)); + validating_consumer consumer(schema, permit, sstable, std::move(error_handler)); auto context = data_consume_rows>(*schema, sstable, consumer); std::optional idx_reader; - idx_reader.emplace(sstable, permit, pc, tracing::trace_state_ptr{}, sstables::use_caching::no, false); + idx_reader.emplace(sstable, permit, tracing::trace_state_ptr{}, sstables::use_caching::no, false); try { while (!context->eof() && !abort.abort_requested()) { diff --git a/sstables/mx/reader.hh b/sstables/mx/reader.hh index d67427ab1d..88c56f3c96 100644 --- a/sstables/mx/reader.hh +++ b/sstables/mx/reader.hh @@ -11,7 +11,6 @@ #include "readers/flat_mutation_reader_fwd.hh" #include "readers/flat_mutation_reader_v2.hh" #include "sstables/progress_monitor.hh" -#include namespace sstables { namespace mx { @@ -27,7 +26,6 @@ flat_mutation_reader_v2 make_reader( reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, @@ -40,7 +38,6 @@ flat_mutation_reader_v2 make_reader( reader_permit permit, const dht::partition_range& range, query::partition_slice&& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, @@ -52,7 +49,6 @@ flat_mutation_reader_v2 make_crawling_reader( shared_sstable sstable, schema_ptr schema, reader_permit permit, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, read_monitor& monitor); @@ -62,7 +58,6 @@ flat_mutation_reader_v2 make_crawling_reader( future validate( shared_sstable sstable, reader_permit permit, - const io_priority_class& pc, abort_source& abort, std::function error_handler); diff --git a/sstables/mx/writer.cc b/sstables/mx/writer.cc index efe5107f93..aed4c74036 100644 --- a/sstables/mx/writer.cc +++ b/sstables/mx/writer.cc @@ -749,8 +749,8 @@ public: writer(sstable& sst, const schema& s, uint64_t estimated_partitions, const sstable_writer_config& cfg, encoding_stats enc_stats, - const io_priority_class& pc, shard_id shard = this_shard_id()) - : sstable_writer::writer_impl(sst, s, pc, cfg) + shard_id shard = this_shard_id()) + : sstable_writer::writer_impl(sst, s, cfg) , _enc_stats(enc_stats) , _shard(shard) , _tmp_bufs(_sst.sstable_buffer_size) @@ -788,7 +788,7 @@ public: // exactly what callers used to do anyway. estimated_partitions = std::max(uint64_t(1), estimated_partitions); - _sst.open_sstable(_pc); + _sst.open_sstable(); _sst.create_data().get(); _compression_enabled = !_sst.has_component(component_type::CRC); init_file_writers(); @@ -874,7 +874,7 @@ void writer::maybe_add_pi_block() { } void writer::init_file_writers() { - auto out = _sst._storage->make_data_or_index_sink(_sst, component_type::Data, _pc).get0(); + auto out = _sst._storage->make_data_or_index_sink(_sst, component_type::Data).get0(); if (!_compression_enabled) { _data_writer = std::make_unique(std::move(out), _sst.sstable_buffer_size, _sst.filename(component_type::Data)); @@ -886,7 +886,7 @@ void writer::init_file_writers() { _schema.get_compressor_params()), _sst.filename(component_type::Data)); } - out = _sst._storage->make_data_or_index_sink(_sst, component_type::Index, _pc).get0(); + out = _sst._storage->make_data_or_index_sink(_sst, component_type::Index).get0(); _index_writer = std::make_unique(output_stream(std::move(out)), _sst.filename(component_type::Index)); } @@ -1456,10 +1456,10 @@ void writer::consume_end_of_stream() { _sst._schema->get_partitioner().name(), _schema.bloom_filter_fp_chance(), _sst._schema, _sst.get_first_decorated_key(), _sst.get_last_decorated_key(), _enc_stats); close_data_writer(); - _sst.write_summary(_pc); - _sst.write_filter(_pc); - _sst.write_statistics(_pc); - _sst.write_compression(_pc); + _sst.write_summary(); + _sst.write_filter(); + _sst.write_statistics(); + _sst.write_compression(); auto features = sstable_enabled_features::all(); run_identifier identifier{_run_identifier}; std::optional ld_stats(scylla_metadata::large_data_stats{ @@ -1471,7 +1471,7 @@ void writer::consume_end_of_stream() { { large_data_type::elements_in_collection, std::move(_elements_in_collection_entry) }, } }); - _sst.write_scylla_metadata(_pc, _shard, std::move(features), std::move(identifier), std::move(ld_stats), _cfg.origin); + _sst.write_scylla_metadata(_shard, std::move(features), std::move(identifier), std::move(ld_stats), _cfg.origin); _sst.seal_sstable(_cfg.backup).get(); } @@ -1480,9 +1480,8 @@ std::unique_ptr make_writer(sstable& sst, uint64_t estimated_partitions, const sstable_writer_config& cfg, encoding_stats enc_stats, - const io_priority_class& pc, shard_id shard) { - return std::make_unique(sst, s, estimated_partitions, cfg, enc_stats, pc, shard); + return std::make_unique(sst, s, estimated_partitions, cfg, enc_stats, shard); } } diff --git a/sstables/mx/writer.hh b/sstables/mx/writer.hh index 8efae1e5b8..c56c883230 100644 --- a/sstables/mx/writer.hh +++ b/sstables/mx/writer.hh @@ -20,7 +20,6 @@ std::unique_ptr make_writer(sstable& sst, uint64_t estimated_partitions, const sstable_writer_config& cfg, encoding_stats enc_stats, - const io_priority_class& pc, shard_id shard); } diff --git a/sstables/sstable_directory.cc b/sstables/sstable_directory.cc index 66581a6557..dae01966b3 100644 --- a/sstables/sstable_directory.cc +++ b/sstables/sstable_directory.cc @@ -73,13 +73,11 @@ sstable_directory::sstable_directory(sstables_manager& manager, schema_ptr schema, lw_shared_ptr storage_opts, fs::path sstable_dir, - ::io_priority_class io_prio, io_error_handler_gen error_handler_gen) : _manager(manager) , _schema(std::move(schema)) , _storage_opts(std::move(storage_opts)) , _sstable_dir(std::move(sstable_dir)) - , _io_priority(std::move(io_prio)) , _error_handler_gen(error_handler_gen) , _lister(make_components_lister()) , _unshared_remote_sstables(smp::count) @@ -136,7 +134,7 @@ void sstable_directory::validate(sstables::shared_sstable sst, process_flags fla future sstable_directory::load_sstable(sstables::entry_descriptor desc, sstables::sstable_open_config cfg) const { auto sst = _manager.make_sstable(_schema, *_storage_opts, _sstable_dir.native(), desc.generation, desc.version, desc.format, gc_clock::now(), _error_handler_gen); - co_await sst->load(_io_priority, cfg); + co_await sst->load(cfg); co_return sst; } @@ -166,7 +164,7 @@ sstable_directory::process_descriptor(sstables::entry_descriptor desc, process_f future> sstable_directory::get_shards_for_this_sstable(const sstables::entry_descriptor& desc, process_flags flags) const { auto sst = _manager.make_sstable(_schema, *_storage_opts, _sstable_dir.native(), desc.generation, desc.version, desc.format, gc_clock::now(), _error_handler_gen); - co_await sst->load_owner_shards(_io_priority); + co_await sst->load_owner_shards(); validate(sst, flags); co_return sst->get_shards_for_this_sstable(); } diff --git a/sstables/sstable_directory.hh b/sstables/sstable_directory.hh index d5d3aeeff4..61793a5df6 100644 --- a/sstables/sstable_directory.hh +++ b/sstables/sstable_directory.hh @@ -129,7 +129,6 @@ private: schema_ptr _schema; lw_shared_ptr _storage_opts; std::filesystem::path _sstable_dir; - ::io_priority_class _io_priority; io_error_handler_gen _error_handler_gen; std::unique_ptr _lister; @@ -187,7 +186,6 @@ public: schema_ptr schema, lw_shared_ptr storage_opts, std::filesystem::path sstable_dir, - ::io_priority_class io_prio, io_error_handler_gen error_handler_gen); std::vector& get_unsorted_sstables() { diff --git a/sstables/sstable_mutation_reader.hh b/sstables/sstable_mutation_reader.hh index 3ab80c44df..2a0948ac8c 100644 --- a/sstables/sstable_mutation_reader.hh +++ b/sstables/sstable_mutation_reader.hh @@ -117,7 +117,7 @@ inline std::unique_ptr data_consume_rows(const schema& s // This potentially enables read-ahead beyond end, until last_end, which // can be beneficial if the user wants to fast_forward_to() on the // returned context, and may make small skips. - auto input = sst->data_stream(toread.start, last_end - toread.start, consumer.io_priority(), + auto input = sst->data_stream(toread.start, last_end - toread.start, consumer.permit(), consumer.trace_state(), sst->_partition_range_history); return std::make_unique(s, std::move(sst), consumer, std::move(input), toread.start, toread.end - toread.start); } @@ -140,7 +140,7 @@ inline reversed_context data_consume_reversed_partition( typename DataConsumeRowsContext::consumer& consumer, sstable::disk_read_range toread) { auto reversing_data_source = sstables::mx::make_partition_reversing_data_source( s, sst, ir, toread.start, toread.end - toread.start, - consumer.permit(), consumer.io_priority(), consumer.trace_state()); + consumer.permit(), consumer.trace_state()); return reversed_context { .the_context = std::make_unique( s, std::move(sst), consumer, input_stream(std::move(reversing_data_source.the_source)), @@ -151,7 +151,7 @@ inline reversed_context data_consume_reversed_partition( template inline std::unique_ptr data_consume_single_partition(const schema& s, shared_sstable sst, typename DataConsumeRowsContext::consumer& consumer, sstable::disk_read_range toread) { - auto input = sst->data_stream(toread.start, toread.end - toread.start, consumer.io_priority(), + auto input = sst->data_stream(toread.start, toread.end - toread.start, consumer.permit(), consumer.trace_state(), sst->_single_partition_history); return std::make_unique(s, std::move(sst), consumer, std::move(input), toread.start, toread.end - toread.start); } @@ -168,7 +168,6 @@ concept RowConsumer = requires(T t, const partition_key& pk, position_range cr) { - { t.io_priority() } -> std::convertible_to; { t.is_mutation_end() } -> std::same_as; { t.setup_for_partition(pk) } -> std::same_as; { t.push_ready_fragments() } -> std::same_as; diff --git a/sstables/sstable_set.cc b/sstables/sstable_set.cc index aeb4ad4b82..2b07bacb71 100644 --- a/sstables/sstable_set.cc +++ b/sstables/sstable_set.cc @@ -885,7 +885,6 @@ sstable_set_impl::create_single_key_sstable_reader( utils::estimated_histogram& sstable_histogram, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) const @@ -900,7 +899,7 @@ sstable_set_impl::create_single_key_sstable_reader( filter_sstable_for_reader_by_ck(std::move(selected_sstables), *cf, schema, slice) | boost::adaptors::transformed([&] (const shared_sstable& sstable) { tracing::trace(trace_state, "Reading key {} from sstable {}", pos, seastar::value_of([&sstable] { return sstable->get_filename(); })); - return sstable->make_reader(schema, permit, pr, slice, pc, trace_state, fwd); + return sstable->make_reader(schema, permit, pr, slice, trace_state, fwd); }) ); @@ -928,7 +927,6 @@ time_series_sstable_set::create_single_key_sstable_reader( utils::estimated_histogram& sstable_histogram, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) const { @@ -953,7 +951,7 @@ time_series_sstable_set::create_single_key_sstable_reader( // Some of the conditions were not satisfied so we use the standard query path. return sstable_set_impl::create_single_key_sstable_reader( cf, std::move(schema), std::move(permit), sstable_histogram, - pr, slice, pc, std::move(trace_state), fwd_sm, fwd_mr); + pr, slice, std::move(trace_state), fwd_sm, fwd_mr); } auto pk_filter = make_pk_filter(pos, *schema); @@ -966,8 +964,8 @@ time_series_sstable_set::create_single_key_sstable_reader( auto& stats = *cf->cf_stats(); stats.clustering_filter_count++; - auto create_reader = [schema, permit, &pr, &slice, &pc, trace_state, fwd_sm] (sstable& sst) { - return sst.make_reader(schema, permit, pr, slice, pc, trace_state, fwd_sm); + auto create_reader = [schema, permit, &pr, &slice, trace_state, fwd_sm] (sstable& sst) { + return sst.make_reader(schema, permit, pr, slice, trace_state, fwd_sm); }; auto ck_filter = [ranges = slice.get_all_ranges()] (const sstable& sst) { return sst.may_contain_rows(ranges); }; @@ -1168,7 +1166,6 @@ compound_sstable_set::create_single_key_sstable_reader( utils::estimated_histogram& sstable_histogram, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) const { @@ -1182,13 +1179,13 @@ compound_sstable_set::create_single_key_sstable_reader( // optimize for common case where only 1 set is populated, avoiding the expensive combined reader if (non_empty_set_count == 1) { const auto& non_empty_set = *std::begin(sets); - return non_empty_set->create_single_key_sstable_reader(cf, std::move(schema), std::move(permit), sstable_histogram, pr, slice, pc, trace_state, fwd, fwd_mr); + return non_empty_set->create_single_key_sstable_reader(cf, std::move(schema), std::move(permit), sstable_histogram, pr, slice, trace_state, fwd, fwd_mr); } auto readers = boost::copy_range>( boost::make_iterator_range(sets.begin(), it) | boost::adaptors::transformed([&] (const lw_shared_ptr& non_empty_set) { - return non_empty_set->create_single_key_sstable_reader(cf, schema, permit, sstable_histogram, pr, slice, pc, trace_state, fwd, fwd_mr); + return non_empty_set->create_single_key_sstable_reader(cf, schema, permit, sstable_histogram, pr, slice, trace_state, fwd, fwd_mr); }) ); return make_combined_reader(std::move(schema), std::move(permit), std::move(readers), fwd, fwd_mr); @@ -1202,13 +1199,12 @@ sstable_set::create_single_key_sstable_reader( utils::estimated_histogram& sstable_histogram, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) const { assert(pr.is_singular() && pr.start()->value().has_key()); return _impl->create_single_key_sstable_reader(cf, std::move(schema), - std::move(permit), sstable_histogram, pr, slice, pc, std::move(trace_state), fwd, fwd_mr); + std::move(permit), sstable_histogram, pr, slice, std::move(trace_state), fwd, fwd_mr); } flat_mutation_reader_v2 @@ -1217,15 +1213,14 @@ sstable_set::make_range_sstable_reader( reader_permit permit, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, read_monitor_generator& monitor_generator) const { - auto reader_factory_fn = [s, permit, &slice, &pc, trace_state, fwd, fwd_mr, &monitor_generator] + auto reader_factory_fn = [s, permit, &slice, trace_state, fwd, fwd_mr, &monitor_generator] (shared_sstable& sst, const dht::partition_range& pr) mutable { - return sst->make_reader(s, permit, pr, slice, pc, trace_state, fwd, fwd_mr, monitor_generator(sst)); + return sst->make_reader(s, permit, pr, slice, trace_state, fwd, fwd_mr, monitor_generator(sst)); }; return make_combined_reader(s, std::move(permit), std::make_unique(s, shared_from_this(), @@ -1242,16 +1237,15 @@ sstable_set::make_local_shard_sstable_reader( reader_permit permit, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, read_monitor_generator& monitor_generator) const { - auto reader_factory_fn = [s, permit, &slice, &pc, trace_state, fwd, fwd_mr, &monitor_generator] + auto reader_factory_fn = [s, permit, &slice, trace_state, fwd, fwd_mr, &monitor_generator] (shared_sstable& sst, const dht::partition_range& pr) mutable { assert(!sst->is_shared()); - return sst->make_reader(s, permit, pr, slice, pc, trace_state, fwd, fwd_mr, monitor_generator(sst)); + return sst->make_reader(s, permit, pr, slice, trace_state, fwd, fwd_mr, monitor_generator(sst)); }; if (_impl->size() == 1) [[unlikely]] { auto sstables = _impl->all(); @@ -1270,12 +1264,11 @@ sstable_set::make_local_shard_sstable_reader( flat_mutation_reader_v2 sstable_set::make_crawling_reader( schema_ptr schema, reader_permit permit, - const io_priority_class& pc, tracing::trace_state_ptr trace_ptr, read_monitor_generator& monitor_generator) const { std::vector readers; for_each_sstable([&] (const shared_sstable& sst) mutable { - readers.emplace_back(sst->make_crawling_reader(schema, permit, pc, trace_ptr, monitor_generator(sst))); + readers.emplace_back(sst->make_crawling_reader(schema, permit, trace_ptr, monitor_generator(sst))); }); return make_combined_reader(schema, std::move(permit), std::move(readers), streamed_mutation::forwarding::no, mutation_reader::forwarding::no); } diff --git a/sstables/sstable_set.hh b/sstables/sstable_set.hh index f1dfe0dd0d..33b23319db 100644 --- a/sstables/sstable_set.hh +++ b/sstables/sstable_set.hh @@ -14,7 +14,6 @@ #include "shared_sstable.hh" #include "dht/i_partitioner.hh" #include -#include #include #include @@ -77,7 +76,6 @@ public: utils::estimated_histogram&, const dht::partition_range&, const query::partition_slice&, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding, mutation_reader::forwarding) const; @@ -167,7 +165,6 @@ public: utils::estimated_histogram&, const dht::partition_range&, // must be singular and contain a key const query::partition_slice&, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding, mutation_reader::forwarding) const; @@ -181,7 +178,6 @@ public: reader_permit, const dht::partition_range&, const query::partition_slice&, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding, mutation_reader::forwarding, @@ -193,7 +189,6 @@ public: reader_permit, const dht::partition_range&, const query::partition_slice&, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding, mutation_reader::forwarding, @@ -202,7 +197,6 @@ public: flat_mutation_reader_v2 make_crawling_reader( schema_ptr, reader_permit, - const io_priority_class&, tracing::trace_state_ptr, read_monitor_generator& rmg = default_read_monitor_generator()) const; diff --git a/sstables/sstable_set_impl.hh b/sstables/sstable_set_impl.hh index 9848299702..e236567c78 100644 --- a/sstables/sstable_set_impl.hh +++ b/sstables/sstable_set_impl.hh @@ -112,7 +112,6 @@ public: utils::estimated_histogram&, const dht::partition_range&, const query::partition_slice&, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding, mutation_reader::forwarding) const override; @@ -146,7 +145,6 @@ public: utils::estimated_histogram&, const dht::partition_range&, const query::partition_slice&, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding, mutation_reader::forwarding) const override; diff --git a/sstables/sstable_writer.hh b/sstables/sstable_writer.hh index e21cec0b7d..ae5d9a2f5b 100644 --- a/sstables/sstable_writer.hh +++ b/sstables/sstable_writer.hh @@ -9,7 +9,6 @@ #pragma once #include -#include #include #include "schema/schema_fwd.hh" #include "mutation/mutation_fragment.hh" @@ -30,7 +29,7 @@ private: public: sstable_writer(sstable& sst, const schema& s, uint64_t estimated_partitions, const sstable_writer_config&, encoding_stats enc_stats, - const io_priority_class& pc, shard_id shard = this_shard_id()); + shard_id shard = this_shard_id()); sstable_writer(sstable_writer&& o); sstable_writer& operator=(sstable_writer&& o); diff --git a/sstables/sstables.cc b/sstables/sstables.cc index 0a74221d14..9728a05ad4 100644 --- a/sstables/sstables.cc +++ b/sstables/sstables.cc @@ -917,9 +917,9 @@ future sstable::make_component_file_writer(component_type c, file_o }); } -void sstable::open_sstable(const io_priority_class& pc) { +void sstable::open_sstable() { generate_toc(); - _storage->open(*this, pc); + _storage->open(*this); } void sstable::write_toc(file_writer w) { @@ -937,7 +937,7 @@ void sstable::write_toc(file_writer w) { void sstable::write_crc(const checksum& c) { unsigned buffer_size = 4096; - do_write_simple(component_type::CRC, default_priority_class(), [&] (version_types v, file_writer& w) { + do_write_simple(component_type::CRC, [&] (version_types v, file_writer& w) { write(v, w, c); }, buffer_size); } @@ -945,7 +945,7 @@ void sstable::write_crc(const checksum& c) { // Digest file stores the full checksum of data file converted into a string. void sstable::write_digest(uint32_t full_checksum) { unsigned buffer_size = 4096; - do_write_simple(component_type::Digest, default_priority_class(), [&] (version_types v, file_writer& w) { + do_write_simple(component_type::Digest, [&] (version_types v, file_writer& w) { auto digest = to_sstring(full_checksum); write(v, w, digest); }, buffer_size); @@ -990,7 +990,7 @@ future<> sstable::do_read_simple(component_type type, } template -future<> sstable::read_simple(T& component, const io_priority_class& pc) { +future<> sstable::read_simple(T& component) { return do_read_simple(Type, [&] (version_types v, file&& f, uint64_t size) -> future<> { std::exception_ptr ex; auto r = file_random_access_reader(std::move(f), size, sstable_buffer_size); @@ -1012,45 +1012,44 @@ void sstable::do_write_simple(file_writer&& writer, writer.close(); } -void sstable::do_write_simple(component_type type, const io_priority_class& pc, +void sstable::do_write_simple(component_type type, noncopyable_function write_component, unsigned buffer_size) { auto file_path = filename(type); sstlog.debug(("Writing " + sstable_version_constants::get_component_map(_version).at(type) + " file {} ").c_str(), file_path); file_output_stream_options options; options.buffer_size = buffer_size; - options.io_priority_class = pc; auto w = make_component_file_writer(type, std::move(options)).get0(); do_write_simple(std::move(w), std::move(write_component)); } template -void sstable::write_simple(const T& component, const io_priority_class& pc) { - do_write_simple(Type, pc, [&component] (version_types v, file_writer& w) { +void sstable::write_simple(const T& component) { + do_write_simple(Type, [&component] (version_types v, file_writer& w) { write(v, w, component); }, sstable_buffer_size); } -template future<> sstable::read_simple(sstables::filter& f, const io_priority_class& pc); -template void sstable::write_simple(const sstables::filter& f, const io_priority_class& pc); +template future<> sstable::read_simple(sstables::filter& f); +template void sstable::write_simple(const sstables::filter& f); -template void sstable::write_simple(const sstables::summary_ka&, const io_priority_class&); +template void sstable::write_simple(const sstables::summary_ka&); -future<> sstable::read_compression(const io_priority_class& pc) { +future<> sstable::read_compression() { // FIXME: If there is no compression, we should expect a CRC file to be present. if (!has_component(component_type::CompressionInfo)) { return make_ready_future<>(); } - return read_simple(_components->compression, pc); + return read_simple(_components->compression); } -void sstable::write_compression(const io_priority_class& pc) { +void sstable::write_compression() { if (!has_component(component_type::CompressionInfo)) { return; } - write_simple(_components->compression, pc); + write_simple(_components->compression); } void sstable::validate_partitioner() { @@ -1148,7 +1147,7 @@ void sstable::set_min_max_position_range() { } future> -sstable::find_first_position_in_partition(reader_permit permit, const dht::decorated_key& key, bool reversed, const io_priority_class& pc) { +sstable::find_first_position_in_partition(reader_permit permit, const dht::decorated_key& key, bool reversed) { using position_in_partition_opt = std::optional; class position_finder { position_in_partition_opt& _pos; @@ -1209,7 +1208,7 @@ sstable::find_first_position_in_partition(reader_permit permit, const dht::decor s = s->make_reversed(); full_slice.options.set(query::partition_slice::option::reversed); } - auto r = make_reader(s, std::move(permit), pr, full_slice, pc, {}, streamed_mutation::forwarding::no, + auto r = make_reader(s, std::move(permit), pr, full_slice, {}, streamed_mutation::forwarding::no, mutation_reader::forwarding::no /* to avoid reading past the partition end */); position_in_partition_opt ret = std::nullopt; @@ -1258,12 +1257,12 @@ double sstable::estimate_droppable_tombstone_ratio(gc_clock::time_point gc_befor return 0.0f; } -future<> sstable::read_statistics(const io_priority_class& pc) { - return read_simple(_components->statistics, pc); +future<> sstable::read_statistics() { + return read_simple(_components->statistics); } -void sstable::write_statistics(const io_priority_class& pc) { - write_simple(_components->statistics, pc); +void sstable::write_statistics() { + write_simple(_components->statistics); } void sstable::rewrite_statistics() { @@ -1280,21 +1279,21 @@ void sstable::rewrite_statistics() { sstable_write_io_check(rename_file, file_path, filename(component_type::Statistics)).get(); } -future<> sstable::read_summary(const io_priority_class& pc) noexcept { +future<> sstable::read_summary() noexcept { if (_components->summary) { return make_ready_future<>(); } - return read_toc().then([this, &pc] { + return read_toc().then([this] { // We'll try to keep the main code path exception free, but if an exception does happen // we can try to regenerate the Summary. if (has_component(component_type::Summary)) { - return read_simple(_components->summary, pc).handle_exception([this, &pc] (auto ep) { + return read_simple(_components->summary).handle_exception([this] (auto ep) { sstlog.warn("Couldn't read summary file {}: {}. Recreating it.", this->filename(component_type::Summary), ep); - return this->generate_summary(pc); + return this->generate_summary(); }); } else { - return generate_summary(pc); + return generate_summary(); } }); } @@ -1377,15 +1376,15 @@ future<> sstable::drop_caches() { }); } -future<> sstable::read_filter(const io_priority_class& pc, sstable_open_config cfg) { +future<> sstable::read_filter(sstable_open_config cfg) { if (!cfg.load_bloom_filter || !has_component(component_type::Filter)) { _components->filter = std::make_unique(); return make_ready_future<>(); } - return seastar::async([this, &pc] () mutable { + return seastar::async([this] () mutable { sstables::filter filter; - read_simple(filter, pc).get(); + read_simple(filter).get(); auto nr_bits = filter.buckets.elements.size() * std::numeric_limits::digits; large_bitset bs(nr_bits, std::move(filter.buckets.elements)); utils::filter_format format = (_version >= sstable_version_types::mc) @@ -1395,7 +1394,7 @@ future<> sstable::read_filter(const io_priority_class& pc, sstable_open_config c }); } -void sstable::write_filter(const io_priority_class& pc) { +void sstable::write_filter() { if (!has_component(component_type::Filter)) { return; } @@ -1404,23 +1403,23 @@ void sstable::write_filter(const io_priority_class& pc) { auto&& bs = f->bits(); auto filter_ref = sstables::filter_ref(f->num_hashes(), bs.get_storage()); - write_simple(filter_ref, pc); + write_simple(filter_ref); } // This interface is only used during tests, snapshot loading and early initialization. // No need to set tunable priorities for it. -future<> sstable::load(const io_priority_class& pc, sstable_open_config cfg) noexcept { +future<> sstable::load(sstable_open_config cfg) noexcept { co_await read_toc(); // read scylla-meta after toc. Might need it to parse // rest (hint extensions) - co_await read_scylla_metadata(pc); + co_await read_scylla_metadata(); // Read statistics ahead of others - if summary is missing // we'll attempt to re-generate it and we need statistics for that - co_await read_statistics(pc); + co_await read_statistics(); co_await coroutine::all( - [&] { return read_compression(pc); }, - [&] { return read_filter(pc, cfg); }, - [&] { return read_summary(pc); }); + [&] { return read_compression(); }, + [&] { return read_filter(cfg); }, + [&] { return read_summary(); }); validate_min_max_metadata(); validate_max_local_deletion_time(); validate_partitioner(); @@ -1450,11 +1449,11 @@ future sstable::get_open_info() & { } future<> -sstable::load_owner_shards(const io_priority_class& pc) { +sstable::load_owner_shards() { if (!_shards.empty()) { co_return; } - co_await read_scylla_metadata(pc); + co_await read_scylla_metadata(); auto has_valid_sharding_metadata = std::invoke([this] { if (!has_component(component_type::Scylla)) { @@ -1468,13 +1467,13 @@ sstable::load_owner_shards(const io_priority_class& pc) { return sm && sm->token_ranges.elements.size(); }); // Statistics is needed for SSTable loading validation and possible Summary regeneration. - co_await read_statistics(pc); + co_await read_statistics(); // If sharding metadata is not available, we must load first and last keys from summary // for sstable::compute_shards_for_this_sstable() to operate on them. if (!has_valid_sharding_metadata) { sstlog.warn("Sharding metadata not available for {}, so Summary will be read to allow Scylla to compute shards owning the SSTable.", get_filename()); - co_await read_summary(pc); + co_await read_summary(); set_first_and_last_keys(); } @@ -1616,21 +1615,21 @@ size_t summary_byte_cost(double summary_ratio) { } future<> -sstable::read_scylla_metadata(const io_priority_class& pc) noexcept { +sstable::read_scylla_metadata() noexcept { if (_components->scylla_metadata) { return make_ready_future<>(); } - return read_toc().then([this, &pc] { + return read_toc().then([this] { _components->scylla_metadata.emplace(); // engaged optional means we won't try to re-read this again if (!has_component(component_type::Scylla)) { return make_ready_future<>(); } - return read_simple(*_components->scylla_metadata, pc); + return read_simple(*_components->scylla_metadata); }); } void -sstable::write_scylla_metadata(const io_priority_class& pc, shard_id shard, sstable_enabled_features features, struct run_identifier identifier, +sstable::write_scylla_metadata(shard_id shard, sstable_enabled_features features, struct run_identifier identifier, std::optional ld_stats, sstring origin) { auto&& first_key = get_first_decorated_key(); auto&& last_key = get_last_decorated_key(); @@ -1665,7 +1664,7 @@ sstable::write_scylla_metadata(const io_priority_class& pc, shard_id shard, ssta build_id.value = bytes(to_bytes_view(sstring_view(get_build_id()))); _components->scylla_metadata->data.set(std::move(build_id)); - write_simple(*_components->scylla_metadata, pc); + write_simple(*_components->scylla_metadata); } bool sstable::may_contain_rows(const query::clustering_row_ranges& ranges) const { @@ -1705,20 +1704,20 @@ future<> sstable::seal_sstable(bool backup) } sstable_writer sstable::get_writer(const schema& s, uint64_t estimated_partitions, - const sstable_writer_config& cfg, encoding_stats enc_stats, const io_priority_class& pc, shard_id shard) + const sstable_writer_config& cfg, encoding_stats enc_stats, shard_id shard) { // Mark sstable for implicit deletion if destructed before it is sealed. _marked_for_deletion = mark_for_deletion::implicit; - return sstable_writer(*this, s, estimated_partitions, cfg, enc_stats, pc, shard); + return sstable_writer(*this, s, estimated_partitions, cfg, enc_stats, shard); } -future sstable::validate(reader_permit permit, const io_priority_class& pc, abort_source& abort, +future sstable::validate(reader_permit permit, abort_source& abort, std::function error_handler) { if (_version >= sstable_version_types::mc) { - co_return co_await mx::validate(shared_from_this(), std::move(permit), pc, abort, std::move(error_handler)); + co_return co_await mx::validate(shared_from_this(), std::move(permit), abort, std::move(error_handler)); } - auto reader = make_crawling_reader(_schema, permit, pc, nullptr); + auto reader = make_crawling_reader(_schema, permit, nullptr); uint64_t errors = 0; std::exception_ptr ex; @@ -1798,19 +1797,18 @@ future<> sstable::write_components( uint64_t estimated_partitions, schema_ptr schema, const sstable_writer_config& cfg, - encoding_stats stats, - const io_priority_class& pc) { + encoding_stats stats) { assert_large_data_handler_is_running(); - return seastar::async([this, mr = std::move(mr), estimated_partitions, schema = std::move(schema), cfg, stats, &pc] () mutable { + return seastar::async([this, mr = std::move(mr), estimated_partitions, schema = std::move(schema), cfg, stats] () mutable { auto close_mr = deferred_close(mr); - auto wr = get_writer(*schema, estimated_partitions, cfg, stats, pc); + auto wr = get_writer(*schema, estimated_partitions, cfg, stats); mr.consume_in_thread(std::move(wr)); }).finally([this] { assert_large_data_handler_is_running(); }); } -future<> sstable::generate_summary(const io_priority_class& pc) { +future<> sstable::generate_summary() { if (_components->summary) { co_return; } @@ -1856,7 +1854,6 @@ future<> sstable::generate_summary(const io_priority_class& pc) { file_input_stream_options options; options.buffer_size = sstable_buffer_size; - options.io_priority_class = pc; auto s = summary_generator(_schema->get_partitioner(), _components->summary, _manager.config().sstable_summary_ratio()); auto ctx = make_lw_shared>( @@ -2064,14 +2061,13 @@ sstable::make_reader( reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr, read_monitor& mon) { const auto reversed = slice.is_reversed(); if (_version >= version_types::mc && (!reversed || range.is_singular())) { - return mx::make_reader(shared_from_this(), std::move(schema), std::move(permit), range, slice, pc, std::move(trace_state), fwd, fwd_mr, mon); + return mx::make_reader(shared_from_this(), std::move(schema), std::move(permit), range, slice, std::move(trace_state), fwd, fwd_mr, mon); } // Multi-partition reversed queries are not yet supported natively in the mx reader. @@ -2082,7 +2078,7 @@ sstable::make_reader( if (_version >= version_types::mc) { // The only mx case falling through here is reversed multi-partition reader auto rd = make_reversing_reader(mx::make_reader(shared_from_this(), schema->make_reversed(), std::move(permit), - range, half_reverse_slice(*schema, slice), pc, std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr, mon), + range, half_reverse_slice(*schema, slice), std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr, mon), max_result_size); if (fwd) { rd = make_forwardable(std::move(rd)); @@ -2095,7 +2091,7 @@ sstable::make_reader( // Perform a forward query on it, then reverse the result. // Note: we can pass a half-reversed slice, the kl reader performs an unreversed query nevertheless. auto rd = make_reversing_reader(kl::make_reader(shared_from_this(), schema->make_reversed(), std::move(permit), - range, slice, pc, std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr, mon), max_result_size); + range, slice, std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr, mon), max_result_size); if (fwd) { rd = make_forwardable(std::move(rd)); } @@ -2103,20 +2099,19 @@ sstable::make_reader( } return kl::make_reader(shared_from_this(), schema, std::move(permit), - range, slice, pc, std::move(trace_state), fwd, fwd_mr, mon); + range, slice, std::move(trace_state), fwd, fwd_mr, mon); } flat_mutation_reader_v2 sstable::make_crawling_reader( schema_ptr schema, reader_permit permit, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, read_monitor& monitor) { if (_version >= version_types::mc) { - return mx::make_crawling_reader(shared_from_this(), std::move(schema), std::move(permit), pc, std::move(trace_state), monitor); + return mx::make_crawling_reader(shared_from_this(), std::move(schema), std::move(permit), std::move(trace_state), monitor); } - return kl::make_crawling_reader(shared_from_this(), std::move(schema), std::move(permit), pc, std::move(trace_state), monitor); + return kl::make_crawling_reader(shared_from_this(), std::move(schema), std::move(permit), std::move(trace_state), monitor); } static entry_descriptor make_entry_descriptor(sstring sstdir, sstring fname, sstring* const provided_ks, sstring* const provided_cf) { @@ -2206,11 +2201,10 @@ component_type sstable::component_from_sstring(version_types v, const sstring &s } } -input_stream sstable::data_stream(uint64_t pos, size_t len, const io_priority_class& pc, +input_stream sstable::data_stream(uint64_t pos, size_t len, reader_permit permit, tracing::trace_state_ptr trace_state, lw_shared_ptr history, raw_stream raw) { file_input_stream_options options; options.buffer_size = sstable_buffer_size; - options.io_priority_class = pc; options.read_ahead = 4; options.dynamic_adjustments = std::move(history); @@ -2233,8 +2227,8 @@ input_stream sstable::data_stream(uint64_t pos, size_t len, const io_prior return make_file_input_stream(f, pos, len, std::move(options)); } -future> sstable::data_read(uint64_t pos, size_t len, const io_priority_class& pc, reader_permit permit) { - return do_with(data_stream(pos, len, pc, std::move(permit), tracing::trace_state_ptr(), {}), [len] (auto& stream) { +future> sstable::data_read(uint64_t pos, size_t len, reader_permit permit) { + return do_with(data_stream(pos, len, std::move(permit), tracing::trace_state_ptr(), {}), [len] (auto& stream) { return stream.read_exactly(len).finally([&stream] { return stream.close(); }); @@ -2398,11 +2392,9 @@ future sstable::read_checksum() { } future validate_checksums(shared_sstable sst, reader_permit permit) { - auto& pc = default_priority_class(); - const auto digest = co_await sst->read_digest(); - auto data_stream = sst->data_stream(0, sst->ondisk_data_size(), pc, permit, nullptr, nullptr, sstable::raw_stream::yes); + auto data_stream = sst->data_stream(0, sst->ondisk_data_size(), permit, nullptr, nullptr, sstable::raw_stream::yes); auto valid = true; std::exception_ptr ex; @@ -2938,11 +2930,10 @@ mutation_source sstable::as_mutation_source() { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) mutable { - return sst->make_reader(std::move(s), std::move(permit), range, slice, pc, std::move(trace_state), fwd, fwd_mr); + return sst->make_reader(std::move(s), std::move(permit), range, slice, std::move(trace_state), fwd, fwd_mr); }); } diff --git a/sstables/sstables.hh b/sstables/sstables.hh index a94ea27d42..87dc64da42 100644 --- a/sstables/sstables.hh +++ b/sstables/sstables.hh @@ -196,13 +196,13 @@ public: // load all components from disk // this variant will be useful for testing purposes and also when loading // a new sstable from scratch for sharing its components. - future<> load(const io_priority_class& pc = default_priority_class(), sstable_open_config cfg = {}) noexcept; + future<> load(sstable_open_config cfg = {}) noexcept; future<> open_data(sstable_open_config cfg = {}) noexcept; future<> update_info_for_opened_data(sstable_open_config cfg = {}); // Load set of shards that own the SSTable, while reading the minimum // from disk to achieve that. - future<> load_owner_shards(const io_priority_class& pc = default_priority_class()); + future<> load_owner_shards(); // Call as the last method before the object is destroyed. // No other uses of the object can happen at this point. @@ -232,7 +232,6 @@ public: reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc = default_priority_class(), tracing::trace_state_ptr trace_state = {}, streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::yes, @@ -243,7 +242,6 @@ public: flat_mutation_reader_v2 make_crawling_reader( schema_ptr schema, reader_permit permit, - const io_priority_class& pc = default_priority_class(), tracing::trace_state_ptr trace_state = {}, read_monitor& monitor = default_read_monitor()); @@ -255,14 +253,12 @@ public: uint64_t estimated_partitions, schema_ptr schema, const sstable_writer_config&, - encoding_stats stats, - const io_priority_class& pc = default_priority_class()); + encoding_stats stats); sstable_writer get_writer(const schema& s, uint64_t estimated_partitions, const sstable_writer_config&, encoding_stats enc_stats, - const io_priority_class& pc = default_priority_class(), shard_id shard = this_shard_id()); // Validates the content of the sstable. @@ -272,7 +268,7 @@ public: // If aborted, either via the abort-source or via unrecoverable errors // (e.g. parse error), it will return with validation error count seen up to // the abort. In the latter case it will call the error-handler before doing so. - future validate(reader_permit permit, const io_priority_class& pc, abort_source& abort, + future validate(reader_permit permit, abort_source& abort, std::function error_handler); encoding_stats get_encoding_stats_for_compaction() const; @@ -553,7 +549,7 @@ private: future open_file(component_type, open_flags, file_open_options = {}) noexcept; template - future<> read_simple(T& comp, const io_priority_class& pc); + future<> read_simple(T& comp); future<> do_read_simple(component_type type, noncopyable_function (version_types, file&&, uint64_t sz)> read_component); // this variant closes the file on parse completion @@ -561,10 +557,10 @@ private: noncopyable_function (version_types, file)> read_component); template - void write_simple(const T& comp, const io_priority_class& pc); + void write_simple(const T& comp); void do_write_simple(file_writer&& writer, noncopyable_function write_component); - void do_write_simple(component_type type, const io_priority_class& pc, + void do_write_simple(component_type type, noncopyable_function write_component, unsigned buffer_size); @@ -578,31 +574,31 @@ private: open_flags oflags = open_flags::wo | open_flags::create | open_flags::exclusive) noexcept; void generate_toc(); - void open_sstable(const io_priority_class& pc); + void open_sstable(); - future<> read_compression(const io_priority_class& pc); - void write_compression(const io_priority_class& pc); + future<> read_compression(); + void write_compression(); - future<> read_scylla_metadata(const io_priority_class& pc) noexcept; - void write_scylla_metadata(const io_priority_class& pc, shard_id shard, sstable_enabled_features features, run_identifier identifier, + future<> read_scylla_metadata() noexcept; + void write_scylla_metadata(shard_id shard, sstable_enabled_features features, run_identifier identifier, std::optional ld_stats, sstring origin); - future<> read_filter(const io_priority_class& pc, sstable_open_config cfg = {}); + future<> read_filter(sstable_open_config cfg = {}); - void write_filter(const io_priority_class& pc); + void write_filter(); - future<> read_summary(const io_priority_class& pc) noexcept; + future<> read_summary() noexcept; - void write_summary(const io_priority_class& pc) { - write_simple(_components->summary, pc); + void write_summary() { + write_simple(_components->summary); } // To be called when we try to load an SSTable that lacks a Summary. Could // happen if old tools are being used. - future<> generate_summary(const io_priority_class& pc); + future<> generate_summary(); - future<> read_statistics(const io_priority_class& pc); - void write_statistics(const io_priority_class& pc); + future<> read_statistics(); + void write_statistics(); // Rewrite statistics component by creating a temporary Statistics and // renaming it into place of existing one. void rewrite_statistics(); @@ -635,8 +631,7 @@ public: // If reversed is false, then the first position is actually the first row (can be the static one). // If reversed is true, then the first position is the last row (can be static if partition has a single static row). future> - find_first_position_in_partition(reader_permit permit, const dht::decorated_key& key, bool reversed, - const io_priority_class& pc = default_priority_class()); + find_first_position_in_partition(reader_permit permit, const dht::decorated_key& key, bool reversed); // Return an input_stream which reads exactly the specified byte range // from the data file (after uncompression, if the file is compressed). @@ -650,7 +645,7 @@ public: // When created with `raw_stream::yes`, the sstable data file will be // streamed as-is, without decompressing (if compressed). using raw_stream = bool_class; - input_stream data_stream(uint64_t pos, size_t len, const io_priority_class& pc, + input_stream data_stream(uint64_t pos, size_t len, reader_permit permit, tracing::trace_state_ptr trace_state, lw_shared_ptr history, raw_stream raw = raw_stream::no); // Read exactly the specific byte range from the data file (after @@ -659,7 +654,7 @@ public: // determined using the index file). // This function is intended (and optimized for) random access, not // for iteration through all the rows. - future> data_read(uint64_t pos, size_t len, const io_priority_class& pc, reader_permit permit); + future> data_read(uint64_t pos, size_t len, reader_permit permit); private: future read_summary_entry(size_t i); diff --git a/sstables/storage.cc b/sstables/storage.cc index 30433f0ee4..4f9c52a663 100644 --- a/sstables/storage.cc +++ b/sstables/storage.cc @@ -60,10 +60,10 @@ public: virtual future<> snapshot(const sstable& sst, sstring dir, absolute_path abs) const override; virtual future<> change_state(const sstable& sst, sstring to, generation_type generation, delayed_commit_changes* delay) override; // runs in async context - virtual void open(sstable& sst, const io_priority_class& pc) override; + virtual void open(sstable& sst) override; virtual future<> wipe(const sstable& sst) noexcept override; virtual future open_component(const sstable& sst, component_type type, open_flags flags, file_open_options options, bool check_integrity) override; - virtual future make_data_or_index_sink(sstable& sst, component_type type, io_priority_class pc) override; + virtual future make_data_or_index_sink(sstable& sst, component_type type) override; virtual future make_component_sink(sstable& sst, component_type type, open_flags oflags, file_output_stream_options options) override; virtual future<> destroy(const sstable& sst) override { return make_ready_future<>(); } virtual noncopyable_function(std::vector)> atomic_deleter() const override { @@ -73,9 +73,8 @@ public: virtual sstring prefix() const override { return dir; } }; -future filesystem_storage::make_data_or_index_sink(sstable& sst, component_type type, io_priority_class pc) { +future filesystem_storage::make_data_or_index_sink(sstable& sst, component_type type) { file_output_stream_options options; - options.io_priority_class = pc; options.buffer_size = sst.sstable_buffer_size; options.write_behind = 10; @@ -116,7 +115,7 @@ future filesystem_storage::open_component(const sstable& sst, component_ty return f; } -void filesystem_storage::open(sstable& sst, const io_priority_class& pc) { +void filesystem_storage::open(sstable& sst) { touch_temp_dir(sst).get0(); auto file_path = sst.filename(component_type::TemporaryTOC); @@ -126,7 +125,6 @@ void filesystem_storage::open(sstable& sst, const io_priority_class& pc) { // sstable being created in parallel with the same generation. file_output_stream_options options; options.buffer_size = 4096; - options.io_priority_class = pc; auto w = sst.make_component_file_writer(component_type::TemporaryTOC, std::move(options)).get0(); bool toc_exists = file_exists(sst.filename(component_type::TOC)).get0(); @@ -439,10 +437,10 @@ public: virtual future<> snapshot(const sstable& sst, sstring dir, absolute_path abs) const override; virtual future<> change_state(const sstable& sst, sstring to, generation_type generation, delayed_commit_changes* delay) override; // runs in async context - virtual void open(sstable& sst, const io_priority_class& pc) override; + virtual void open(sstable& sst) override; virtual future<> wipe(const sstable& sst) noexcept override; virtual future open_component(const sstable& sst, component_type type, open_flags flags, file_open_options options, bool check_integrity) override; - virtual future make_data_or_index_sink(sstable& sst, component_type type, io_priority_class pc) override; + virtual future make_data_or_index_sink(sstable& sst, component_type type) override; virtual future make_component_sink(sstable& sst, component_type type, open_flags oflags, file_output_stream_options options) override; virtual future<> destroy(const sstable& sst) override { return make_ready_future<>(); @@ -465,7 +463,7 @@ future<> s3_storage::ensure_remote_prefix(const sstable& sst) { } } -void s3_storage::open(sstable& sst, const io_priority_class& pc) { +void s3_storage::open(sstable& sst) { auto uuid = utils::UUID_gen::get_time_UUID(); entry_descriptor desc("", "", "", sst._generation, sst._version, sst._format, component_type::TOC); sst.manager().system_keyspace().sstables_registry_create_entry(_location, uuid, status_creating, std::move(desc)).get(); @@ -489,7 +487,7 @@ future s3_storage::open_component(const sstable& sst, component_type type, co_return _client->make_readable_file(make_s3_object_name(sst, type)); } -future s3_storage::make_data_or_index_sink(sstable& sst, component_type type, io_priority_class pc) { +future s3_storage::make_data_or_index_sink(sstable& sst, component_type type) { assert(type == component_type::Data || type == component_type::Index); co_await ensure_remote_prefix(sst); // FIXME: if we have file size upper bound upfront, it's better to use make_upload_sink() instead diff --git a/sstables/storage.hh b/sstables/storage.hh index 0fcc1fcea8..2036bac510 100644 --- a/sstables/storage.hh +++ b/sstables/storage.hh @@ -53,10 +53,10 @@ public: virtual future<> snapshot(const sstable& sst, sstring dir, absolute_path abs) const = 0; virtual future<> change_state(const sstable& sst, sstring to, generation_type generation, delayed_commit_changes* delay) = 0; // runs in async context - virtual void open(sstable& sst, const io_priority_class& pc) = 0; + virtual void open(sstable& sst) = 0; virtual future<> wipe(const sstable& sst) noexcept = 0; virtual future open_component(const sstable& sst, component_type type, open_flags flags, file_open_options options, bool check_integrity) = 0; - virtual future make_data_or_index_sink(sstable& sst, component_type type, io_priority_class pc) = 0; + virtual future make_data_or_index_sink(sstable& sst, component_type type) = 0; virtual future make_component_sink(sstable& sst, component_type type, open_flags oflags, file_output_stream_options options) = 0; virtual future<> destroy(const sstable& sst) = 0; virtual noncopyable_function(std::vector)> atomic_deleter() const = 0; diff --git a/sstables/writer.cc b/sstables/writer.cc index ff889c1e42..85d7ea944a 100644 --- a/sstables/writer.cc +++ b/sstables/writer.cc @@ -14,11 +14,11 @@ namespace sstables { sstable_writer::sstable_writer(sstable& sst, const schema& s, uint64_t estimated_partitions, - const sstable_writer_config& cfg, encoding_stats enc_stats, const io_priority_class& pc, shard_id shard) { + const sstable_writer_config& cfg, encoding_stats enc_stats, shard_id shard) { if (sst.get_version() < oldest_writable_sstable_format) { on_internal_error(sstlog, format("writing sstables with too old format: {}", static_cast(sst.get_version()))); } - _impl = mc::make_writer(sst, s, estimated_partitions, cfg, enc_stats, pc, shard); + _impl = mc::make_writer(sst, s, estimated_partitions, cfg, enc_stats, shard); if (cfg.replay_position) { _impl->_collector.set_replay_position(cfg.replay_position.value()); } diff --git a/sstables/writer_impl.hh b/sstables/writer_impl.hh index 401501423f..0975e3e2e2 100644 --- a/sstables/writer_impl.hh +++ b/sstables/writer_impl.hh @@ -20,7 +20,6 @@ namespace sstables { struct sstable_writer::writer_impl { sstable& _sst; const schema& _schema; - const io_priority_class& _pc; const sstable_writer_config _cfg; // NOTE: _collector and _c_stats are used to generation of statistics file // when writing a new sstable. @@ -28,10 +27,9 @@ struct sstable_writer::writer_impl { column_stats _c_stats; mutation_fragment_stream_validating_filter _validator; - writer_impl(sstable& sst, const schema& schema, const io_priority_class& pc, const sstable_writer_config& cfg) + writer_impl(sstable& sst, const schema& schema, const sstable_writer_config& cfg) : _sst(sst) , _schema(schema) - , _pc(pc) , _cfg(cfg) , _collector(_schema, sst.get_filename(), sst.manager().get_local_host_id()) , _validator(format("sstable writer {}", _sst.get_filename()), _schema, _cfg.validation_level) diff --git a/streaming/consumer.cc b/streaming/consumer.cc index 3115a9a03a..5b748d7cf4 100644 --- a/streaming/consumer.cc +++ b/streaming/consumer.cc @@ -11,7 +11,6 @@ #include "consumer.hh" #include "replica/database.hh" #include "mutation/mutation_source_metadata.hh" -#include "service/priority_manager.hh" #include "db/view/view_update_generator.hh" #include "db/view/view_update_checks.hh" #include "sstables/sstables.hh" @@ -54,11 +53,10 @@ std::function (flat_mutation_reader_v2)> make_streaming_consumer(sstrin }); } schema_ptr s = reader.schema(); - auto& pc = service::get_local_streaming_priority(); return sst->write_components(std::move(reader), adjusted_estimated_partitions, s, cf->get_sstables_manager().configure_writer(origin), - encoding_stats{}, pc).then([sst] { + encoding_stats{}).then([sst] { return sst->open_data(); }).then([cf, sst, offstrategy, origin] { if (offstrategy && sstables::repair_origin == origin) { diff --git a/streaming/stream_manager.cc b/streaming/stream_manager.cc index daf8be57aa..8812d4774e 100644 --- a/streaming/stream_manager.cc +++ b/streaming/stream_manager.cc @@ -9,7 +9,6 @@ */ #include -#include "service/priority_manager.hh" #include "gms/gossiper.hh" #include "streaming/stream_manager.hh" #include "streaming/stream_result_future.hh" @@ -95,7 +94,7 @@ future<> stream_manager::stop() { future<> stream_manager::update_io_throughput(uint32_t value_mbs) { uint64_t bps = ((uint64_t)(value_mbs != 0 ? value_mbs : std::numeric_limits::max())) << 20; - return service::get_local_streaming_priority().update_bandwidth(bps).then_wrapped([value_mbs] (auto f) { + return _streaming_group.update_io_bandwidth(bps).then_wrapped([value_mbs] (auto f) { if (f.failed()) { sslog.warn("Couldn't update streaming bandwidth: {}", f.get_exception()); } else if (value_mbs != 0) { diff --git a/streaming/stream_session.cc b/streaming/stream_session.cc index 1d8f96d9bb..6fc704ebd0 100644 --- a/streaming/stream_session.cc +++ b/streaming/stream_session.cc @@ -23,7 +23,6 @@ #include "streaming/stream_state.hh" #include "streaming/stream_session_state.hh" #include "streaming/stream_exception.hh" -#include "service/priority_manager.hh" #include "service/migration_manager.hh" #include "query-request.hh" #include "schema/schema_registry.hh" diff --git a/streaming/stream_transfer_task.cc b/streaming/stream_transfer_task.cc index 59ec7f62ee..a278c75107 100644 --- a/streaming/stream_transfer_task.cc +++ b/streaming/stream_transfer_task.cc @@ -24,7 +24,6 @@ #include "range.hh" #include "dht/i_partitioner.hh" #include "dht/sharder.hh" -#include "service/priority_manager.hh" #include #include #include diff --git a/test/boost/cached_file_test.cc b/test/boost/cached_file_test.cc index 87c2d16972..0b71013bfe 100644 --- a/test/boost/cached_file_test.cc +++ b/test/boost/cached_file_test.cc @@ -54,13 +54,13 @@ static sstring read_to_string(file& f, size_t start, size_t len) { } static sstring read_to_string(cached_file& cf, size_t off, size_t limit = std::numeric_limits::max()) { - auto s = cf.read(off, default_priority_class(), std::nullopt); + auto s = cf.read(off, std::nullopt); return read_to_string(s, limit); } [[gnu::unused]] static void read_to_void(cached_file& cf, size_t off, size_t limit = std::numeric_limits::max()) { - auto s = cf.read(off, default_priority_class(), std::nullopt); + auto s = cf.read(off, std::nullopt); read_to_void(s, limit); } @@ -270,8 +270,8 @@ private: } public: // unsupported - virtual future write_dma(uint64_t pos, const void* buffer, size_t len, const io_priority_class& pc) override { unsupported(); } - virtual future write_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { unsupported(); } + virtual future write_dma(uint64_t pos, const void* buffer, size_t len, io_intent*) override { unsupported(); } + virtual future write_dma(uint64_t pos, std::vector iov, io_intent*) override { unsupported(); } virtual future<> flush(void) override { unsupported(); } virtual future<> truncate(uint64_t length) override { unsupported(); } virtual future<> discard(uint64_t offset, uint64_t length) override { unsupported(); } @@ -283,15 +283,15 @@ public: virtual future<> close() override { return make_ready_future<>(); } - virtual future> dma_read_bulk(uint64_t offset, size_t size, const io_priority_class& pc) override { + virtual future> dma_read_bulk(uint64_t offset, size_t size, io_intent*) override { return make_ready_future>(temporary_buffer(size)); } - virtual future read_dma(uint64_t pos, void* buffer, size_t len, const io_priority_class& pc) override { + virtual future read_dma(uint64_t pos, void* buffer, size_t len, io_intent*) override { unsupported(); // FIXME } - virtual future read_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { + virtual future read_dma(uint64_t pos, std::vector iov, io_intent*) override { unsupported(); // FIXME } }; diff --git a/test/boost/commitlog_test.cc b/test/boost/commitlog_test.cc index 9fdc4b2487..47f6b160e0 100644 --- a/test/boost/commitlog_test.cc +++ b/test/boost/commitlog_test.cc @@ -36,7 +36,6 @@ #include "db/extensions.hh" #include "readers/combined.hh" #include "log.hh" -#include "service/priority_manager.hh" #include "test/lib/exception_utils.hh" #include "test/lib/cql_test_env.hh" #include "test/lib/data_model.hh" @@ -355,7 +354,7 @@ SEASTAR_TEST_CASE(test_commitlog_delete_when_over_disk_limit) { SEASTAR_TEST_CASE(test_commitlog_reader){ static auto count_mutations_in_segment = [] (sstring path) -> future { auto count = make_lw_shared(0); - return db::commitlog::read_log_file(path, db::commitlog::descriptor::FILENAME_PREFIX, service::get_local_commitlog_priority(), [count](db::commitlog::buffer_and_replay_position buf_rp) { + return db::commitlog::read_log_file(path, db::commitlog::descriptor::FILENAME_PREFIX, [count](db::commitlog::buffer_and_replay_position buf_rp) { auto&& [buf, rp] = buf_rp; auto linearization_buffer = bytes_ostream(); auto in = buf.get_istream(); @@ -456,7 +455,7 @@ SEASTAR_TEST_CASE(test_commitlog_entry_corruption){ BOOST_REQUIRE(!segments.empty()); auto seg = segments[0]; return corrupt_segment(seg, rps->at(1).pos + 4, 0x451234ab).then([seg, rps] { - return db::commitlog::read_log_file(seg, db::commitlog::descriptor::FILENAME_PREFIX, service::get_local_commitlog_priority(), [rps](db::commitlog::buffer_and_replay_position buf_rp) { + return db::commitlog::read_log_file(seg, db::commitlog::descriptor::FILENAME_PREFIX, [rps](db::commitlog::buffer_and_replay_position buf_rp) { auto&& [buf, rp] = buf_rp; BOOST_CHECK_EQUAL(rp, rps->at(0)); return make_ready_future<>(); @@ -496,7 +495,7 @@ SEASTAR_TEST_CASE(test_commitlog_chunk_corruption){ BOOST_REQUIRE(!segments.empty()); auto seg = segments[0]; return corrupt_segment(seg, rps->at(0).pos - 4, 0x451234ab).then([seg, rps] { - return db::commitlog::read_log_file(seg, db::commitlog::descriptor::FILENAME_PREFIX, service::get_local_commitlog_priority(), [rps](db::commitlog::buffer_and_replay_position buf_rp) { + return db::commitlog::read_log_file(seg, db::commitlog::descriptor::FILENAME_PREFIX, [rps](db::commitlog::buffer_and_replay_position buf_rp) { BOOST_FAIL("Should not reach"); return make_ready_future<>(); }).then_wrapped([](auto&& f) { @@ -534,7 +533,7 @@ SEASTAR_TEST_CASE(test_commitlog_reader_produce_exception){ auto segments = log.get_active_segment_names(); BOOST_REQUIRE(!segments.empty()); auto seg = segments[0]; - return db::commitlog::read_log_file(seg, db::commitlog::descriptor::FILENAME_PREFIX, service::get_local_commitlog_priority(), [](db::commitlog::buffer_and_replay_position buf_rp) { + return db::commitlog::read_log_file(seg, db::commitlog::descriptor::FILENAME_PREFIX, [](db::commitlog::buffer_and_replay_position buf_rp) { return make_exception_future(std::runtime_error("I am in a throwing mode")); }).then_wrapped([](auto&& f) { try { @@ -698,7 +697,7 @@ SEASTAR_TEST_CASE(test_commitlog_add_entries) { std::unordered_set result; for (auto& seg : segments) { - db::commitlog::read_log_file(seg, db::commitlog::descriptor::FILENAME_PREFIX, service::get_local_commitlog_priority(), [&](db::commitlog::buffer_and_replay_position buf_rp) { + db::commitlog::read_log_file(seg, db::commitlog::descriptor::FILENAME_PREFIX, [&](db::commitlog::buffer_and_replay_position buf_rp) { commitlog_entry_reader r(buf_rp.buffer); auto& rp = buf_rp.position; auto i = std::find(rps.begin(), rps.end(), rp); diff --git a/test/boost/database_test.cc b/test/boost/database_test.cc index dd1dd186ae..6fabb50c20 100644 --- a/test/boost/database_test.cc +++ b/test/boost/database_test.cc @@ -275,11 +275,10 @@ static void test_database(void (*run_tests)(populate_fn_ex, bool)) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { - return cf.make_reader_v2(s, std::move(permit), range, slice, pc, std::move(trace_state), fwd, fwd_mr); + return cf.make_reader_v2(s, std::move(permit), range, slice, std::move(trace_state), fwd, fwd_mr); }); }, true); }).get(); @@ -1278,7 +1277,6 @@ SEASTAR_TEST_CASE(database_drop_column_family_clears_querier_cache) { database_test(db).get_user_read_concurrency_semaphore().make_tracking_only_permit(s.get(), "test", db::no_timeout, {}), query::full_partition_range, s->full_slice(), - default_priority_class(), nullptr); auto f = replica::database::drop_table_on_all_shards(e.db(), "ks", "cf"); diff --git a/test/boost/flat_mutation_reader_test.cc b/test/boost/flat_mutation_reader_test.cc index 513d7778b7..243eb10ed4 100644 --- a/test/boost/flat_mutation_reader_test.cc +++ b/test/boost/flat_mutation_reader_test.cc @@ -895,7 +895,6 @@ SEASTAR_THREAD_TEST_CASE(test_make_nonforwardable_from_mutations_as_mutation_sou reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding) mutable { @@ -935,7 +934,6 @@ SEASTAR_THREAD_TEST_CASE(test_mutation_reader_from_mutations_as_mutation_source) reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding) mutable { @@ -952,7 +950,6 @@ SEASTAR_THREAD_TEST_CASE(test_mutation_reader_from_mutations_v2_as_mutation_sour reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding) mutable { @@ -970,7 +967,6 @@ SEASTAR_THREAD_TEST_CASE(test_mutation_reader_from_fragments_v2_as_mutation_sour reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding) mutable { @@ -1131,7 +1127,6 @@ SEASTAR_THREAD_TEST_CASE(test_reverse_reader_v2_is_mutation_source) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_ptr, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) mutable { diff --git a/test/boost/memtable_test.cc b/test/boost/memtable_test.cc index 6841bc1cfd..7280b66560 100644 --- a/test/boost/memtable_test.cc +++ b/test/boost/memtable_test.cc @@ -7,7 +7,6 @@ */ #include -#include "service/priority_manager.hh" #include "replica/database.hh" #include "db/config.hh" #include "utils/UUID_gen.hh" @@ -537,7 +536,7 @@ SEASTAR_THREAD_TEST_CASE(test_tombstone_compaction_during_flush) { mt->apply(m); } - auto rd1 = mt->make_flat_reader(ss.schema(), semaphore.make_permit(), pr, s->full_slice(), default_priority_class(), + auto rd1 = mt->make_flat_reader(ss.schema(), semaphore.make_permit(), pr, s->full_slice(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); auto close_rd1 = defer([&] { rd1.close().get(); }); @@ -547,7 +546,7 @@ SEASTAR_THREAD_TEST_CASE(test_tombstone_compaction_during_flush) { auto rt = ss.delete_range(rt_m, ss.make_ckey_range(0, n_rows)); mt->apply(rt_m); - auto rd2 = mt->make_flat_reader(ss.schema(), semaphore.make_permit(), pr, s->full_slice(), default_priority_class(), + auto rd2 = mt->make_flat_reader(ss.schema(), semaphore.make_permit(), pr, s->full_slice(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); auto close_rd2 = defer([&] { rd2.close().get(); }); @@ -614,7 +613,7 @@ SEASTAR_THREAD_TEST_CASE(test_tombstone_merging_with_multiple_versions) { mt->apply(m1); - auto rd1 = mt->make_flat_reader(s, semaphore.make_permit(), pr, s->full_slice(), default_priority_class(), + auto rd1 = mt->make_flat_reader(s, semaphore.make_permit(), pr, s->full_slice(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); auto close_rd1 = defer([&] { rd1.close().get(); }); @@ -623,7 +622,7 @@ SEASTAR_THREAD_TEST_CASE(test_tombstone_merging_with_multiple_versions) { mt->apply(m2); - auto rd2 = mt->make_flat_reader(s, semaphore.make_permit(), pr, s->full_slice(), default_priority_class(), + auto rd2 = mt->make_flat_reader(s, semaphore.make_permit(), pr, s->full_slice(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); auto close_r2 = defer([&] { rd2.close().get(); }); @@ -662,7 +661,7 @@ SEASTAR_THREAD_TEST_CASE(test_tombstone_merging_with_mvcc_and_preemption) { mt->apply(m0); std::optional rd0 = mt->make_flat_reader( - s, semaphore.make_permit(), pr, s->full_slice(), default_priority_class(), + s, semaphore.make_permit(), pr, s->full_slice(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); auto close_rd0 = defer([&] { rd0->close().get(); }); rd0->fill_buffer().get(); @@ -676,7 +675,7 @@ SEASTAR_THREAD_TEST_CASE(test_tombstone_merging_with_mvcc_and_preemption) { mt->apply(m1); std::optional rd1 = mt->make_flat_reader( - s, semaphore.make_permit(), pr, s->full_slice(), default_priority_class(), + s, semaphore.make_permit(), pr, s->full_slice(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); auto close_rd1 = defer([&] { rd1->close().get(); }); rd1->fill_buffer().get(); diff --git a/test/boost/multishard_combining_reader_as_mutation_source_test.cc b/test/boost/multishard_combining_reader_as_mutation_source_test.cc index 715cd4e8e2..3c8c45c678 100644 --- a/test/boost/multishard_combining_reader_as_mutation_source_test.cc +++ b/test/boost/multishard_combining_reader_as_mutation_source_test.cc @@ -25,7 +25,6 @@ #include "dht/sharder.hh" #include "schema/schema_registry.hh" -#include "service/priority_manager.hh" #include "readers/forwardable_v2.hh" // It has to be a container that does not invalidate pointers @@ -66,7 +65,6 @@ static auto make_populate(bool evict_paused_readers, bool single_fragment_buffer reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) mutable { @@ -75,10 +73,9 @@ static auto make_populate(bool evict_paused_readers, bool single_fragment_buffer reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { - auto reader = remote_memtables->at(this_shard_id())->make_flat_reader(s, std::move(permit), range, slice, pc, std::move(trace_state), + auto reader = remote_memtables->at(this_shard_id())->make_flat_reader(s, std::move(permit), range, slice, std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr); if (single_fragment_buffer) { reader.set_max_buffer_size(1); @@ -88,7 +85,7 @@ static auto make_populate(bool evict_paused_readers, bool single_fragment_buffer auto lifecycle_policy = seastar::make_shared(std::move(factory), evict_paused_readers); auto mr = make_multishard_combining_reader_v2_for_tests(keep_alive_sharder.back(), std::move(lifecycle_policy), s, - std::move(permit), range, slice, pc, trace_state, fwd_mr); + std::move(permit), range, slice, trace_state, fwd_mr); if (fwd_sm == streamed_mutation::forwarding::yes) { return make_forwardable(std::move(mr)); } diff --git a/test/boost/mutation_fragment_test.cc b/test/boost/mutation_fragment_test.cc index ea3a232044..eb59d48214 100644 --- a/test/boost/mutation_fragment_test.cc +++ b/test/boost/mutation_fragment_test.cc @@ -59,14 +59,13 @@ SEASTAR_TEST_CASE(test_mutation_merger_conforms_to_mutation_source) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { std::vector readers; for (int i = 0; i < n; ++i) { - readers.push_back(memtables[i]->make_flat_reader(s, permit, range, slice, pc, trace_state, fwd, fwd_mr)); + readers.push_back(memtables[i]->make_flat_reader(s, permit, range, slice, trace_state, fwd, fwd_mr)); } return make_combined_reader(s, std::move(permit), std::move(readers), fwd, fwd_mr); }); diff --git a/test/boost/mutation_query_test.cc b/test/boost/mutation_query_test.cc index 6fffdb1508..6fc46599dd 100644 --- a/test/boost/mutation_query_test.cc +++ b/test/boost/mutation_query_test.cc @@ -31,7 +31,6 @@ #include "readers/from_mutations_v2.hh" #include "mutation/mutation_rebuilder.hh" #include "readers/mutation_source.hh" -#include "service/priority_manager.hh" using namespace std::literals::chrono_literals; @@ -54,7 +53,7 @@ struct mutation_less_cmp { }; static mutation_source make_source(std::vector mutations) { return mutation_source([mutations = std::move(mutations)] (schema_ptr s, reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { + tracing::trace_state_ptr, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { assert(range.is_full()); // slicing not implemented yet for (auto&& m : mutations) { if (slice.options.contains(query::partition_slice::option::reversed)) { @@ -85,7 +84,7 @@ query::result_set to_result_set(const reconcilable_result& r, schema_ptr s, cons static reconcilable_result mutation_query(schema_ptr s, reader_permit permit, const mutation_source& source, const dht::partition_range& range, const query::partition_slice& slice, uint64_t row_limit, uint32_t partition_limit, gc_clock::time_point query_time) { - auto querier = query::querier(source, s, std::move(permit), range, slice, service::get_local_sstable_query_read_priority(), {}); + auto querier = query::querier(source, s, std::move(permit), range, slice, {}); auto close_querier = deferred_close(querier); auto table_schema = slice.options.contains(query::partition_slice::option::reversed) ? s->make_reversed() : s; auto rrb = reconcilable_result_builder(*table_schema, slice, make_accounter()); @@ -539,7 +538,7 @@ SEASTAR_TEST_CASE(test_partition_limit) { static void data_query(schema_ptr s, reader_permit permit, const mutation_source& source, const dht::partition_range& range, const query::partition_slice& slice, query::result::builder& builder) { - auto querier = query::querier(source, s, std::move(permit), range, slice, service::get_local_sstable_query_read_priority(), {}); + auto querier = query::querier(source, s, std::move(permit), range, slice, {}); auto close_querier = deferred_close(querier); auto qrb = query_result_builder(*s, builder); querier.consume_page(std::move(qrb), std::numeric_limits::max(), std::numeric_limits::max(), gc_clock::now()).get(); diff --git a/test/boost/mutation_reader_test.cc b/test/boost/mutation_reader_test.cc index 134de33c0c..52a1b6202c 100644 --- a/test/boost/mutation_reader_test.cc +++ b/test/boost/mutation_reader_test.cc @@ -43,7 +43,6 @@ #include "replica/database.hh" #include "partition_slice_builder.hh" #include "schema/schema_registry.hh" -#include "service/priority_manager.hh" #include "utils/ranges.hh" #include "mutation/mutation_rebuilder.hh" @@ -739,7 +738,6 @@ SEASTAR_TEST_CASE(combined_mutation_reader_test) { list_permit, query::full_partition_range, s.schema()->full_slice(), - seastar::default_priority_class(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no)); @@ -753,7 +751,6 @@ SEASTAR_TEST_CASE(combined_mutation_reader_test) { env.make_reader_permit(), query::full_partition_range, s.schema()->full_slice(), - seastar::default_priority_class(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); @@ -1021,7 +1018,7 @@ SEASTAR_TEST_CASE(test_fast_forwarding_combined_reader_is_consistent_with_slicin readers.push_back(ds.make_reader_v2(s, permit, reader_ranges.back(), - s->full_slice(), default_priority_class(), nullptr, + s->full_slice(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::yes)); } @@ -1119,9 +1116,9 @@ SEASTAR_TEST_CASE(test_combined_reader_slicing_with_overlapping_range_tombstones // Check fast_forward_to() { auto permit = env.make_reader_permit(); - readers.push_back(ds1.make_reader_v2(s, permit, query::full_partition_range, s->full_slice(), default_priority_class(), + readers.push_back(ds1.make_reader_v2(s, permit, query::full_partition_range, s->full_slice(), nullptr, streamed_mutation::forwarding::yes)); - readers.push_back(ds2.make_reader_v2(s, permit, query::full_partition_range, s->full_slice(), default_priority_class(), + readers.push_back(ds2.make_reader_v2(s, permit, query::full_partition_range, s->full_slice(), nullptr, streamed_mutation::forwarding::yes)); auto rd = mutation_fragment_v1_stream(make_combined_reader(s, permit, std::move(readers), @@ -1221,7 +1218,6 @@ SEASTAR_THREAD_TEST_CASE(test_foreign_reader_as_mutation_source) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) { @@ -1231,7 +1227,6 @@ SEASTAR_THREAD_TEST_CASE(test_foreign_reader_as_mutation_source) { make_reader_permit(env), range, slice, - pc, trace_state.get(), fwd_sm, fwd_mr))); @@ -1245,11 +1240,10 @@ SEASTAR_THREAD_TEST_CASE(test_foreign_reader_as_mutation_source) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) { - return (*reader_factory_ptr)(std::move(s), std::move(permit), range, slice, pc, std::move(trace_state), fwd_sm, fwd_mr); + return (*reader_factory_ptr)(std::move(s), std::move(permit), range, slice, std::move(trace_state), fwd_sm, fwd_mr); }); }; @@ -1606,7 +1600,6 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_reading_empty_table) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { shards_touched[this_shard_id()] = true; @@ -1618,8 +1611,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_reading_empty_table) { s.schema(), make_reader_permit(env), query::full_partition_range, - s.schema()->full_slice(), - service::get_local_sstable_query_read_priority())) + s.schema()->full_slice())) .produces_end_of_stream(); for (unsigned i = 0; i < smp::count; ++i) { @@ -1867,7 +1859,6 @@ multishard_reader_for_read_ahead prepare_multishard_reader_for_read_ahead_test(s reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding) mutable { const auto shard = this_shard_id(); @@ -1888,7 +1879,7 @@ multishard_reader_for_read_ahead prepare_multishard_reader_for_read_ahead_test(s auto sharder = std::make_unique(s.schema()->get_sharder(), std::move(pkeys_by_tokens)); auto reader = make_multishard_combining_reader_v2_for_tests(*sharder, seastar::make_shared(std::move(factory)), - s.schema(), permit, *pr, s.schema()->full_slice(), service::get_local_sstable_query_read_priority()); + s.schema(), permit, *pr, s.schema()->full_slice()); return {std::move(reader), std::move(sharder), std::move(remote_controls), std::move(pr)}; } @@ -1911,7 +1902,6 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_custom_shard_number) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { shards_touched[this_shard_id()] = true; @@ -1924,8 +1914,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_custom_shard_number) { s.schema(), make_reader_permit(env), query::full_partition_range, - s.schema()->full_slice(), - service::get_local_sstable_query_read_priority())) + s.schema()->full_slice())) .produces_end_of_stream(); for (unsigned i = 0; i < no_shards; ++i) { @@ -1952,7 +1941,6 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_only_reads_from_needed reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { shards_touched[this_shard_id()] = true; @@ -1991,8 +1979,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_only_reads_from_needed s.schema(), make_reader_permit(env), pr, - s.schema()->full_slice(), - service::get_local_sstable_query_read_priority())) + s.schema()->full_slice())) .produces_end_of_stream(); for (unsigned i = 0; i < smp::count; ++i) { @@ -2196,7 +2183,6 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_next_partition) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) { auto& table = db->local().find_column_family(schema); @@ -2205,7 +2191,6 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_next_partition) { std::move(permit), range, slice, - service::get_local_sstable_query_read_priority(), std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr); @@ -2217,8 +2202,7 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_combining_reader_next_partition) { schema, make_reader_permit(env), query::full_partition_range, - schema->full_slice(), - service::get_local_sstable_query_read_priority()); + schema->full_slice()); reader.set_max_buffer_size(max_buffer_size); @@ -2284,16 +2268,15 @@ SEASTAR_THREAD_TEST_CASE(test_multishard_streaming_reader) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) mutable { auto& table = db->local().find_column_family(s); - return table.as_mutation_source().make_reader_v2(std::move(s), std::move(permit), range, slice, pc, std::move(trace_state), + return table.as_mutation_source().make_reader_v2(std::move(s), std::move(permit), range, slice, std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr); }; auto reference_reader = make_filtering_reader( make_multishard_combining_reader_v2(seastar::make_shared(std::move(reader_factory)), - schema, make_reader_permit(env), partition_range, schema->full_slice(), service::get_local_sstable_query_read_priority()), + schema, make_reader_permit(env), partition_range, schema->full_slice()), [&remote_partitioner] (const dht::decorated_key& pkey) { return remote_partitioner.shard_of(pkey.token()) == 0; }); @@ -2531,11 +2514,10 @@ SEASTAR_THREAD_TEST_CASE(test_compacting_reader_as_mutation_source) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) mutable { - auto source = mt->make_flat_reader(s, std::move(permit), range, slice, pc, std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr); + auto source = mt->make_flat_reader(s, std::move(permit), range, slice, std::move(trace_state), streamed_mutation::forwarding::no, fwd_mr); if (fwd_sm == streamed_mutation::forwarding::yes) { source = make_forwardable(std::move(source)); } @@ -2659,11 +2641,10 @@ SEASTAR_THREAD_TEST_CASE(test_auto_paused_evictable_reader_is_mutation_source) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) mutable { - auto mr = make_auto_paused_evictable_reader_v2(mt->as_data_source(), std::move(s), permit, range, slice, pc, std::move(trace_state), fwd_mr); + auto mr = make_auto_paused_evictable_reader_v2(mt->as_data_source(), std::move(s), permit, range, slice, std::move(trace_state), fwd_mr); if (fwd_sm == streamed_mutation::forwarding::yes) { return make_forwardable(std::move(mr)); } @@ -2693,11 +2674,10 @@ SEASTAR_THREAD_TEST_CASE(test_manual_paused_evictable_reader_is_mutation_source) reader_permit permit, const dht::partition_range& pr, const query::partition_slice& ps, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) : impl(std::move(query_schema), std::move(permit)), _reader(nullptr) { - std::tie(_reader, _handle) = make_manually_paused_evictable_reader_v2(mt.as_data_source(), _schema, _permit, pr, ps, pc, + std::tie(_reader, _handle) = make_manually_paused_evictable_reader_v2(mt.as_data_source(), _schema, _permit, pr, ps, std::move(trace_state), fwd_mr); } virtual future<> fill_buffer() override { @@ -2741,11 +2721,10 @@ SEASTAR_THREAD_TEST_CASE(test_manual_paused_evictable_reader_is_mutation_source) reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) mutable { - auto mr = make_flat_mutation_reader_v2(*mt, s, std::move(permit), range, slice, pc, std::move(trace_state), fwd_mr); + auto mr = make_flat_mutation_reader_v2(*mt, s, std::move(permit), range, slice, std::move(trace_state), fwd_mr); if (fwd_sm == streamed_mutation::forwarding::yes) { return make_forwardable(std::move(mr)); } @@ -2803,7 +2782,6 @@ flat_mutation_reader_v2 create_evictable_reader_and_evict_after_first_buffer( reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) { @@ -2826,7 +2804,6 @@ flat_mutation_reader_v2 create_evictable_reader_and_evict_after_first_buffer( permit, prange, slice, - seastar::default_priority_class(), nullptr, mutation_reader::forwarding::yes); @@ -3208,7 +3185,6 @@ SEASTAR_THREAD_TEST_CASE(test_evictable_reader_recreate_before_fast_forward_to) reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr tr, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { @@ -3229,7 +3205,7 @@ SEASTAR_THREAD_TEST_CASE(test_evictable_reader_recreate_before_fast_forward_to) auto pr0 = dht::partition_range::make({pkeys[0], true}, {pkeys[3], true}); auto [reader, handle] = make_manually_paused_evictable_reader_v2(std::move(ms), s.schema(), permit, pr0, s.schema()->full_slice(), - seastar::default_priority_class(), {}, mutation_reader::forwarding::yes); + {}, mutation_reader::forwarding::yes); auto reader_assert = assert_that(std::move(reader)); reader_assert.produces(pkeys[0]); @@ -3513,7 +3489,6 @@ SEASTAR_THREAD_TEST_CASE(test_evictable_reader_non_monotonic_positions) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) { @@ -3521,7 +3496,7 @@ SEASTAR_THREAD_TEST_CASE(test_evictable_reader_non_monotonic_positions) { reader.set_max_buffer_size(1); return reader; }); - auto reader = make_auto_paused_evictable_reader_v2(std::move(ms), schema, permit, prange, schema->full_slice(), seastar::default_priority_class(), + auto reader = make_auto_paused_evictable_reader_v2(std::move(ms), schema, permit, prange, schema->full_slice(), nullptr, mutation_reader::forwarding::no); auto close_reader = deferred_close(reader); @@ -3591,7 +3566,6 @@ SEASTAR_THREAD_TEST_CASE(test_evictable_reader_clear_tombstone_in_discontinued_p reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) mutable { @@ -3602,7 +3576,7 @@ SEASTAR_THREAD_TEST_CASE(test_evictable_reader_clear_tombstone_in_discontinued_p return reader; }); auto reader = make_auto_paused_evictable_reader_v2(std::move(ms), schema, permit, prange, schema->full_slice(), - seastar::default_priority_class(), nullptr, mutation_reader::forwarding::no); + nullptr, mutation_reader::forwarding::no); auto close_reader = deferred_close(reader); reader.fill_buffer().get(); @@ -3661,7 +3635,7 @@ SEASTAR_THREAD_TEST_CASE(test_evictable_reader_next_pos_is_partition_start) { return rd; }); - auto [rd, handle] = make_manually_paused_evictable_reader_v2(ms, schema, permit, prange, schema->full_slice(), default_priority_class(), {}, + auto [rd, handle] = make_manually_paused_evictable_reader_v2(ms, schema, permit, prange, schema->full_slice(), {}, mutation_reader::forwarding::no); auto stop_rd = deferred_close(rd); rd.set_max_buffer_size(max_buf_size); @@ -3871,7 +3845,7 @@ static future<> do_test_clustering_order_merger_sstable_set(bool reversed) { auto q = sst_set.make_position_reader_queue( [query_schema, &pr, &query_slice, fwd, permit] (sstable& sst) { return sst.make_reader(query_schema, permit, pr, - query_slice, seastar::default_priority_class(), nullptr, fwd); + query_slice, nullptr, fwd); }, [included_gens] (const sstable& sst) { return included_gens.contains(sst.generation()); }, pk.key(), query_schema, permit, fwd, reversed); @@ -4133,7 +4107,6 @@ SEASTAR_THREAD_TEST_CASE(clustering_combined_reader_mutation_source_test) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) { @@ -4213,7 +4186,6 @@ SEASTAR_THREAD_TEST_CASE(test_generating_reader_v1) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) { @@ -4236,7 +4208,6 @@ SEASTAR_THREAD_TEST_CASE(test_generating_reader_v2) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd_sm, mutation_reader::forwarding fwd_mr) { diff --git a/test/boost/mutation_writer_test.cc b/test/boost/mutation_writer_test.cc index 0abe5a9f58..6b4514d07c 100644 --- a/test/boost/mutation_writer_test.cc +++ b/test/boost/mutation_writer_test.cc @@ -516,7 +516,7 @@ SEASTAR_THREAD_TEST_CASE(test_partition_based_splitting_mutation_writer) { testlog.info("Segregating with in-memory method (max_memory={})", max_memory); mutation_writer::segregate_by_partition( make_flat_mutation_reader_from_mutations_v2(random_schema.schema(), semaphore.make_permit(), shuffled_input_mutations), - mutation_writer::segregate_config{default_priority_class(), max_memory}, + mutation_writer::segregate_config{max_memory}, consumer).get(); testlog.info("Done segregating with in-memory method (max_memory={}): input segregated into {} buckets", max_memory, output_mutations.size()); check_and_reset(); diff --git a/test/boost/querier_cache_test.cc b/test/boost/querier_cache_test.cc index 7eb77fc8b3..e13fba96f7 100644 --- a/test/boost/querier_cache_test.cc +++ b/test/boost/querier_cache_test.cc @@ -8,7 +8,6 @@ #include "querier.hh" #include "mutation_query.hh" -#include "service/priority_manager.hh" #include "test/lib/simple_schema.hh" #include "test/lib/cql_test_env.hh" #include "test/lib/random_utils.hh" @@ -109,7 +108,6 @@ private: _sem.make_tracking_only_permit(_s.schema().get(), "make-querier", db::no_timeout, {}), range, _s.schema()->full_slice(), - service::get_local_sstable_query_read_priority(), nullptr); } diff --git a/test/boost/reader_concurrency_semaphore_test.cc b/test/boost/reader_concurrency_semaphore_test.cc index 377ea95885..35a1130b38 100644 --- a/test/boost/reader_concurrency_semaphore_test.cc +++ b/test/boost/reader_concurrency_semaphore_test.cc @@ -353,19 +353,19 @@ SEASTAR_THREAD_TEST_CASE(test_reader_concurrency_semaphore_forward_progress) { } class dummy_file_impl : public file_impl { - virtual future write_dma(uint64_t pos, const void* buffer, size_t len, const io_priority_class& pc) override { + virtual future write_dma(uint64_t pos, const void* buffer, size_t len, io_intent*) override { return make_ready_future(0); } - virtual future write_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { + virtual future write_dma(uint64_t pos, std::vector iov, io_intent*) override { return make_ready_future(0); } - virtual future read_dma(uint64_t pos, void* buffer, size_t len, const io_priority_class& pc) override { + virtual future read_dma(uint64_t pos, void* buffer, size_t len, io_intent*) override { return make_ready_future(0); } - virtual future read_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { + virtual future read_dma(uint64_t pos, std::vector iov, io_intent*) override { return make_ready_future(0); } @@ -401,7 +401,7 @@ class dummy_file_impl : public file_impl { throw_with_backtrace(); } - virtual future> dma_read_bulk(uint64_t offset, size_t range_size, const io_priority_class& pc) override { + virtual future> dma_read_bulk(uint64_t offset, size_t range_size, io_intent*) override { temporary_buffer buf(range_size); memset(buf.get_write(), 0xff, buf.size()); diff --git a/test/boost/row_cache_test.cc b/test/boost/row_cache_test.cc index 6f1aecc23b..84807198bf 100644 --- a/test/boost/row_cache_test.cc +++ b/test/boost/row_cache_test.cc @@ -84,7 +84,7 @@ snapshot_source make_decorated_snapshot_source(snapshot_source src, std::functio } mutation_source make_source_with(mutation m) { - return mutation_source([m] (schema_ptr s, reader_permit permit, const dht::partition_range&, const query::partition_slice&, const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding fwd) { + return mutation_source([m] (schema_ptr s, reader_permit permit, const dht::partition_range&, const query::partition_slice&, tracing::trace_state_ptr, streamed_mutation::forwarding fwd) { assert(m.schema() == s); return make_flat_mutation_reader_from_mutations_v2(s, std::move(permit), m, std::move(fwd)); }); @@ -196,7 +196,6 @@ SEASTAR_TEST_CASE(test_cache_delegates_to_underlying_only_once_empty_full_range) reader_permit permit, const dht::partition_range& range, const query::partition_slice&, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding fwd) { return make_counting_reader(make_empty_flat_reader_v2(s, std::move(permit)), secondary_calls_count); @@ -228,7 +227,6 @@ SEASTAR_TEST_CASE(test_cache_delegates_to_underlying_only_once_empty_single_part reader_permit permit, const dht::partition_range& range, const query::partition_slice&, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding fwd) { return make_counting_reader(make_empty_flat_reader_v2(s, std::move(permit)), secondary_calls_count); @@ -254,7 +252,6 @@ SEASTAR_TEST_CASE(test_cache_uses_continuity_info_for_single_partition_query) { reader_permit permit, const dht::partition_range& range, const query::partition_slice&, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding fwd) { return make_counting_reader(make_empty_flat_reader_v2(s, std::move(permit)), secondary_calls_count); @@ -284,7 +281,6 @@ void test_cache_delegates_to_underlying_only_once_with_single_partition(schema_p reader_permit permit, const dht::partition_range& range, const query::partition_slice&, - const io_priority_class&, tracing::trace_state_ptr, streamed_mutation::forwarding fwd) { assert(m.schema() == s); @@ -388,8 +384,8 @@ SEASTAR_TEST_CASE(test_cache_delegates_to_underlying_only_once_multiple_mutation auto make_cache = [&tracker, &mt](schema_ptr s, int& secondary_calls_count) -> lw_shared_ptr { auto secondary = mutation_source([&mt, &secondary_calls_count] (schema_ptr s, reader_permit permit, const dht::partition_range& range, - const query::partition_slice& slice, const io_priority_class& pc, tracing::trace_state_ptr trace, streamed_mutation::forwarding fwd) { - return make_counting_reader(mt->make_flat_reader(s, std::move(permit), range, slice, pc, std::move(trace), std::move(fwd)), secondary_calls_count); + const query::partition_slice& slice, tracing::trace_state_ptr trace, streamed_mutation::forwarding fwd) { + return make_counting_reader(mt->make_flat_reader(s, std::move(permit), range, slice, std::move(trace), std::move(fwd)), secondary_calls_count); }); return make_lw_shared(s, snapshot_source_from_snapshot(secondary), tracker); @@ -398,8 +394,8 @@ SEASTAR_TEST_CASE(test_cache_delegates_to_underlying_only_once_multiple_mutation auto make_ds = [&make_cache](schema_ptr s, int& secondary_calls_count) -> mutation_source { auto cache = make_cache(s, secondary_calls_count); return mutation_source([cache] (schema_ptr s, reader_permit permit, const dht::partition_range& range, - const query::partition_slice& slice, const io_priority_class& pc, tracing::trace_state_ptr trace, streamed_mutation::forwarding fwd) { - return cache->make_reader(s, std::move(permit), range, slice, pc, std::move(trace), std::move(fwd)); + const query::partition_slice& slice, tracing::trace_state_ptr trace, streamed_mutation::forwarding fwd) { + return cache->make_reader(s, std::move(permit), range, slice, std::move(trace), std::move(fwd)); }); }; @@ -523,8 +519,8 @@ SEASTAR_TEST_CASE(test_cache_delegates_to_underlying_only_once_multiple_mutation auto cache = make_cache(s, secondary_calls_count); auto ds = mutation_source([cache] (schema_ptr s, reader_permit permit, const dht::partition_range& range, - const query::partition_slice& slice, const io_priority_class& pc, tracing::trace_state_ptr trace, streamed_mutation::forwarding fwd) { - return cache->make_reader(s, std::move(permit), range, slice, pc, std::move(trace), std::move(fwd)); + const query::partition_slice& slice, tracing::trace_state_ptr trace, streamed_mutation::forwarding fwd) { + return cache->make_reader(s, std::move(permit), range, slice, std::move(trace), std::move(fwd)); }); test(ds, query::full_partition_range, partitions.size() + 1); @@ -716,11 +712,10 @@ SEASTAR_TEST_CASE(test_row_cache_conforms_to_mutation_source) { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { - return cache->make_reader(s, std::move(permit), range, slice, pc, std::move(trace_state), fwd, fwd_mr); + return cache->make_reader(s, std::move(permit), range, slice, std::move(trace_state), fwd, fwd_mr); }); }); }); @@ -786,11 +781,10 @@ SEASTAR_TEST_CASE(test_presence_checker_runs_under_right_allocator) { reader_permit permit, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr tr, streamed_mutation::forwarding fwd, mutation_reader::forwarding mr_fwd) { - return ms.make_reader_v2(s, std::move(permit), pr, slice, pc, std::move(tr), fwd, mr_fwd); + return ms.make_reader_v2(s, std::move(permit), pr, slice, std::move(tr), fwd, mr_fwd); }, [] { return [saved = managed_bytes()] (const dht::decorated_key& key) mutable { // size large enough to defeat the small blob optimization @@ -1308,8 +1302,8 @@ private: { } flat_mutation_reader_v2 make_reader(schema_ptr s, reader_permit permit, const dht::partition_range& pr, - const query::partition_slice& slice, const io_priority_class& pc, tracing::trace_state_ptr trace, streamed_mutation::forwarding fwd) { - return make_flat_mutation_reader_v2(_throttle, _underlying.make_reader_v2(s, std::move(permit), pr, slice, pc, std::move(trace), std::move(fwd))); + const query::partition_slice& slice, tracing::trace_state_ptr trace, streamed_mutation::forwarding fwd) { + return make_flat_mutation_reader_v2(_throttle, _underlying.make_reader_v2(s, std::move(permit), pr, slice, std::move(trace), std::move(fwd))); } }; lw_shared_ptr _impl; @@ -1320,8 +1314,8 @@ public: operator mutation_source() const { return mutation_source([impl = _impl] (schema_ptr s, reader_permit permit, const dht::partition_range& pr, - const query::partition_slice& slice, const io_priority_class& pc, tracing::trace_state_ptr trace, streamed_mutation::forwarding fwd) { - return impl->make_reader(std::move(s), std::move(permit), pr, slice, pc, std::move(trace), std::move(fwd)); + const query::partition_slice& slice, tracing::trace_state_ptr trace, streamed_mutation::forwarding fwd) { + return impl->make_reader(std::move(s), std::move(permit), pr, slice, std::move(trace), std::move(fwd)); }); } }; @@ -3594,9 +3588,9 @@ SEASTAR_TEST_CASE(test_alter_then_preempted_update_then_memtable_read) { yield().get(); } - auto mt2_reader = mt2->make_flat_reader(s, semaphore.make_permit(), pr, s->full_slice(), default_priority_class(), + auto mt2_reader = mt2->make_flat_reader(s, semaphore.make_permit(), pr, s->full_slice(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); - auto cache_reader = cache.make_reader(s, semaphore.make_permit(), pr, s->full_slice(), default_priority_class(), + auto cache_reader = cache.make_reader(s, semaphore.make_permit(), pr, s->full_slice(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); assert_that(std::move(mt2_reader)).produces(m2); diff --git a/test/boost/sstable_3_x_test.cc b/test/boost/sstable_3_x_test.cc index ed34a5e588..9d2b4f8f2a 100644 --- a/test/boost/sstable_3_x_test.cc +++ b/test/boost/sstable_3_x_test.cc @@ -79,13 +79,13 @@ public: _sst->read_toc().get(); } void read_summary() { - _sst->read_summary(default_priority_class()).get(); + _sst->read_summary().get(); } void read_filter() { - _sst->read_filter(default_priority_class()).get(); + _sst->read_filter().get(); } void read_statistics() { - _sst->read_statistics(default_priority_class()).get(); + _sst->read_statistics().get(); } void load() { _sst->load().get(); @@ -109,7 +109,6 @@ public: flat_mutation_reader_v2 make_reader( const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc = default_priority_class(), tracing::trace_state_ptr trace_state = {}, streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no, mutation_reader::forwarding fwd_mr = mutation_reader::forwarding::yes, @@ -118,7 +117,6 @@ public: _env.make_reader_permit(), range, slice, - pc, std::move(trace_state), fwd, fwd_mr, @@ -273,7 +271,6 @@ SEASTAR_TEST_CASE(test_uncompressed_filtering_and_forwarding_read) { { auto r = assert_that(sst.make_reader(query::full_partition_range, UNCOMPRESSED_FILTERING_AND_FORWARDING_SCHEMA->full_slice(), - default_priority_class(), tracing::trace_state_ptr(), streamed_mutation::forwarding::yes)); r.produces_partition_start(to_key(1)) @@ -321,7 +318,6 @@ SEASTAR_TEST_CASE(test_uncompressed_filtering_and_forwarding_read) { .build(); auto r = assert_that(sst.make_reader(query::full_partition_range, slice, - default_priority_class(), tracing::trace_state_ptr(), streamed_mutation::forwarding::yes)); @@ -537,7 +533,6 @@ SEASTAR_TEST_CASE(test_uncompressed_skip_using_index_rows) { { auto rd = sst.make_reader(query::full_partition_range, UNCOMPRESSED_SKIP_USING_INDEX_ROWS_SCHEMA->full_slice(), - default_priority_class(), tracing::trace_state_ptr(), streamed_mutation::forwarding::yes); rd.set_max_buffer_size(1); @@ -577,7 +572,6 @@ SEASTAR_TEST_CASE(test_uncompressed_skip_using_index_rows) { .build(); auto rd = sst.make_reader(query::full_partition_range, slice, - default_priority_class(), tracing::trace_state_ptr(), streamed_mutation::forwarding::yes); rd.set_max_buffer_size(1); @@ -754,7 +748,6 @@ SEASTAR_TEST_CASE(test_uncompressed_filtering_and_forwarding_range_tombstones_re { auto r = make_assertions(sst.make_reader(query::full_partition_range, UNCOMPRESSED_FILTERING_AND_FORWARDING_SCHEMA->full_slice(), - default_priority_class(), tracing::trace_state_ptr(), streamed_mutation::forwarding::yes)); std::array rt_deletion_times {1534898600, 1534899416}; @@ -874,7 +867,6 @@ SEASTAR_TEST_CASE(test_uncompressed_filtering_and_forwarding_range_tombstones_re auto r = make_assertions(sst.make_reader(query::full_partition_range, slice, - default_priority_class(), tracing::trace_state_ptr(), streamed_mutation::forwarding::yes)); @@ -1050,7 +1042,6 @@ SEASTAR_TEST_CASE(test_uncompressed_slicing_interleaved_rows_and_rts_read) { { auto r = make_assertions(sst.make_reader(query::full_partition_range, UNCOMPRESSED_SLICING_INTERLEAVED_ROWS_AND_RTS_SCHEMA->full_slice(), - default_priority_class(), tracing::trace_state_ptr(), streamed_mutation::forwarding::yes)) .ignore_deletion_time(); @@ -1113,7 +1104,6 @@ SEASTAR_TEST_CASE(test_uncompressed_slicing_interleaved_rows_and_rts_read) { auto r = make_assertions(sst.make_reader(query::full_partition_range, slice, - default_priority_class(), tracing::trace_state_ptr(), streamed_mutation::forwarding::yes)) .ignore_deletion_time(); @@ -3037,7 +3027,7 @@ static flat_mutation_reader_v2 compacted_sstable_reader(test_env& env, schema_pt auto sstables = open_sstables(env, s, format("test/resource/sstables/3.x/uncompressed/{}", table_name), generations); sstables::shared_sstable compacted_sst; - auto desc = sstables::compaction_descriptor(std::move(sstables), default_priority_class()); + auto desc = sstables::compaction_descriptor(std::move(sstables)); desc.creator = [&] (shard_id dummy) { compacted_sst = env.make_sstable(s); return compacted_sst; @@ -4780,7 +4770,6 @@ SEASTAR_TEST_CASE(test_uncompressed_read_two_rows_fast_forwarding) { auto r = assert_that(sst.make_reader(query::full_partition_range, s->full_slice(), - default_priority_class(), tracing::trace_state_ptr(), streamed_mutation::forwarding::yes)); r.produces_partition_start(to_pkey(0)) diff --git a/test/boost/sstable_compaction_test.cc b/test/boost/sstable_compaction_test.cc index 0848c591c6..a480163b27 100644 --- a/test/boost/sstable_compaction_test.cc +++ b/test/boost/sstable_compaction_test.cc @@ -51,7 +51,6 @@ #include "test/lib/sstable_run_based_compaction_strategy_for_tests.hh" #include "compatible_ring_position.hh" #include "mutation/mutation_compactor.hh" -#include "service/priority_manager.hh" #include "db/config.hh" #include "mutation_writer/partition_based_splitting_writer.hh" #include "compaction/table_state.hh" @@ -221,7 +220,7 @@ SEASTAR_TEST_CASE(compact) { new_sstables.push_back(sst); return sst; }; - compact_sstables(sstables::compaction_descriptor(std::move(sstables), default_priority_class()), cf, new_sstable).get(); + compact_sstables(sstables::compaction_descriptor(std::move(sstables)), cf, new_sstable).get(); // Verify that the compacted sstable has the right content. We expect to see: // name | age | height // -------+-----+-------- @@ -358,8 +357,7 @@ static future compact_sstables(test_env& env, std::vect auto sstables_to_compact = sstables::size_tiered_compaction_strategy::most_interesting_bucket(sstables, min_threshold, max_threshold); // We do expect that all candidates were selected for compaction (in this case). BOOST_REQUIRE(sstables_to_compact.size() == sstables.size()); - (void)compact_sstables(sstables::compaction_descriptor(std::move(sstables_to_compact), - default_priority_class()), cf, new_sstable).get(); + (void)compact_sstables(sstables::compaction_descriptor(std::move(sstables_to_compact)), cf, new_sstable).get(); } else if (strategy == compaction_strategy_type::leveled) { std::vector candidates; candidates.reserve(sstables.size()); @@ -378,7 +376,7 @@ static future compact_sstables(test_env& env, std::vect BOOST_REQUIRE(candidate.max_sstable_bytes == 1024*1024); (void)compact_sstables(sstables::compaction_descriptor(std::move(candidate.sstables), - default_priority_class(), candidate.level, 1024*1024), cf, new_sstable).get(); + candidate.level, 1024*1024), cf, new_sstable).get(); } else { throw std::runtime_error("unexpected strategy"); } @@ -967,7 +965,7 @@ SEASTAR_TEST_CASE(tombstone_purge_test) { for (auto&& sst : all) { column_family_test(cf).add_sstable(sst).get(); } - return compact_sstables(sstables::compaction_descriptor(to_compact, default_priority_class()), cf, sst_gen).get0().new_sstables; + return compact_sstables(sstables::compaction_descriptor(to_compact), cf, sst_gen).get0().new_sstables; }; auto next_timestamp = [] { @@ -1177,7 +1175,7 @@ SEASTAR_TEST_CASE(sstable_rewrite) { std::vector sstables; sstables.push_back(std::move(sstp)); - compact_sstables(sstables::compaction_descriptor(std::move(sstables), default_priority_class()), cf, creator).get(); + compact_sstables(sstables::compaction_descriptor(std::move(sstables)), cf, creator).get(); BOOST_REQUIRE(new_tables.size() == 1); auto newsst = new_tables[0]; auto reader = sstable_reader(newsst, s, env.make_reader_permit()); @@ -1238,7 +1236,7 @@ SEASTAR_TEST_CASE(test_sstable_max_local_deletion_time_2) { BOOST_REQUIRE(now.time_since_epoch().count() == sst2->get_stats_metadata().max_local_deletion_time); auto creator = sst_gen; - auto info = compact_sstables(sstables::compaction_descriptor({sst1, sst2}, default_priority_class()), cf, creator).get0(); + auto info = compact_sstables(sstables::compaction_descriptor({sst1, sst2}), cf, creator).get0(); BOOST_REQUIRE(info.new_sstables.size() == 1); BOOST_REQUIRE(((now + gc_clock::duration(100)).time_since_epoch().count()) == info.new_sstables.front()->get_stats_metadata().max_local_deletion_time); @@ -1325,7 +1323,7 @@ SEASTAR_TEST_CASE(compaction_with_fully_expired_table) { auto expired_sst = *expired.begin(); BOOST_REQUIRE(expired_sst == sst); - auto ret = compact_sstables(sstables::compaction_descriptor(ssts, default_priority_class()), cf, sst_gen).get0(); + auto ret = compact_sstables(sstables::compaction_descriptor(ssts), cf, sst_gen).get0(); BOOST_REQUIRE(ret.new_sstables.empty()); BOOST_REQUIRE(ret.stats.end_size == 0); }); @@ -1627,7 +1625,7 @@ SEASTAR_TEST_CASE(time_window_strategy_size_tiered_behavior_correctness) { auto close_cf = deferred_stop(cf); auto major_compact_bucket = [&] (api::timestamp_type window_ts) { auto bound = time_window_compaction_strategy::get_window_lower_bound(window_size, window_ts); - auto ret = compact_sstables(sstables::compaction_descriptor(std::move(buckets[bound]), default_priority_class()), cf, sst_gen).get0(); + auto ret = compact_sstables(sstables::compaction_descriptor(std::move(buckets[bound])), cf, sst_gen).get0(); BOOST_REQUIRE(ret.new_sstables.size() == 1); buckets[bound] = std::move(ret.new_sstables); }; @@ -1723,7 +1721,7 @@ SEASTAR_TEST_CASE(min_max_clustering_key_test_2) { check_min_max_column_names(sst2, {"9ck101"}, {"9ck298"}); auto creator = sst_gen; - auto info = compact_sstables(sstables::compaction_descriptor({sst, sst2}, default_priority_class()), cf, creator).get0(); + auto info = compact_sstables(sstables::compaction_descriptor({sst, sst2}), cf, creator).get0(); BOOST_REQUIRE(info.new_sstables.size() == 1); check_min_max_column_names(info.new_sstables.front(), {"0ck100"}, {"9ck298"}); } @@ -1805,7 +1803,7 @@ SEASTAR_TEST_CASE(sstable_expired_data_ratio) { BOOST_REQUIRE(std::fabs(run.estimate_droppable_tombstone_ratio(gc_before) - expired) <= 0.1); auto creator = sst_gen; - auto info = compact_sstables(sstables::compaction_descriptor({ sst }, default_priority_class()), cf, creator).get0(); + auto info = compact_sstables(sstables::compaction_descriptor({ sst }), cf, creator).get0(); BOOST_REQUIRE(info.new_sstables.size() == 1); BOOST_REQUIRE(info.new_sstables.front()->estimate_droppable_tombstone_ratio(gc_before) == 0.0f); BOOST_REQUIRE_CLOSE(info.new_sstables.front()->data_size(), uncompacted_size*(1-expired), 5); @@ -1878,7 +1876,7 @@ SEASTAR_TEST_CASE(compaction_correctness_with_partitioned_sstable_set) { std::for_each(all.begin(), all.end(), [] (auto& sst) { sst->set_sstable_level(1); }); auto cf = env.make_table_for_tests(s); auto close_cf = deferred_stop(cf); - return compact_sstables(sstables::compaction_descriptor(std::move(all), default_priority_class(), 0, 0 /*std::numeric_limits::max()*/), + return compact_sstables(sstables::compaction_descriptor(std::move(all), 0, 0 /*std::numeric_limits::max()*/), cf, sst_gen).get0().new_sstables; }; @@ -1997,7 +1995,7 @@ SEASTAR_TEST_CASE(sstable_cleanup_correctness_test) { cf->start(); auto local_ranges = compaction::make_owned_ranges_ptr(db.get_keyspace_local_ranges(ks_name)); - auto descriptor = sstables::compaction_descriptor({std::move(sst)}, default_priority_class(), compaction_descriptor::default_level, + auto descriptor = sstables::compaction_descriptor({std::move(sst)}, compaction_descriptor::default_level, compaction_descriptor::default_max_sstable_bytes, run_identifier, compaction_type_options::make_cleanup(), std::move(local_ranges)); auto ret = compact_sstables(std::move(descriptor), cf, sst_gen).get0(); @@ -2259,7 +2257,7 @@ SEASTAR_TEST_CASE(sstable_validate_test) { uint64_t count = 0; auto sst = make_sst(std::move(frags)); - const auto errors = sst->validate(permit, default_priority_class(), abort, error_handler{count}).get(); + const auto errors = sst->validate(permit, abort, error_handler{count}).get(); BOOST_REQUIRE_EQUAL(errors, 0); BOOST_REQUIRE_EQUAL(errors, count); } @@ -2273,7 +2271,7 @@ SEASTAR_TEST_CASE(sstable_validate_test) { uint64_t count = 0; auto sst = make_sst(std::move(frags)); - const auto errors = sst->validate(permit, default_priority_class(), abort, error_handler{count}).get(); + const auto errors = sst->validate(permit, abort, error_handler{count}).get(); BOOST_REQUIRE_NE(errors, 0); BOOST_REQUIRE_EQUAL(errors, count); } @@ -2291,7 +2289,7 @@ SEASTAR_TEST_CASE(sstable_validate_test) { uint64_t count = 0; auto sst = make_sst(std::move(frags)); - const auto errors = sst->validate(permit, default_priority_class(), abort, error_handler{count}).get(); + const auto errors = sst->validate(permit, abort, error_handler{count}).get(); BOOST_REQUIRE_NE(errors, 0); BOOST_REQUIRE_EQUAL(errors, count); } @@ -2699,7 +2697,7 @@ SEASTAR_THREAD_TEST_CASE(test_scrub_segregate_stack) { uint64_t validation_errors = 0; mutation_writer::segregate_by_partition( make_scrubbing_reader(make_flat_mutation_reader_from_fragments(schema, permit, std::move(all_fragments)), sstables::compaction_type_options::scrub::mode::segregate, validation_errors), - mutation_writer::segregate_config{default_priority_class(), 100000}, + mutation_writer::segregate_config{100000}, [&schema, &segregated_fragment_streams] (flat_mutation_reader_v2 rd) { return async([&schema, &segregated_fragment_streams, rd = std::move(rd)] () mutable { auto close = deferred_close(rd); @@ -2863,7 +2861,7 @@ SEASTAR_TEST_CASE(sstable_run_based_compaction_test) { cf->start(); cf->set_compaction_strategy(sstables::compaction_strategy_type::size_tiered); auto compact = [&, s] (std::vector all, auto replacer) -> std::vector { - return compact_sstables(cf.get_compaction_manager(), sstables::compaction_descriptor(std::move(all), default_priority_class(), 1, 0), cf.as_table_state(), sst_gen, replacer).get0().new_sstables; + return compact_sstables(cf.get_compaction_manager(), sstables::compaction_descriptor(std::move(all), 1, 0), cf.as_table_state(), sst_gen, replacer).get0().new_sstables; }; auto make_insert = [&] (const dht::decorated_key& key) { mutation m(s, key); @@ -3001,7 +2999,6 @@ SEASTAR_TEST_CASE(compaction_strategy_aware_major_compaction_test) { auto descriptor = cs.get_major_compaction_job(cf.as_table_state(), candidates); BOOST_REQUIRE(descriptor.sstables.size() == candidates.size()); BOOST_REQUIRE(uint32_t(descriptor.level) == leveled_compaction_strategy::ideal_level_for_input(candidates, 160*1024*1024)); - BOOST_REQUIRE(descriptor.io_priority.id() == service::get_local_streaming_priority().id()); } { @@ -3009,7 +3006,6 @@ SEASTAR_TEST_CASE(compaction_strategy_aware_major_compaction_test) { auto descriptor = cs.get_major_compaction_job(cf.as_table_state(), candidates); BOOST_REQUIRE(descriptor.sstables.size() == candidates.size()); BOOST_REQUIRE(descriptor.level == 0); - BOOST_REQUIRE(descriptor.io_priority.id() == service::get_local_streaming_priority().id()); } }); } @@ -3050,7 +3046,7 @@ SEASTAR_TEST_CASE(backlog_tracker_correctness_after_changing_compaction_strategy // Start compaction, then stop tracking compaction, switch to TWCS, wait for compaction to finish and check for backlog. // That's done to assert backlog will work for compaction that is finished and was stopped tracking. - auto fut = compact_sstables(sstables::compaction_descriptor(ssts, default_priority_class()), cf, sst_gen); + auto fut = compact_sstables(sstables::compaction_descriptor(ssts), cf, sst_gen); // set_compaction_strategy() itself is responsible for transferring charges from old to new backlog tracker. cf->set_compaction_strategy(sstables::compaction_strategy_type::time_window); @@ -3125,8 +3121,7 @@ SEASTAR_TEST_CASE(purged_tombstone_consumer_sstable_test) { public: explicit compacting_sstable_writer_test(const schema_ptr& s, shared_sstable& sst, sstables_manager& manager) : _sst(sst), - _writer(sst->get_writer(*s, 1, manager.configure_writer("test"), - encoding_stats{}, service::get_local_compaction_priority())) {} + _writer(sst->get_writer(*s, 1, manager.configure_writer("test"), encoding_stats{})) {} void consume_new_partition(const dht::decorated_key& dk) { _writer.consume_new_partition(dk); } void consume(tombstone t) { _writer.consume(t); } @@ -3171,7 +3166,6 @@ SEASTAR_TEST_CASE(purged_tombstone_consumer_sstable_test) { env.make_reader_permit(), query::full_partition_range, s->full_slice(), - service::get_local_compaction_priority(), nullptr, ::streamed_mutation::forwarding::no, ::mutation_reader::forwarding::no); @@ -3362,7 +3356,7 @@ SEASTAR_TEST_CASE(incremental_compaction_data_resurrection_test) { try { // The goal is to have one sstable generated for each mutation to trigger the issue. auto max_sstable_size = 0; - auto result = compact_sstables(sstables::compaction_descriptor(sstables, default_priority_class(), 0, max_sstable_size), cf, sst_gen, replacer).get0().new_sstables; + auto result = compact_sstables(sstables::compaction_descriptor(sstables, 0, max_sstable_size), cf, sst_gen, replacer).get0().new_sstables; BOOST_REQUIRE_EQUAL(2, result.size()); } catch (...) { // swallow exception @@ -3422,11 +3416,11 @@ SEASTAR_TEST_CASE(twcs_major_compaction_test) { auto original_together = make_sstable_containing(sst_gen, {mut3, mut4}); - auto ret = compact_sstables(sstables::compaction_descriptor({original_together}, default_priority_class()), cf, sst_gen, replacer_fn_no_op()).get0(); + auto ret = compact_sstables(sstables::compaction_descriptor({original_together}), cf, sst_gen, replacer_fn_no_op()).get0(); BOOST_REQUIRE(ret.new_sstables.size() == 1); auto original_apart = make_sstable_containing(sst_gen, {mut1, mut2}); - ret = compact_sstables(sstables::compaction_descriptor({original_apart}, default_priority_class()), cf, sst_gen, replacer_fn_no_op()).get0(); + ret = compact_sstables(sstables::compaction_descriptor({original_apart}), cf, sst_gen, replacer_fn_no_op()).get0(); BOOST_REQUIRE(ret.new_sstables.size() == 2); }); } @@ -3551,8 +3545,7 @@ SEASTAR_TEST_CASE(test_bug_6472) { // Make sure everything we wanted expired is expired by now. forward_jump_clocks(std::chrono::hours(101)); - auto ret = compact_sstables(sstables::compaction_descriptor(sstables_spanning_many_windows, - default_priority_class()), cf, sst_gen, replacer_fn_no_op()).get0(); + auto ret = compact_sstables(sstables::compaction_descriptor(sstables_spanning_many_windows), cf, sst_gen, replacer_fn_no_op()).get0(); BOOST_REQUIRE(ret.new_sstables.size() == 1); }); } @@ -3646,8 +3639,7 @@ SEASTAR_TEST_CASE(test_twcs_partition_estimate) { make_sstable(3), }; - auto ret = compact_sstables(sstables::compaction_descriptor(sstables_spanning_many_windows, - default_priority_class()), cf, sst_gen, replacer_fn_no_op()).get0(); + auto ret = compact_sstables(sstables::compaction_descriptor(sstables_spanning_many_windows), cf, sst_gen, replacer_fn_no_op()).get0(); // The real test here is that we don't assert() in // sstables::prepare_summary() with the compact_sstables() call above, // this is only here as a sanity check. @@ -3673,8 +3665,8 @@ SEASTAR_TEST_CASE(stcs_reshape_test) { auto cs = sstables::make_compaction_strategy(sstables::compaction_strategy_type::size_tiered, s->compaction_strategy_options()); - BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, default_priority_class(), reshape_mode::strict).sstables.size()); - BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, default_priority_class(), reshape_mode::relaxed).sstables.size()); + BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, reshape_mode::strict).sstables.size()); + BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, reshape_mode::relaxed).sstables.size()); }); } @@ -3696,7 +3688,7 @@ SEASTAR_TEST_CASE(lcs_reshape_test) { sstables.push_back(std::move(sst)); } - BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, default_priority_class(), reshape_mode::strict).sstables.size() == 256); + BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, reshape_mode::strict).sstables.size() == 256); } // all overlapping { @@ -3708,7 +3700,7 @@ SEASTAR_TEST_CASE(lcs_reshape_test) { sstables.push_back(std::move(sst)); } - BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, default_priority_class(), reshape_mode::strict).sstables.size() == uint64_t(s->max_compaction_threshold())); + BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, reshape_mode::strict).sstables.size() == uint64_t(s->max_compaction_threshold())); } // single sstable { @@ -3716,7 +3708,7 @@ SEASTAR_TEST_CASE(lcs_reshape_test) { auto key = keys[0].key(); sstables::test(sst).set_values_for_leveled_strategy(1 /* size */, 0 /* level */, 0 /* max ts */, key, key); - BOOST_REQUIRE(cs.get_reshaping_job({ sst }, s, default_priority_class(), reshape_mode::strict).sstables.size() == 0); + BOOST_REQUIRE(cs.get_reshaping_job({ sst }, s, reshape_mode::strict).sstables.size() == 0); } }); } @@ -3826,8 +3818,7 @@ SEASTAR_TEST_CASE(test_twcs_compaction_across_buckets) { }(); sstables_spanning_many_windows.push_back(make_sstable_containing(sst_gen, {deletion_mut})); - auto ret = compact_sstables(sstables::compaction_descriptor(std::move(sstables_spanning_many_windows), - default_priority_class()), cf, sst_gen, replacer_fn_no_op(), can_purge_tombstones::no).get0(); + auto ret = compact_sstables(sstables::compaction_descriptor(std::move(sstables_spanning_many_windows)), cf, sst_gen, replacer_fn_no_op(), can_purge_tombstones::no).get0(); BOOST_REQUIRE(ret.new_sstables.size() == 1); assert_that(sstable_reader(ret.new_sstables[0], s, env.make_reader_permit())) @@ -3935,7 +3926,7 @@ SEASTAR_TEST_CASE(twcs_reshape_with_disjoint_set_test) { sstables.push_back(std::move(sst)); } - BOOST_REQUIRE_EQUAL(cs.get_reshaping_job(sstables, s, default_priority_class(), reshape_mode::strict).sstables.size(), disjoint_sstable_count); + BOOST_REQUIRE_EQUAL(cs.get_reshaping_job(sstables, s, reshape_mode::strict).sstables.size(), disjoint_sstable_count); } { @@ -3948,7 +3939,7 @@ SEASTAR_TEST_CASE(twcs_reshape_with_disjoint_set_test) { sstables.push_back(std::move(sst)); } - auto reshaping_count = cs.get_reshaping_job(sstables, s, default_priority_class(), reshape_mode::strict).sstables.size(); + auto reshaping_count = cs.get_reshaping_job(sstables, s, reshape_mode::strict).sstables.size(); BOOST_REQUIRE_GE(reshaping_count, disjoint_sstable_count - min_threshold + 1); BOOST_REQUIRE_LE(reshaping_count, disjoint_sstable_count); } @@ -3966,7 +3957,7 @@ SEASTAR_TEST_CASE(twcs_reshape_with_disjoint_set_test) { sstables.push_back(std::move(sst)); } - BOOST_REQUIRE_EQUAL(cs.get_reshaping_job(sstables, s, default_priority_class(), reshape_mode::strict).sstables.size(), 0); + BOOST_REQUIRE_EQUAL(cs.get_reshaping_job(sstables, s, reshape_mode::strict).sstables.size(), 0); } { @@ -3979,7 +3970,7 @@ SEASTAR_TEST_CASE(twcs_reshape_with_disjoint_set_test) { sstables.push_back(std::move(sst)); } - BOOST_REQUIRE_EQUAL(cs.get_reshaping_job(sstables, s, default_priority_class(), reshape_mode::strict).sstables.size(), uint64_t(s->max_compaction_threshold())); + BOOST_REQUIRE_EQUAL(cs.get_reshaping_job(sstables, s, reshape_mode::strict).sstables.size(), uint64_t(s->max_compaction_threshold())); } { @@ -4014,7 +4005,7 @@ SEASTAR_TEST_CASE(twcs_reshape_with_disjoint_set_test) { } auto check_mode_correctness = [&] (reshape_mode mode) { - auto ret = cs.get_reshaping_job(sstables, s, default_priority_class(), mode); + auto ret = cs.get_reshaping_job(sstables, s, mode); BOOST_REQUIRE_EQUAL(ret.sstables.size(), uint64_t(s->max_compaction_threshold())); // fail if any file doesn't belong to set of small files bool has_big_sized_files = boost::algorithm::any_of(ret.sstables, [&] (const sstables::shared_sstable& sst) { @@ -4068,7 +4059,7 @@ SEASTAR_TEST_CASE(stcs_reshape_overlapping_test) { sstables.push_back(std::move(sst)); } - BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, default_priority_class(), reshape_mode::strict).sstables.size() == disjoint_sstable_count); + BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, reshape_mode::strict).sstables.size() == disjoint_sstable_count); } { @@ -4081,7 +4072,7 @@ SEASTAR_TEST_CASE(stcs_reshape_overlapping_test) { sstables.push_back(std::move(sst)); } - BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, default_priority_class(), reshape_mode::strict).sstables.size() == uint64_t(s->max_compaction_threshold())); + BOOST_REQUIRE(cs.get_reshaping_job(sstables, s, reshape_mode::strict).sstables.size() == uint64_t(s->max_compaction_threshold())); } }); } @@ -4129,7 +4120,7 @@ SEASTAR_TEST_CASE(test_twcs_single_key_reader_filtering) { }).build(); auto reader = set.create_single_key_sstable_reader( - &*cf, s, permit, eh, pr, slice, default_priority_class(), + &*cf, s, permit, eh, pr, slice, tracing::trace_state_ptr(), ::streamed_mutation::forwarding::no, ::mutation_reader::forwarding::no); auto close_reader = deferred_close(reader); @@ -4456,7 +4447,7 @@ SEASTAR_TEST_CASE(twcs_single_key_reader_through_compound_set_test) { utils::estimated_histogram eh; auto pr = dht::partition_range::make_singular(dkey); - auto reader = compound.create_single_key_sstable_reader(&*cf, s, permit, eh, pr, s->full_slice(), default_priority_class(), + auto reader = compound.create_single_key_sstable_reader(&*cf, s, permit, eh, pr, s->full_slice(), tracing::trace_state_ptr(), ::streamed_mutation::forwarding::no, ::mutation_reader::forwarding::no); auto close_reader = deferred_close(reader); @@ -4530,8 +4521,8 @@ SEASTAR_TEST_CASE(simple_backlog_controller_test) { auto task_manager = tasks::task_manager({}, as); compaction_manager::config cfg = { - .compaction_sched_group = { default_scheduling_group(), default_priority_class() }, - .maintenance_sched_group = { default_scheduling_group(), default_priority_class() }, + .compaction_sched_group = { default_scheduling_group() }, + .maintenance_sched_group = { default_scheduling_group() }, .available_memory = available_memory, }; auto manager = compaction_manager(std::move(cfg), as, task_manager); @@ -4783,7 +4774,7 @@ SEASTAR_TEST_CASE(test_large_partition_splitting_on_compaction) { auto sst = make_sstable_containing(sst_gen, std::move(mutations)); - auto desc = sstables::compaction_descriptor({ sst }, default_priority_class()); + auto desc = sstables::compaction_descriptor({ sst }); // With max_sstable_bytes of 1, we'll perform the splitting of the partition as soon as possible. desc.max_sstable_bytes = 1; desc.can_split_large_partition = true; @@ -4946,7 +4937,7 @@ SEASTAR_TEST_CASE(tombstone_gc_disabled_test) { for (auto& sst : all) { column_family_test(t).add_sstable(sst).get(); } - return compact_sstables(sstables::compaction_descriptor(all, default_priority_class()), t, my_sst_gen).get0().new_sstables; + return compact_sstables(sstables::compaction_descriptor(all), t, my_sst_gen).get0().new_sstables; }; auto next_timestamp = [] { @@ -5027,7 +5018,7 @@ SEASTAR_TEST_CASE(compaction_optimization_to_avoid_bloom_filter_checks) { for (auto& sst : all) { column_family_test(t).add_sstable(sst).get(); } - auto desc = sstables::compaction_descriptor(std::move(c), default_priority_class()); + auto desc = sstables::compaction_descriptor(std::move(c)); desc.enable_garbage_collection(t->get_sstable_set()); return compact_sstables(std::move(desc), t, sst_gen).get0(); }; diff --git a/test/boost/sstable_conforms_to_mutation_source_test.cc b/test/boost/sstable_conforms_to_mutation_source_test.cc index d74a9d229f..6b6adcd6cf 100644 --- a/test/boost/sstable_conforms_to_mutation_source_test.cc +++ b/test/boost/sstable_conforms_to_mutation_source_test.cc @@ -260,12 +260,12 @@ SEASTAR_THREAD_TEST_CASE(test_sstable_reversing_reader_random_schema) { { auto r1 = source.make_reader_v2(query_schema, semaphore.make_permit(), prange, - slice, default_priority_class(), nullptr, + slice, nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); auto close_r1 = deferred_action([&r1] { r1.close().get(); }); auto r2 = rev_source.make_reader_v2(query_schema, semaphore.make_permit(), prange, - rev_slice, default_priority_class(), nullptr, + rev_slice, nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); close_r1.cancel(); @@ -273,12 +273,12 @@ SEASTAR_THREAD_TEST_CASE(test_sstable_reversing_reader_random_schema) { } auto r1 = source.make_reader_v2(query_schema, semaphore.make_permit(), prange, - query_schema->full_slice(), default_priority_class(), nullptr, + query_schema->full_slice(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::no); auto close_r1 = deferred_action([&r1] { r1.close().get(); }); auto r2 = rev_source.make_reader_v2(query_schema, semaphore.make_permit(), prange, - rev_full_slice, default_priority_class(), nullptr, + rev_full_slice, nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::no); close_r1.cancel(); diff --git a/test/boost/sstable_datafile_test.cc b/test/boost/sstable_datafile_test.cc index aace8ec011..9056c59fae 100644 --- a/test/boost/sstable_datafile_test.cc +++ b/test/boost/sstable_datafile_test.cc @@ -43,7 +43,6 @@ #include "test/lib/make_random_string.hh" #include "compatible_ring_position.hh" #include "mutation/mutation_compactor.hh" -#include "service/priority_manager.hh" #include "db/config.hh" #include "mutation_writer/partition_based_splitting_writer.hh" @@ -1827,7 +1826,6 @@ SEASTAR_TEST_CASE(test_skipping_using_index) { env.make_reader_permit(), query::full_partition_range, table.schema()->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::yes); diff --git a/test/boost/sstable_directory_test.cc b/test/boost/sstable_directory_test.cc index fe934e696c..f8bacd41be 100644 --- a/test/boost/sstable_directory_test.cc +++ b/test/boost/sstable_directory_test.cc @@ -33,7 +33,7 @@ public: return replica::distributed_loader::lock_table(dir, db, std::move(ks_name), std::move(cf_name)); } static future<> reshard(sharded& dir, sharded& db, sstring ks_name, sstring table_name, sstables::compaction_sstable_creator_fn creator) { - return replica::distributed_loader::reshard(dir, db, std::move(ks_name), std::move(table_name), std::move(creator), default_priority_class()); + return replica::distributed_loader::reshard(dir, db, std::move(ks_name), std::move(table_name), std::move(creator)); } }; @@ -159,8 +159,7 @@ static void with_sstable_directory( sstdir.start(seastar::sharded_parameter([&env_wrap] { return std::ref(env_wrap.get_manager()); }), seastar::sharded_parameter([] { return test_table_schema(); }), seastar::sharded_parameter([] { return make_lw_shared(); }), - path.native(), default_priority_class(), - default_io_error_handler_gen()).get(); + path.native(), default_io_error_handler_gen()).get(); func(sstdir); } diff --git a/test/boost/sstable_resharding_test.cc b/test/boost/sstable_resharding_test.cc index f9b9801943..06159559d6 100644 --- a/test/boost/sstable_resharding_test.cc +++ b/test/boost/sstable_resharding_test.cc @@ -96,7 +96,7 @@ void run_sstable_resharding_test(sstables::test_env& env) { uint64_t bloom_filter_size_before = filter_size(sst); - auto descriptor = sstables::compaction_descriptor({sst}, default_priority_class(), 0, std::numeric_limits::max()); + auto descriptor = sstables::compaction_descriptor({sst}, 0, std::numeric_limits::max()); descriptor.options = sstables::compaction_type_options::make_reshard(); descriptor.creator = [&env, &cf, version] (shard_id shard) mutable { // we need generation calculated by instance of cf at requested shard, diff --git a/test/boost/view_build_test.cc b/test/boost/view_build_test.cc index ce9fca5541..42c8a07220 100644 --- a/test/boost/view_build_test.cc +++ b/test/boost/view_build_test.cc @@ -25,7 +25,6 @@ #include "test/lib/cql_assertions.hh" #include "test/lib/sstable_utils.hh" #include "schema/schema_builder.hh" -#include "service/priority_manager.hh" #include "test/lib/test_services.hh" #include "test/lib/data_model.hh" #include "test/lib/log.hh" @@ -843,7 +842,6 @@ SEASTAR_THREAD_TEST_CASE(test_view_update_generator_buffering) { permit, query::full_partition_range, schema->full_slice(), - service::get_local_streaming_priority(), nullptr, ::mutation_reader::forwarding::no); auto& staging_reader = std::get<0>(p); diff --git a/test/boost/virtual_table_mutation_source_test.cc b/test/boost/virtual_table_mutation_source_test.cc index 7cd8cf9eee..cd0cb9769c 100644 --- a/test/boost/virtual_table_mutation_source_test.cc +++ b/test/boost/virtual_table_mutation_source_test.cc @@ -69,11 +69,10 @@ SEASTAR_THREAD_TEST_CASE(test_streaming_vt_as_mutation_source) { reader_permit permit, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding stream_fwd, mutation_reader::forwarding) { - return ms.make_reader_v2(s, permit, pr, slice, pc, trace_state, stream_fwd, mutation_reader::forwarding::no); + return ms.make_reader_v2(s, permit, pr, slice, trace_state, stream_fwd, mutation_reader::forwarding::no); }); }, false /* with_partition_range_forwarding */); } diff --git a/test/lib/cql_test_env.cc b/test/lib/cql_test_env.cc index 9a7db1d0cc..42ddcd0e98 100644 --- a/test/lib/cql_test_env.cc +++ b/test/lib/cql_test_env.cc @@ -732,8 +732,8 @@ public: // we need the getter since updateable_value is not shard-safe (#7316) auto get_cm_cfg = sharded_parameter([&] { return compaction_manager::config { - .compaction_sched_group = compaction_manager::scheduling_group{dbcfg.compaction_scheduling_group, service::get_local_compaction_priority()}, - .maintenance_sched_group = compaction_manager::scheduling_group{dbcfg.streaming_scheduling_group, service::get_local_streaming_priority()}, + .compaction_sched_group = compaction_manager::scheduling_group{dbcfg.compaction_scheduling_group}, + .maintenance_sched_group = compaction_manager::scheduling_group{dbcfg.streaming_scheduling_group}, .available_memory = dbcfg.available_memory, .static_shares = cfg->compaction_static_shares, .throughput_mb_per_sec = cfg->compaction_throughput_mb_per_sec, diff --git a/test/lib/memtable_snapshot_source.hh b/test/lib/memtable_snapshot_source.hh index 4cb59a24b8..dd59dfe2c9 100644 --- a/test/lib/memtable_snapshot_source.hh +++ b/test/lib/memtable_snapshot_source.hh @@ -61,7 +61,6 @@ private: permit, query::full_partition_range, new_mt->schema()->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::yes)); diff --git a/test/lib/mutation_source_test.cc b/test/lib/mutation_source_test.cc index 84b0fa899a..1d558671d3 100644 --- a/test/lib/mutation_source_test.cc +++ b/test/lib/mutation_source_test.cc @@ -171,7 +171,7 @@ static void test_slicing_and_fast_forwarding(tests::reader_concurrency_semaphore testlog.info("Read whole partitions at once"); auto pranges_walker = partition_range_walker(pranges); auto mr = ms.make_reader_v2(s.schema(), semaphore.make_permit(), pranges_walker.initial_range(), slice, - default_priority_class(), nullptr, streamed_mutation::forwarding::no, fwd_mr); + nullptr, streamed_mutation::forwarding::no, fwd_mr); auto actual = assert_that(std::move(mr)); for (auto& expected : mutations) { pranges_walker.fast_forward_if_needed(actual, expected); @@ -198,7 +198,7 @@ static void test_slicing_and_fast_forwarding(tests::reader_concurrency_semaphore testlog.info("Read partitions with fast-forwarding to each individual row"); pranges_walker = partition_range_walker(pranges); mr = ms.make_reader_v2(s.schema(), semaphore.make_permit(), pranges_walker.initial_range(), slice, - default_priority_class(), nullptr, streamed_mutation::forwarding::yes, fwd_mr); + nullptr, streamed_mutation::forwarding::yes, fwd_mr); actual = assert_that(std::move(mr)); for (auto& expected : mutations) { pranges_walker.fast_forward_if_needed(actual, expected); @@ -234,14 +234,14 @@ static void test_slicing_and_fast_forwarding(tests::reader_concurrency_semaphore testlog.info("Test monotonic positions"); auto mr = ms.make_reader_v2(s.schema(), semaphore.make_permit(), query::full_partition_range, slice, - default_priority_class(), nullptr, streamed_mutation::forwarding::no, fwd_mr); + nullptr, streamed_mutation::forwarding::no, fwd_mr); assert_that(std::move(mr)).has_monotonic_positions(); if (range_size != 1) { testlog.info("Read partitions fast-forwarded to the range of interest"); auto pranges_walker = partition_range_walker(pranges); mr = ms.make_reader_v2(s.schema(), semaphore.make_permit(), pranges_walker.initial_range(), slice, - default_priority_class(), nullptr, streamed_mutation::forwarding::yes, fwd_mr); + nullptr, streamed_mutation::forwarding::yes, fwd_mr); auto actual = assert_that(std::move(mr)); for (auto& expected : mutations) { pranges_walker.fast_forward_if_needed(actual, expected); @@ -281,7 +281,7 @@ static void test_slicing_and_fast_forwarding(tests::reader_concurrency_semaphore testlog.info("Read partitions with just static rows"); auto pranges_walker = partition_range_walker(pranges); mr = ms.make_reader_v2(s.schema(), semaphore.make_permit(), pranges_walker.initial_range(), slice, - default_priority_class(), nullptr, streamed_mutation::forwarding::no, fwd_mr); + nullptr, streamed_mutation::forwarding::no, fwd_mr); auto actual = assert_that(std::move(mr)); for (auto& expected : mutations) { pranges_walker.fast_forward_if_needed(actual, expected); @@ -308,7 +308,7 @@ static void test_slicing_and_fast_forwarding(tests::reader_concurrency_semaphore testlog.info("Test monotonic positions"); auto mr = ms.make_reader_v2(s.schema(), semaphore.make_permit(), query::full_partition_range, slice, - default_priority_class(), nullptr, streamed_mutation::forwarding::no, fwd_mr); + nullptr, streamed_mutation::forwarding::no, fwd_mr); assert_that(std::move(mr)).has_monotonic_positions(); } } @@ -383,7 +383,7 @@ static void test_streamed_mutation_forwarding_is_consistent_with_slicing(tests:: auto close_sliced_reader = deferred_close(sliced_reader); auto fwd_reader = - ms.make_reader_v2(m.schema(), semaphore.make_permit(), prange, full_slice, default_priority_class(), nullptr, streamed_mutation::forwarding::yes); + ms.make_reader_v2(m.schema(), semaphore.make_permit(), prange, full_slice, nullptr, streamed_mutation::forwarding::yes); std::vector position_ranges; for (auto& r: ranges) { position_ranges.emplace_back(r); @@ -429,7 +429,6 @@ static void test_streamed_mutation_forwarding_guarantees(tests::reader_concurren semaphore.make_permit(), query::full_partition_range, s->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::yes)); res.produces_partition_start(m.decorated_key()); @@ -565,7 +564,6 @@ static void test_fast_forwarding_across_partitions_to_empty_range(tests::reader_ semaphore.make_permit(), pr, s->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::yes)); @@ -755,7 +753,6 @@ static void test_streamed_mutation_forwarding_across_range_tombstones(tests::rea semaphore.make_permit(), query::full_partition_range, s->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::yes)); rd.produces_partition_start(m.decorated_key()); @@ -1091,7 +1088,7 @@ static void test_clustering_slices(tests::reader_concurrency_semaphore_wrapper& { auto slice = partition_slice_builder(*s) .build(); - auto rd = assert_that(ds.make_reader_v2(s, semaphore.make_permit(), pr, slice, default_priority_class(), nullptr, streamed_mutation::forwarding::yes)); + auto rd = assert_that(ds.make_reader_v2(s, semaphore.make_permit(), pr, slice, nullptr, streamed_mutation::forwarding::yes)); rd.produces_partition_start(pk) .fast_forward_to(position_range(position_in_partition::for_key(ck1), position_in_partition::after_key(*s, ck2))) .produces_row_with_key(ck1) @@ -1102,7 +1099,7 @@ static void test_clustering_slices(tests::reader_concurrency_semaphore_wrapper& { auto slice = partition_slice_builder(*s) .build(); - auto rd = assert_that(ds.make_reader_v2(s, semaphore.make_permit(), pr, slice, default_priority_class(), nullptr, streamed_mutation::forwarding::yes)); + auto rd = assert_that(ds.make_reader_v2(s, semaphore.make_permit(), pr, slice, nullptr, streamed_mutation::forwarding::yes)); rd.produces_partition_start(pk) .produces_end_of_stream() .fast_forward_to(position_range(position_in_partition::for_key(ck1), position_in_partition::after_key(*s, ck2))) @@ -1263,7 +1260,6 @@ void test_streamed_mutation_forwarding_succeeds_with_no_data(tests::reader_concu semaphore.make_permit(), query::full_partition_range, s.schema()->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::yes )) @@ -1334,8 +1330,7 @@ void test_slicing_with_overlapping_range_tombstones(tests::reader_concurrency_se // Check fast_forward_to() { - auto rd = ds.make_fragment_v1_stream(s, semaphore.make_permit(), query::full_partition_range, s->full_slice(), default_priority_class(), - nullptr, streamed_mutation::forwarding::yes); + auto rd = ds.make_fragment_v1_stream(s, semaphore.make_permit(), query::full_partition_range, s->full_slice(), nullptr, streamed_mutation::forwarding::yes); auto close_rd = deferred_close(rd); auto prange = position_range(range); @@ -1408,7 +1403,6 @@ void test_range_tombstones_v2(tests::reader_concurrency_semaphore_wrapper& semap assert_that(ms.make_reader_v2(s.schema(), semaphore.make_permit(), pr, s.schema()->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::no)) @@ -1432,7 +1426,6 @@ void test_range_tombstones_v2(tests::reader_concurrency_semaphore_wrapper& semap assert_that(ms.make_reader_v2(s.schema(), semaphore.make_permit(), pr, s.schema()->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::no)) @@ -1447,7 +1440,6 @@ void test_range_tombstones_v2(tests::reader_concurrency_semaphore_wrapper& semap assert_that(ms.make_reader_v2(s.schema(), semaphore.make_permit(), pr, s.schema()->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::no)) @@ -1470,7 +1462,6 @@ void test_range_tombstones_v2(tests::reader_concurrency_semaphore_wrapper& semap assert_that(ms.make_reader_v2(s.schema(), semaphore.make_permit(), pr, s.schema()->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::no)) @@ -1487,7 +1478,6 @@ void test_range_tombstones_v2(tests::reader_concurrency_semaphore_wrapper& semap assert_that(ms.make_reader_v2(s.schema(), semaphore.make_permit(), pr, s.schema()->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::no)) @@ -1503,7 +1493,6 @@ void test_range_tombstones_v2(tests::reader_concurrency_semaphore_wrapper& semap assert_that(ms.make_reader_v2(s.schema(), semaphore.make_permit(), pr, s.schema()->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::no)) @@ -1705,14 +1694,13 @@ void run_mutation_source_tests_reverse(populate_fn_ex populate, bool with_partit reader_permit permit, const dht::partition_range& pr, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr tr, streamed_mutation::forwarding fwd, mutation_reader::forwarding mr_fwd) mutable { reversed_slices.emplace_back(partition_slice_builder(*table_schema, query::native_reverse_slice_to_legacy_reverse_slice(*table_schema, slice)) .with_option() .build()); - return ms.make_reader_v2(query_schema, std::move(permit), pr, reversed_slices.back(), pc, tr, fwd, mr_fwd); + return ms.make_reader_v2(query_schema, std::move(permit), pr, reversed_slices.back(), tr, fwd, mr_fwd); }); }, false); // FIXME: pass with_partition_range_forwarding after all natively reversing sources have fast-forwarding support } diff --git a/test/lib/reader_lifecycle_policy.hh b/test/lib/reader_lifecycle_policy.hh index 774129f69d..fea3f48359 100644 --- a/test/lib/reader_lifecycle_policy.hh +++ b/test/lib/reader_lifecycle_policy.hh @@ -19,7 +19,6 @@ class test_reader_lifecycle_policy reader_permit, const dht::partition_range&, const query::partition_slice&, - const io_priority_class&, tracing::trace_state_ptr, mutation_reader::forwarding)>; @@ -50,7 +49,6 @@ public: reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, mutation_reader::forwarding fwd_mr) override { const auto shard = this_shard_id(); @@ -60,7 +58,7 @@ public: } else { _contexts[shard] = make_foreign(std::make_unique(range, slice)); } - return _factory_function(std::move(schema), std::move(permit), *_contexts[shard]->range, *_contexts[shard]->slice, pc, std::move(trace_state), fwd_mr); + return _factory_function(std::move(schema), std::move(permit), *_contexts[shard]->range, *_contexts[shard]->slice, std::move(trace_state), fwd_mr); } virtual const dht::partition_range* get_read_range() const override { const auto shard = this_shard_id(); diff --git a/test/lib/sstable_run_based_compaction_strategy_for_tests.cc b/test/lib/sstable_run_based_compaction_strategy_for_tests.cc index caedf3416d..7ad8ed658a 100644 --- a/test/lib/sstable_run_based_compaction_strategy_for_tests.cc +++ b/test/lib/sstable_run_based_compaction_strategy_for_tests.cc @@ -42,7 +42,7 @@ compaction_descriptor sstable_run_based_compaction_strategy_for_tests::get_sstab v.insert(v.end(), run.all().begin(), run.all().end()); return std::move(v); }); - return sstables::compaction_descriptor(std::move(all), default_priority_class(), 0, static_fragment_size_for_run); + return sstables::compaction_descriptor(std::move(all), 0, static_fragment_size_for_run); } return sstables::compaction_descriptor(); } diff --git a/test/lib/sstable_test_env.hh b/test/lib/sstable_test_env.hh index e780349075..b70cbd13e0 100644 --- a/test/lib/sstable_test_env.hh +++ b/test/lib/sstable_test_env.hh @@ -135,7 +135,7 @@ public: sstable::version_types version, sstable::format_types f = sstable::format_types::big) { auto sst = make_sstable(std::move(schema), dir, generation, version, f); sstable_open_config cfg { .load_first_and_last_position_metadata = true }; - return sst->load(default_priority_class(), cfg).then([sst = std::move(sst)] { + return sst->load(cfg).then([sst = std::move(sst)] { return make_ready_future(std::move(sst)); }); } diff --git a/test/lib/sstable_utils.hh b/test/lib/sstable_utils.hh index 7ddc431452..92229af86d 100644 --- a/test/lib/sstable_utils.hh +++ b/test/lib/sstable_utils.hh @@ -60,7 +60,7 @@ public: } future> data_read(reader_permit permit, uint64_t pos, size_t len) { - return _sst->data_read(pos, len, default_priority_class(), std::move(permit)); + return _sst->data_read(pos, len, std::move(permit)); } std::unique_ptr make_index_reader(reader_permit permit) { @@ -101,7 +101,7 @@ public: } future<> read_statistics() { - return _sst->read_statistics(default_priority_class()); + return _sst->read_statistics(); } statistics& get_statistics() { @@ -109,7 +109,7 @@ public: } future<> read_summary() noexcept { - return _sst->read_summary(default_priority_class()); + return _sst->read_summary(); } future read_summary_entry(size_t i) { @@ -161,11 +161,11 @@ public: _sst->_recognized_components.erase(component_type::Index); _sst->_recognized_components.erase(component_type::Data); return seastar::async([sst = _sst] { - sst->open_sstable(default_priority_class()); - sst->write_statistics(default_priority_class()); - sst->write_compression(default_priority_class()); - sst->write_filter(default_priority_class()); - sst->write_summary(default_priority_class()); + sst->open_sstable(); + sst->write_statistics(); + sst->write_compression(); + sst->write_filter(); + sst->write_summary(); sst->seal_sstable(false).get(); }); } @@ -199,7 +199,7 @@ public: void rewrite_toc_without_scylla_component() { _sst->_recognized_components.erase(component_type::Scylla); remove_file(_sst->filename(component_type::TOC)).get(); - _sst->_storage->open(*_sst, default_priority_class()); + _sst->_storage->open(*_sst); _sst->seal_sstable(false).get(); } diff --git a/test/manual/enormous_table_scan_test.cc b/test/manual/enormous_table_scan_test.cc index 9b61dbccc1..3c2bf87c7e 100644 --- a/test/manual/enormous_table_scan_test.cc +++ b/test/manual/enormous_table_scan_test.cc @@ -169,7 +169,6 @@ struct enormous_virtual_reader { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace_state, streamed_mutation::forwarding fwd, mutation_reader::forwarding fwd_mr) { diff --git a/test/perf/perf_fast_forward.cc b/test/perf/perf_fast_forward.cc index 9a5ec4ea5b..69b1408b38 100644 --- a/test/perf/perf_fast_forward.cc +++ b/test/perf/perf_fast_forward.cc @@ -799,7 +799,6 @@ static test_result scan_rows_with_stride(replica::column_family& cf, clustered_d semaphore.make_permit(), query::full_partition_range, cf.schema()->full_slice(), - default_priority_class(), nullptr, n_skip ? streamed_mutation::forwarding::yes : streamed_mutation::forwarding::no); auto close_rd = deferred_close(rd); @@ -870,7 +869,6 @@ static test_result slice_rows(replica::column_family& cf, clustered_ds& ds, int semaphore.make_permit(), query::full_partition_range, cf.schema()->full_slice(), - default_priority_class(), nullptr, streamed_mutation::forwarding::yes); auto close_rd = deferred_close(rd); @@ -930,7 +928,7 @@ static test_result test_slicing_using_restrictions(replica::column_family& cf, c })) .build(); auto pr = dht::partition_range::make_singular(make_pkey(*cf.schema(), 0)); - auto rd = cf.make_reader_v2(cf.schema(), semaphore.make_permit(), pr, slice, default_priority_class(), nullptr, + auto rd = cf.make_reader_v2(cf.schema(), semaphore.make_permit(), pr, slice, nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no); auto close_rd = deferred_close(rd); @@ -940,7 +938,7 @@ static test_result test_slicing_using_restrictions(replica::column_family& cf, c static test_result slice_rows_single_key(replica::column_family& cf, clustered_ds& ds, int offset = 0, int n_read = 1) { tests::reader_concurrency_semaphore_wrapper semaphore; auto pr = dht::partition_range::make_singular(make_pkey(*cf.schema(), 0)); - auto rd = cf.make_reader_v2(cf.schema(), semaphore.make_permit(), pr, cf.schema()->full_slice(), default_priority_class(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::no); + auto rd = cf.make_reader_v2(cf.schema(), semaphore.make_permit(), pr, cf.schema()->full_slice(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::no); auto close_rd = deferred_close(rd); metrics_snapshot before; @@ -1129,7 +1127,6 @@ static test_result test_forwarding_with_restriction(replica::column_family& cf, semaphore.make_permit(), pr, slice, - default_priority_class(), nullptr, streamed_mutation::forwarding::yes, mutation_reader::forwarding::no); auto close_rd = deferred_close(rd); diff --git a/test/perf/perf_row_cache_reads.cc b/test/perf/perf_row_cache_reads.cc index cb0b9e32d7..836bea6ef6 100644 --- a/test/perf/perf_row_cache_reads.cc +++ b/test/perf/perf_row_cache_reads.cc @@ -176,10 +176,9 @@ void test_scan_with_range_delete_over_rows() { reader_permit permit, const dht::partition_range& range, const query::partition_slice& slice, - const io_priority_class& pc, tracing::trace_state_ptr trace, streamed_mutation::forwarding fwd) { - return cache.make_reader(s, permit, range, slice, pc, std::move(trace), std::move(fwd)); + return cache.make_reader(s, permit, range, slice, std::move(trace), std::move(fwd)); }); std::cout << "Rows: " << ck_index << std::endl; @@ -191,7 +190,7 @@ void test_scan_with_range_delete_over_rows() { auto d = duration_in_seconds([&] { auto slice = partition_slice_builder(*s).build(); - auto q = query::querier(cache_ms, s, semaphore.make_permit(), pr, slice, default_priority_class(), nullptr); + auto q = query::querier(cache_ms, s, semaphore.make_permit(), pr, slice, nullptr); auto close_q = deferred_close(q); q.consume_page(noop_compacted_fragments_consumer(), std::numeric_limits::max(), diff --git a/test/perf/perf_sstable.hh b/test/perf/perf_sstable.hh index e14b7a45e8..b385e80110 100644 --- a/test/perf/perf_sstable.hh +++ b/test/perf/perf_sstable.hh @@ -232,7 +232,7 @@ public: auto start = perf_sstable_test_env::now(); - auto descriptor = sstables::compaction_descriptor(std::move(ssts), default_priority_class()); + auto descriptor = sstables::compaction_descriptor(std::move(ssts)); descriptor.enable_garbage_collection(cf->get_sstable_set()); descriptor.creator = [sst_gen = std::move(sst_gen)] (unsigned dummy) mutable { return sst_gen(); diff --git a/test/unit/row_cache_stress_test.cc b/test/unit/row_cache_stress_test.cc index 01f7b90c19..2cf9ac6ce3 100644 --- a/test/unit/row_cache_stress_test.cc +++ b/test/unit/row_cache_stress_test.cc @@ -153,12 +153,12 @@ struct table { std::vector rd; auto permit = make_permit(); if (prev_mt) { - rd.push_back(prev_mt->make_flat_reader(s.schema(), permit, r->pr, r->slice, default_priority_class(), nullptr, + rd.push_back(prev_mt->make_flat_reader(s.schema(), permit, r->pr, r->slice, nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no)); } - rd.push_back(mt->make_flat_reader(s.schema(), permit, r->pr, r->slice, default_priority_class(), nullptr, + rd.push_back(mt->make_flat_reader(s.schema(), permit, r->pr, r->slice, nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no)); - rd.push_back(cache.make_reader(s.schema(), permit, r->pr, r->slice, default_priority_class(), nullptr, + rd.push_back(cache.make_reader(s.schema(), permit, r->pr, r->slice, nullptr, streamed_mutation::forwarding::no, mutation_reader::forwarding::no)); r->rd = mutation_fragment_v1_stream(make_combined_reader(s.schema(), permit, std::move(rd), streamed_mutation::forwarding::no, mutation_reader::forwarding::no)); return r; diff --git a/tools/schema_loader.cc b/tools/schema_loader.cc index d6be873741..68780d3a07 100644 --- a/tools/schema_loader.cc +++ b/tools/schema_loader.cc @@ -353,7 +353,6 @@ mutation_opt read_schema_table_mutation(sharded& sst_ma sharded_parameter([&schema_factory] { return schema_factory(); }), sharded_parameter([] { return make_lw_shared(); }), schema_table_data_path, - sharded_parameter([] { return default_priority_class(); }), sharded_parameter([] { return default_io_error_handler_gen(); })).get(); auto stop_sst_dirs = deferred_stop(sst_dirs); diff --git a/tools/scylla-sstable.cc b/tools/scylla-sstable.cc index d4094f42ab..f1292fd9bc 100644 --- a/tools/scylla-sstable.cc +++ b/tools/scylla-sstable.cc @@ -249,7 +249,7 @@ const std::vector load_sstables(schema_ptr schema, sst data_dictionary::storage_options local; auto sst = sst_man.make_sstable(schema, local, dir_path.c_str(), ed.generation, ed.version, ed.format); - co_await sst->load(default_priority_class(), sstables::sstable_open_config{.load_first_and_last_position_metadata = false}); + co_await sst->load(sstables::sstable_open_config{.load_first_and_last_position_metadata = false}); sstables[i] = std::move(sst); }).get(); @@ -948,7 +948,7 @@ void validate_operation(schema_ptr schema, reader_permit permit, const std::vect abort_source abort; for (const auto& sst : sstables) { - const auto errors = sst->validate(permit, default_priority_class(), abort, [] (sstring what) { sst_log.info("{}", what); }).get(); + const auto errors = sst->validate(permit, abort, [] (sstring what) { sst_log.info("{}", what); }).get(); fmt::print("{}: {}\n", sst->get_filename(), errors == 0 ? "valid" : "invalid"); } } @@ -1530,7 +1530,7 @@ void decompress_operation(schema_ptr schema, reader_permit permit, const std::ve auto ostream = make_file_output_stream(std::move(ofile), options).get(); auto close_ostream = defer([&ostream] { ostream.close().get(); }); - auto istream = sst->data_stream(0, sst->data_size(), default_priority_class(), permit, nullptr, nullptr); + auto istream = sst->data_stream(0, sst->data_size(), permit, nullptr, nullptr); auto close_istream = defer([&istream] { istream.close().get(); }); istream.consume([&] (temporary_buffer buf) { diff --git a/tracing/traced_file.cc b/tracing/traced_file.cc index 63e07ab88b..2189798b33 100644 --- a/tracing/traced_file.cc +++ b/tracing/traced_file.cc @@ -23,10 +23,10 @@ private: public: traced_file_impl(file, tracing::trace_state_ptr, sstring); - virtual future write_dma(uint64_t pos, const void* buf, size_t len, const io_priority_class& pc) override; - virtual future write_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override; - virtual future read_dma(uint64_t pos, void* buf, size_t len, const io_priority_class& pc) override; - virtual future read_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override; + virtual future write_dma(uint64_t pos, const void* buf, size_t len, io_intent*) override; + virtual future write_dma(uint64_t pos, std::vector iov, io_intent*) override; + virtual future read_dma(uint64_t pos, void* buf, size_t len, io_intent*) override; + virtual future read_dma(uint64_t pos, std::vector iov, io_intent*) override; virtual future<> flush(void) override; virtual future stat(void) override; virtual future<> truncate(uint64_t length) override; @@ -36,7 +36,7 @@ public: virtual future<> close() override; virtual std::unique_ptr dup() override; virtual subscription list_directory(std::function (directory_entry de)> next) override; - virtual future> dma_read_bulk(uint64_t offset, size_t range_size, const io_priority_class& pc) override; + virtual future> dma_read_bulk(uint64_t offset, size_t range_size, io_intent*) override; }; traced_file_impl::traced_file_impl(file f, tracing::trace_state_ptr trace_state, sstring trace_prefix) @@ -44,9 +44,9 @@ traced_file_impl::traced_file_impl(file f, tracing::trace_state_ptr trace_state, } future -traced_file_impl::write_dma(uint64_t pos, const void* buf, size_t len, const io_priority_class& pc) { +traced_file_impl::write_dma(uint64_t pos, const void* buf, size_t len, io_intent* intent) { tracing::trace(_trace_state, "{} scheduling DMA write of {} bytes at position {}", _trace_prefix, len, pos); - return get_file_impl(_f)->write_dma(pos, buf, len, pc).then_wrapped([this, pos, len] (future f) { + return get_file_impl(_f)->write_dma(pos, buf, len, intent).then_wrapped([this, pos, len] (future f) { try { auto ret = f.get0(); tracing::trace(_trace_state, "{} finished DMA write of {} bytes at position {}, successfully wrote {} bytes", _trace_prefix, len, pos, ret); @@ -59,9 +59,9 @@ traced_file_impl::write_dma(uint64_t pos, const void* buf, size_t len, const io_ } future -traced_file_impl::write_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) { +traced_file_impl::write_dma(uint64_t pos, std::vector iov, io_intent* intent) { tracing::trace(_trace_state, "{} scheduling DMA write at position {}", _trace_prefix, pos); - return get_file_impl(_f)->write_dma(pos, std::move(iov), pc).then_wrapped([this, pos] (future f) { + return get_file_impl(_f)->write_dma(pos, std::move(iov), intent).then_wrapped([this, pos] (future f) { try { auto ret = f.get0(); tracing::trace(_trace_state, "{} finished DMA write at position {}, successfully wrote {} bytes", _trace_prefix, pos, ret); @@ -74,9 +74,9 @@ traced_file_impl::write_dma(uint64_t pos, std::vector iov, const io_prior } future -traced_file_impl::read_dma(uint64_t pos, void* buf, size_t len, const io_priority_class& pc) { +traced_file_impl::read_dma(uint64_t pos, void* buf, size_t len, io_intent* intent) { tracing::trace(_trace_state, "{} scheduling DMA read of {} bytes at position {}", _trace_prefix, len, pos); - return get_file_impl(_f)->read_dma(pos, buf, len, pc).then_wrapped([this, pos, len] (future f) { + return get_file_impl(_f)->read_dma(pos, buf, len, intent).then_wrapped([this, pos, len] (future f) { try { auto ret = f.get0(); tracing::trace(_trace_state, "{} finished DMA read of {} bytes at position {}, successfully read {} bytes", _trace_prefix, len, pos, ret); @@ -89,9 +89,9 @@ traced_file_impl::read_dma(uint64_t pos, void* buf, size_t len, const io_priorit } future -traced_file_impl::read_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) { +traced_file_impl::read_dma(uint64_t pos, std::vector iov, io_intent* intent) { tracing::trace(_trace_state, "{} scheduling DMA read at position {}", _trace_prefix, pos); - return get_file_impl(_f)->read_dma(pos, std::move(iov), pc).then_wrapped([this, pos] (future f) { + return get_file_impl(_f)->read_dma(pos, std::move(iov), intent).then_wrapped([this, pos] (future f) { try { auto ret = f.get0(); tracing::trace(_trace_state, "{} finished DMA read at position {}, successfully read {} bytes", _trace_prefix, pos, ret); @@ -214,9 +214,9 @@ traced_file_impl::list_directory(std::function (directory_entry de)> ne } future> -traced_file_impl::dma_read_bulk(uint64_t offset, size_t range_size, const io_priority_class& pc) { +traced_file_impl::dma_read_bulk(uint64_t offset, size_t range_size, io_intent* intent) { tracing::trace(_trace_state, "{} scheduling bulk DMA read of size {} at offset {}", _trace_prefix, range_size, offset); - return get_file_impl(_f)->dma_read_bulk(offset, range_size, pc).then_wrapped([this, offset, range_size] (future> f) { + return get_file_impl(_f)->dma_read_bulk(offset, range_size, intent).then_wrapped([this, offset, range_size] (future> f) { try { auto ret = f.get0(); tracing::trace(_trace_state, "{} finished bulk DMA read of size {} at offset {}, successfully read {} bytes", diff --git a/utils/cached_file.hh b/utils/cached_file.hh index 6348943fa6..70b78a34da 100644 --- a/utils/cached_file.hh +++ b/utils/cached_file.hh @@ -159,7 +159,6 @@ private: private: future get_page_ptr(page_idx_type idx, page_count_type read_ahead, - const io_priority_class& pc, tracing::trace_state_ptr trace_state) { auto i = _cache.lower_bound(idx); if (i != _cache.end() && i->idx == idx) { @@ -173,7 +172,7 @@ private: size_t size = (idx + read_ahead) > _last_page ? (_last_page_size + (_last_page - idx) * page_size) : read_ahead * page_size; - return _file.dma_read_exactly(idx * page_size, size, pc) + return _file.dma_read_exactly(idx * page_size, size) .then([this, idx] (temporary_buffer&& buf) mutable { cached_page::ptr_type first_page; while (buf.size()) { @@ -202,9 +201,8 @@ private: } future> get_page(page_idx_type idx, page_count_type count, - const io_priority_class& pc, tracing::trace_state_ptr trace_state) { - return get_page_ptr(idx, count, pc, std::move(trace_state)).then([] (cached_page::ptr_type cp) { + return get_page_ptr(idx, count, std::move(trace_state)).then([] (cached_page::ptr_type cp) { return cp->get_buf(); }); } @@ -238,7 +236,6 @@ public: // Single-user. class stream { cached_file* _cached_file; - const io_priority_class* _pc; std::optional _permit; page_idx_type _page_idx; offset_type _offset_in_page; @@ -254,13 +251,11 @@ public: // Creates an empty stream. stream() : _cached_file(nullptr) - , _pc(nullptr) { } - stream(cached_file& cf, const io_priority_class& pc, std::optional permit, tracing::trace_state_ptr trace_state, + stream(cached_file& cf, std::optional permit, tracing::trace_state_ptr trace_state, page_idx_type start_page, offset_type start_offset_in_page, offset_type size_hint) : _cached_file(&cf) - , _pc(&pc) , _permit(std::move(permit)) , _page_idx(start_page) , _offset_in_page(start_offset_in_page) @@ -279,7 +274,7 @@ public: auto units = get_page_units(_size_hint); page_count_type readahead = div_ceil(_size_hint, page_size); _size_hint = page_size; - return _cached_file->get_page(_page_idx, readahead, *_pc, _trace_state).then( + return _cached_file->get_page(_page_idx, readahead, _trace_state).then( [units = std::move(units), this] (temporary_buffer page) mutable { if (_page_idx == _cached_file->_last_page) { page.trim(_cached_file->_last_page_size); @@ -307,7 +302,7 @@ public: auto units = get_page_units(_size_hint); page_count_type readahead = div_ceil(_size_hint, page_size); _size_hint = page_size; - return _cached_file->get_page_ptr(_page_idx, readahead, *_pc, _trace_state).then( + return _cached_file->get_page_ptr(_page_idx, readahead, _trace_state).then( [this, units = std::move(units)] (cached_page::ptr_type page) mutable { size_t size = _page_idx == _cached_file->_last_page ? _cached_file->_last_page_size @@ -416,7 +411,7 @@ public: /// \param pos The offset of the first byte to read, relative to the cached file area. /// \param permit Holds reader_permit under which returned buffers should be accounted. /// When disengaged, no accounting is done. - stream read(offset_type global_pos, const io_priority_class& pc, std::optional permit, + stream read(offset_type global_pos, std::optional permit, tracing::trace_state_ptr trace_state = {}, size_t size_hint = page_size) { if (global_pos >= _size) { @@ -424,7 +419,7 @@ public: } auto offset = global_pos % page_size; auto page_idx = global_pos / page_size; - return stream(*this, pc, std::move(permit), std::move(trace_state), page_idx, offset, size_hint); + return stream(*this, std::move(permit), std::move(trace_state), page_idx, offset, size_hint); } /// \brief Returns the number of bytes in the area managed by this instance. @@ -491,8 +486,8 @@ public: { } // unsupported - virtual future write_dma(uint64_t pos, const void* buffer, size_t len, const io_priority_class& pc) override { unsupported(); } - virtual future write_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { unsupported(); } + virtual future write_dma(uint64_t pos, const void* buffer, size_t len, io_intent*) override { unsupported(); } + virtual future write_dma(uint64_t pos, std::vector iov, io_intent*) override { unsupported(); } virtual future<> flush(void) override { unsupported(); } virtual future<> truncate(uint64_t length) override { unsupported(); } virtual future<> discard(uint64_t offset, uint64_t length) override { unsupported(); } @@ -505,8 +500,8 @@ public: virtual future<> close() override { return _cf.get_file().close(); } virtual std::unique_ptr dup() override { return get_file_impl(_cf.get_file())->dup(); } - virtual future> dma_read_bulk(uint64_t offset, size_t size, const io_priority_class& pc) override { - return do_with(_cf.read(offset, pc, std::nullopt, _trace_state, size), size, temporary_buffer(), + virtual future> dma_read_bulk(uint64_t offset, size_t size, io_intent* intent) override { + return do_with(_cf.read(offset, std::nullopt, _trace_state, size), size, temporary_buffer(), [this, size] (cached_file::stream& s, size_t& size_left, temporary_buffer& result) { if (size_left == 0) { return make_ready_future>(std::move(result)); @@ -534,11 +529,11 @@ public: }); } - virtual future read_dma(uint64_t pos, void* buffer, size_t len, const io_priority_class& pc) override { + virtual future read_dma(uint64_t pos, void* buffer, size_t len, io_intent*) override { unsupported(); // FIXME } - virtual future read_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { + virtual future read_dma(uint64_t pos, std::vector iov, io_intent*) override { unsupported(); // FIXME } }; diff --git a/utils/s3/client.cc b/utils/s3/client.cc index fad4ef64fa..a248104a72 100644 --- a/utils/s3/client.cc +++ b/utils/s3/client.cc @@ -690,8 +690,8 @@ public: { } - virtual future write_dma(uint64_t pos, const void* buffer, size_t len, const io_priority_class& pc) override { unsupported(); } - virtual future write_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { unsupported(); } + virtual future write_dma(uint64_t pos, const void* buffer, size_t len, io_intent*) override { unsupported(); } + virtual future write_dma(uint64_t pos, std::vector iov, io_intent*) override { unsupported(); } virtual future<> truncate(uint64_t length) override { unsupported(); } virtual subscription list_directory(std::function (directory_entry de)> next) override { unsupported(); } @@ -740,13 +740,13 @@ public: co_return ret; } - virtual future read_dma(uint64_t pos, void* buffer, size_t len, const io_priority_class& pc) override { + virtual future read_dma(uint64_t pos, void* buffer, size_t len, io_intent*) override { auto buf = co_await _client->get_object_contiguous(_object_name, range{ pos, len }); std::copy_n(buf.get(), buf.size(), reinterpret_cast(buffer)); co_return buf.size(); } - virtual future read_dma(uint64_t pos, std::vector iov, const io_priority_class& pc) override { + virtual future read_dma(uint64_t pos, std::vector iov, io_intent*) override { auto buf = co_await _client->get_object_contiguous(_object_name, range{ pos, utils::iovec_len(iov) }); uint64_t off = 0; for (auto& v : iov) { @@ -760,7 +760,7 @@ public: co_return off; } - virtual future> dma_read_bulk(uint64_t offset, size_t range_size, const io_priority_class& pc) override { + virtual future> dma_read_bulk(uint64_t offset, size_t range_size, io_intent*) override { auto buf = co_await _client->get_object_contiguous(_object_name, range{ offset, range_size }); co_return temporary_buffer(reinterpret_cast(buf.get_write()), buf.size(), buf.release()); }