1. 1 osdmap中相关pool定义如下
map<int64_t,pg_pool_t> pools; //pool的配置信息
map<int64_t,string> pool_name; //key为pool id,value为poolname
map<string,map<string,string> > erasure_code_profiles;
map<string,int64_t> name_pool; //通过名字查找id
1.2 PG..h对应的PG pool定义,存储了每个池的快照
struct PGPool {
int64_t id;
string name;
uint64_t auid;
pg_pool_t info;
SnapContext snapc; // the default pool snapc, ready to go.
interval_set<snapid_t> cached_removed_snaps; // current removed_snaps set
interval_set<snapid_t> newly_removed_snaps; // newly removed in the last epoch
PGPool(int64_t i, const string& _name, uint64_t au)
: id(i), name(_name), auid(au) { }
void update(OSDMapRef map);
};
3. pg_pool_t在Osd_types.h中定义
private:
__u32 pg_num, pgp_num; ///< number of pgs
public:
map<string,string> properties; ///< OBSOLETE
string erasure_code_profile; ///< name of the erasure code profile in OSDMap
epoch_t last_change; ///< most recent epoch changed, exclusing snapshot changes
epoch_t last_force_op_resend; ///< last epoch that forced clients to resend
snapid_t snap_seq; ///< seq for per-pool snapshot
epoch_t snap_epoch; ///< osdmap epoch of last snap
uint64_t auid; ///< who owns the pg
__u32 crash_replay_interval; ///< seconds to allow clients to replay ACKed but unCOMMITted requests
uint64_t quota_max_bytes; ///< maximum number of bytes for this pool
uint64_t quota_max_objects; ///< maximum number of objects for this pool
/*
* Pool snaps (global to this pool). These define a SnapContext for
* the pool, unless the client manually specifies an alternate
* context.
*/
map<snapid_t, pool_snap_info_t> snaps;
/*
* Alternatively, if we are definining non-pool snaps (e.g. via the
* Ceph MDS), we must track @removed_snaps (since @snaps is not
* used). Snaps and removed_snaps are to be used exclusive of each
* other!
*/
interval_set<snapid_t> removed_snaps;
unsigned pg_num_mask, pgp_num_mask;
set<uint64_t> tiers; ///< pools that are tiers of us
int64_t tier_of; ///< pool for which we are a tier
// Note that write wins for read+write ops
int64_t read_tier; ///< pool/tier for objecter to direct reads to
int64_t write_tier; ///< pool/tier for objecter to direct writes to
cache_mode_t cache_mode; ///< cache pool mode
uint64_t target_max_bytes; ///< tiering: target max pool size
uint64_t target_max_objects; ///< tiering: target max pool size
uint32_t cache_target_dirty_ratio_micro; ///< cache: fraction of target to leave dirty
uint32_t cache_target_full_ratio_micro; ///< cache: fraction of target to fill before we evict in earnest
uint32_t cache_min_flush_age; ///< minimum age (seconds) before we can flush
uint32_t cache_min_evict_age; ///< minimum age (seconds) before we can evict
HitSet::Params hit_set_params; ///< The HitSet params to use on this pool
uint32_t hit_set_period; ///< periodicity of HitSet segments (seconds)
uint32_t hit_set_count; ///< number of periods to retain
uint32_t min_read_recency_for_promote; ///< minimum number of HitSet to check before promote
uint32_t stripe_width; ///< erasure coded stripe size in bytes
uint64_t expected_num_objects; ///< expected number of objects on this pool, a value of 0 indicates
uint64_t flags; ///< FLAG_*
__u8 type; ///< TYPE_*
__u8 size, min_size; ///< number of osds in each pg
__u8 crush_ruleset; ///< crush placement rule set
__u8 object_hash; ///< hash mapping object name to ps
参考文档
ceph中文文档 http://docs.openfans.org/ceph/ceph4e2d658765876863/ceph-1/ceph-storage-cluster3010ceph5b5850a896c67fa43011/configuration3010914d7f6e3011/pool-pg-crush-settings30105b5850a86c603001914d7f6e7ec4548ccrush8bbe7f6e3011
ceph cache pool英文文档 http://ceph.com/docs/master/dev/cache-pool/