Check whether the request hobj maps to the current pg_t. If we have the
osd_debug_misdirected_ops setting enabled (as teuthology does), assert out
as well so that the error is easy to spot. This catches bugs in the
Objecter (especially the new code that explicitly names the spg_t for the
request).
Signed-off-by: Sage Weil <sage@redhat.com>
hobject_t head = m->get_hobj();
head.snap = CEPH_NOSNAP;
+ if (!info.pgid.pgid.contains(
+ info.pgid.pgid.get_split_bits(pool.info.get_pg_num()), head)) {
+ derr << __func__ << " " << info.pgid.pgid << " does not contain "
+ << head << " pg_num " << pool.info.get_pg_num() << " hash "
+ << std::hex << head.get_hash() << std::dec << dendl;
+ osd->clog->warn() << info.pgid.pgid << " does not contain " << head
+ << " op " << *m << "\n";
+ assert(!cct->_conf->osd_debug_misdirected_ops);
+ return;
+ }
+
bool can_backoff =
m->get_connection()->has_feature(CEPH_FEATURE_RADOS_BACKOFF);
SessionRef session;
bool contains(int bits, const ghobject_t& oid) {
return oid.match(bits, ps());
}
+ bool contains(int bits, const hobject_t& oid) {
+ return oid.match(bits, ps());
+ }
hobject_t get_hobj_start() const;
hobject_t get_hobj_end(unsigned pg_num) const;