mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
osd: Add check_osdmap_full() to check for shard OSD fullness
Signed-off-by: David Zafman <dzafman@redhat.com>
This commit is contained in:
parent
94e253ce37
commit
c7e8dcad34
@ -921,6 +921,16 @@ void OSDService::update_osd_stat(vector<int>& hb_peers)
|
||||
check_full_status(osd_stat);
|
||||
}
|
||||
|
||||
bool OSDService::check_osdmap_full(const set<pg_shard_t> &missing_on)
|
||||
{
|
||||
OSDMapRef osdmap = get_osdmap();
|
||||
for (auto shard : missing_on) {
|
||||
if (osdmap->get_state(shard.osd) & CEPH_OSD_FULL)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OSDService::send_message_osd_cluster(int peer, Message *m, epoch_t from_epoch)
|
||||
{
|
||||
OSDMapRef next_map = get_nextmap_reserved();
|
||||
|
@ -1181,6 +1181,7 @@ public:
|
||||
bool is_nearfull() const;
|
||||
bool need_fullness_update(); ///< osdmap state needs update
|
||||
void set_injectfull(s_names type, int64_t count);
|
||||
bool check_osdmap_full(const set<pg_shard_t> &missing_on);
|
||||
|
||||
|
||||
// -- epochs --
|
||||
|
@ -263,6 +263,8 @@ typedef ceph::shared_ptr<const OSDMap> OSDMapRef;
|
||||
|
||||
virtual bool check_failsafe_full(ostream &ss) = 0;
|
||||
|
||||
virtual bool check_osdmap_full(const set<pg_shard_t> &missing_on) = 0;
|
||||
|
||||
virtual ~Listener() {}
|
||||
};
|
||||
Listener *parent;
|
||||
|
@ -13031,6 +13031,11 @@ void PrimaryLogPG::_scrub_finish()
|
||||
}
|
||||
}
|
||||
|
||||
bool PrimaryLogPG::check_osdmap_full(const set<pg_shard_t> &missing_on)
|
||||
{
|
||||
return osd->check_osdmap_full(missing_on);
|
||||
}
|
||||
|
||||
/*---SnapTrimmer Logging---*/
|
||||
#undef dout_prefix
|
||||
#define dout_prefix *_dout << pg->gen_prefix()
|
||||
|
@ -1732,6 +1732,7 @@ public:
|
||||
void on_removal(ObjectStore::Transaction *t) override;
|
||||
void on_shutdown() override;
|
||||
bool check_failsafe_full(ostream &ss) override;
|
||||
bool check_osdmap_full(const set<pg_shard_t> &missing_on) override;
|
||||
|
||||
// attr cache handling
|
||||
void setattr_maybe_cache(
|
||||
|
Loading…
Reference in New Issue
Block a user