return false;
}
-void Objecter::_scan_requests(OSDSession *s,
- bool skipped_map,
- bool cluster_full,
- map<int64_t, bool> *pool_full_map,
- map<ceph_tid_t, Op*>& need_resend,
- list<LingerOp*>& need_resend_linger,
- map<ceph_tid_t, CommandOp*>& need_resend_command,
- shunique_lock& sul)
+void Objecter::_scan_requests(
+ OSDSession *s,
+ bool skipped_map,
+ bool cluster_full,
+ map<int64_t, bool> *pool_full_map,
+ map<ceph_tid_t, Op*>& need_resend,
+ list<LingerOp*>& need_resend_linger,
+ map<ceph_tid_t, CommandOp*>& need_resend_command,
+ shunique_lock& sul,
+ const mempool::osdmap::map<int64_t,OSDMap::snap_interval_set_t> *gap_removed_snaps)
{
assert(sul.owns_lock() && sul.mutex() == &rwlock);
++p; // check_op_pool_dne() may touch ops; prevent iterator invalidation
ldout(cct, 10) << " checking op " << op->tid << dendl;
_prune_snapc(osdmap->get_new_removed_snaps(), op);
+ if (skipped_map) {
+ _prune_snapc(*gap_removed_snaps, op);
+ }
bool force_resend_writes = cluster_full;
if (pool_full_map)
force_resend_writes = force_resend_writes ||
// check all outstanding requests on every epoch
for (auto& i : need_resend) {
_prune_snapc(osdmap->get_new_removed_snaps(), i.second);
+ if (skipped_map) {
+ _prune_snapc(m->gap_removed_snaps, i.second);
+ }
}
_scan_requests(homeless_session, skipped_map, cluster_full,
&pool_full_map, need_resend,
- need_resend_linger, need_resend_command, sul);
+ need_resend_linger, need_resend_command, sul,
+ &m->gap_removed_snaps);
for (map<int,OSDSession*>::iterator p = osd_sessions.begin();
p != osd_sessions.end(); ) {
OSDSession *s = p->second;
_scan_requests(s, skipped_map, cluster_full,
&pool_full_map, need_resend,
- need_resend_linger, need_resend_command, sul);
+ need_resend_linger, need_resend_command, sul,
+ &m->gap_removed_snaps);
++p;
// osd down or addr change?
if (!osdmap->is_up(s->osd) ||
p != osd_sessions.end(); ++p) {
OSDSession *s = p->second;
_scan_requests(s, false, false, NULL, need_resend,
- need_resend_linger, need_resend_command, sul);
+ need_resend_linger, need_resend_command, sul,
+ nullptr);
}
ldout(cct, 3) << "handle_osd_map decoding full epoch "
<< m->get_last() << dendl;
_scan_requests(homeless_session, false, false, NULL,
need_resend, need_resend_linger,
- need_resend_command, sul);
+ need_resend_command, sul, nullptr);
} else {
ldout(cct, 3) << "handle_osd_map hmm, i want a full map, requesting"
<< dendl;
void Objecter::_prune_snapc(
const mempool::osdmap::map<int64_t,
- mempool::osdmap::flat_set<snapid_t>>& new_removed_snaps,
+ OSDMap::snap_interval_set_t>& new_removed_snaps,
Op *op)
{
bool match = false;
auto i = new_removed_snaps.find(op->target.base_pgid.pool());
if (i != new_removed_snaps.end()) {
for (auto s : op->snapc.snaps) {
- if (i->second.count(s)) {
+ if (i->second.contains(s)) {
match = true;
break;
}
if (match) {
vector<snapid_t> new_snaps;
for (auto s : op->snapc.snaps) {
- if (std::find(i->second.begin(), i->second.end(), s) ==
- i->second.end()) {
+ if (!i->second.contains(s)) {
new_snaps.push_back(s);
}
}
void set_osdmap_full_try() { osdmap_full_try = true; }
void unset_osdmap_full_try() { osdmap_full_try = false; }
- void _scan_requests(OSDSession *s,
- bool skipped_map,
- bool cluster_full,
- map<int64_t, bool> *pool_full_map,
- map<ceph_tid_t, Op*>& need_resend,
- list<LingerOp*>& need_resend_linger,
- map<ceph_tid_t, CommandOp*>& need_resend_command,
- shunique_lock& sul);
+ void _scan_requests(
+ OSDSession *s,
+ bool skipped_map,
+ bool cluster_full,
+ map<int64_t, bool> *pool_full_map,
+ map<ceph_tid_t, Op*>& need_resend,
+ list<LingerOp*>& need_resend_linger,
+ map<ceph_tid_t, CommandOp*>& need_resend_command,
+ shunique_lock& sul,
+ const mempool::osdmap::map<int64_t,OSDMap::snap_interval_set_t> *gap_removed_snaps);
int64_t get_object_hash_position(int64_t pool, const string& key,
const string& ns);