return reply_op_error(pg, -ENOENT);
}
+ SnapContext snapc = get_snapc(pg,obc);
+
if (!pg->is_primary()) {
// primary can handle both normal ops and balanced reads
if (is_misdirected(*pg)) {
__func__, m->get_hobj());
}
}
- return pg->do_osd_ops(m, obc, op_info).safe_then_unpack_interruptible(
+ return pg->do_osd_ops(m, obc, op_info, snapc).safe_then_unpack_interruptible(
[this, pg, &ihref](auto submitted, auto all_completed) mutable {
return submitted.then_interruptible([this, pg, &ihref] {
return ihref.enter_stage<interruptor>(pp(*pg).wait_repop, *this);
put_historic_shard_services->get_registry().put_historic(*this);
}
+const SnapContext ClientRequest::get_snapc(
+ Ref<PG>& pg,
+ crimson::osd::ObjectContextRef obc) const
+{
+ SnapContext snapc;
+ if (op_info.may_write() || op_info.may_cache()) {
+ // snap
+ if (pg->get_pgpool().info.is_pool_snaps_mode()) {
+ // use pool's snapc
+ snapc = pg->get_pgpool().snapc;
+ logger().debug("{} using pool's snapc snaps={}",
+ __func__, snapc.snaps);
+
+ } else {
+ // client specified snapc
+ snapc.seq = m->get_snap_seq();
+ snapc.snaps = m->get_snaps();
+ logger().debug("{} client specified snapc seq={} snaps={}",
+ __func__, snapc.seq, snapc.snaps);
+ }
+ }
+ return snapc;
+}
+
}
PG::do_osd_ops(
Ref<MOSDOp> m,
ObjectContextRef obc,
- const OpInfo &op_info)
+ const OpInfo &op_info,
+ const SnapContext& snapc)
{
if (__builtin_expect(stopping, false)) {
throw crimson::common::system_shutdown_exception();
}
- SnapContext snapc;
- if (op_info.may_write() || op_info.may_cache()) {
- // snap
- if (get_pgpool().info.is_pool_snaps_mode()) {
- // use pool's snapc
- snapc = get_pgpool().snapc;
- logger().debug("{} using pool's snapc snaps={}",
- __func__, snapc.snaps);
-
- } else {
- // client specified snapc
- snapc.seq = m->get_snap_seq();
- snapc.snaps = m->get_snaps();
- logger().debug("{} client specified snapc seq={} snaps={}",
- __func__, snapc.seq, snapc.snaps);
- }
- }
return do_osd_ops_execute<MURef<MOSDOpReply>>(
seastar::make_lw_shared<OpsExecuter>(
Ref<PG>{this}, obc, op_info, *m, snapc),
do_osd_ops_iertr::future<pg_rep_op_fut_t<MURef<MOSDOpReply>>> do_osd_ops(
Ref<MOSDOp> m,
ObjectContextRef obc,
- const OpInfo &op_info);
+ const OpInfo &op_info,
+ const SnapContext& snapc);
using do_osd_ops_success_func_t =
std::function<do_osd_ops_iertr::future<>()>;
using do_osd_ops_failure_func_t =