dout(20) << __func__ << ": invalidating cache after this op"
<< dendl;
pipeline_state.invalidate();
+ op->using_cache = false;
+ } else {
+ op->using_cache = pipeline_state.caching_enabled();
}
waiting_state.pop_front();
waiting_reads.push_back(*op);
- if (op->requires_rmw() || pipeline_state.caching_enabled()) {
+ if (op->using_cache) {
cache.open_write_pin(op->pin);
extent_set empty;
op->hoid,
op->delta_stats);
- if (pipeline_state.caching_enabled() || op->requires_rmw()) {
+ if (op->using_cache) {
for (auto &&hpair: op->pending_read) {
op->remote_read_result[hpair.first].insert(
cache.get_remaining_extents_for_rmw(
dout(20) << __func__ << ": written_set: " << written_set << dendl;
assert(written_set == op->plan.will_write);
- if (pipeline_state.caching_enabled() || op->requires_rmw()) {
+ if (op->using_cache) {
for (auto &&hpair: written) {
dout(20) << __func__ << ": " << hpair << dendl;
cache.present_rmw_update(hpair.first, op->pin, hpair.second);
}
}
- if (pipeline_state.caching_enabled() || op->requires_rmw()) {
+ if (op->using_cache) {
cache.release_write_pin(op->pin);
}
tid_to_op_map.erase(op->tid);
bool requires_rmw() const { return !plan.to_read.empty(); }
bool invalidates_cache() const { return plan.invalidates_cache; }
+ // must be true if requires_rmw(), must be false if invalidates_cache()
+ bool using_cache = false;
+
/// In progress read state;
hobject_t::bitwisemap<extent_set> pending_read; // subset already being read
hobject_t::bitwisemap<extent_set> remote_read; // subset we must read