History

ceph: check POOL_FLAG_FULL/NEARFULL in addition to OSDMAP_FULL/NEARFULL

CEPH_OSDMAP_FULL/NEARFULL aren't set since mimic, so we need to consult per-pool flags as well. Unfortunately the backwards compatibility here is lacking: - the change that deprecated OSDMAP_FULL/NEARFULL went into mimic, but was guarded by require_osd_release >= RELEASE_LUMINOUS - it was subsequently backported to luminous in v12.2.2, but that makes no difference to clients that only check OSDMAP_FULL/NEARFULL because require_osd_release is not client-facing -- it is for OSDs Since all kernels are affected, the best we can do here is just start checking both map flags and pool flags and send that to stable. These checks are best effort, so take osdc->lock and look up pool flags just once. Remove the FIXME, since filesystem quotas are checked above and RADOS quotas are reflected in POOL_FLAG_FULL: when the pool reaches its quota, both POOL_FLAG_FULL and POOL_FLAG_FULL_QUOTA are set.

Ilya Dryomov committed 6 years ago

Commit 76142091 parent 16fbf794 files · +28 −5Browse files

Showing the changes to include (2 of 4 files). Show all

Unified · Split

2 files
  1. include/linux/ceph/osdmap.h +4 −0
  2. include/linux/ceph/rados.h +4 −2
include/linux/ceph/osdmap.h+4−0
@@ -37,6 +37,9 @@ int ceph_spg_compare(const struct ceph_spg *lhs, const struct ceph_spg *rhs); · 36 unmodified lines
37#define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id37#define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id
38 together */38 together */
39#define CEPH_POOL_FLAG_FULL (1ULL << 1) /* pool is full */39#define CEPH_POOL_FLAG_FULL (1ULL << 1) /* pool is full */
40#define CEPH_POOL_FLAG_FULL_QUOTA (1ULL << 10) /* pool ran out of quota,
41 will set FULL too */
42#define CEPH_POOL_FLAG_NEARFULL (1ULL << 11) /* pool is nearfull */
40 43
41struct ceph_pg_pool_info {44struct ceph_pg_pool_info {
42 struct rb_node node;45 struct rb_node node;
@@ -304,5 +307,6 @@ extern struct ceph_pg_pool_info *ceph_pg_pool_by_id(struct ceph_osdmap *map, · 261 unmodified lines
304 307
305extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id);308extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id);
306extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name);309extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name);
310u64 ceph_pg_pool_flags(struct ceph_osdmap *map, u64 id);
307 311
308#endif312#endif
include/linux/ceph/rados.h+4−2
@@ -143,8 +143,10 @@ extern const char *ceph_osd_state_name(int s); · 142 unmodified lines
143/*143/*
144 * osd map flag bits144 * osd map flag bits
145 */145 */
146#define CEPH_OSDMAP_NEARFULL (1<<0) /* sync writes (near ENOSPC) */146#define CEPH_OSDMAP_NEARFULL (1<<0) /* sync writes (near ENOSPC),
147#define CEPH_OSDMAP_FULL (1<<1) /* no data writes (ENOSPC) */147 not set since ~luminous */
148#define CEPH_OSDMAP_FULL (1<<1) /* no data writes (ENOSPC),
149 not set since ~luminous */
148#define CEPH_OSDMAP_PAUSERD (1<<2) /* pause all reads */150#define CEPH_OSDMAP_PAUSERD (1<<2) /* pause all reads */
149#define CEPH_OSDMAP_PAUSEWR (1<<3) /* pause all writes */151#define CEPH_OSDMAP_PAUSEWR (1<<3) /* pause all writes */
150#define CEPH_OSDMAP_PAUSEREC (1<<4) /* pause recovery */152#define CEPH_OSDMAP_PAUSEREC (1<<4) /* pause recovery */