}
}
// go
- pending_inc.get_new_pool(pool_id, p)->cache_mode = mode;
+ pg_pool_t *np = pending_inc.get_new_pool(pool_id, p);
+ np->cache_mode = mode;
+ // set this both when moving to and from cache_mode NONE. this is to
+ // capture legacy pools that were set up before this flag existed.
+ np->flags |= pg_pool_t::FLAG_INCOMPLETE_CLONES;
ss << "set cache-mode for pool '" << poolstr
<< "' to " << pg_pool_t::get_cache_mode_name(mode);
wait_for_finished_proposal(new Monitor::C_Command(mon, m, 0, ss.str(),
}
enum {
- FLAG_HASHPSPOOL = 1, // hash pg seed and pool together (instead of adding)
- FLAG_FULL = 2, // pool is full
+ FLAG_HASHPSPOOL = 1<<0, // hash pg seed and pool together (instead of adding)
+ FLAG_FULL = 1<<1, // pool is full
FLAG_DEBUG_FAKE_EC_POOL = 1<<2, // require ReplicatedPG to act like an EC pg
+ FLAG_INCOMPLETE_CLONES = 1<<3, // may have incomplete clones (bc we are/were an overlay)
};
static const char *get_flag_name(int f) {
case FLAG_HASHPSPOOL: return "hashpspool";
case FLAG_FULL: return "full";
case FLAG_DEBUG_FAKE_EC_POOL: return "require_local_rollback";
+ case FLAG_INCOMPLETE_CLONES: return "incomplete_clones";
default: return "???";
}
}
bool has_write_tier() const { return write_tier >= 0; }
void clear_write_tier() { write_tier = -1; }
void clear_tier_tunables() {
+ if (cache_mode != CACHEMODE_NONE)
+ flags |= FLAG_INCOMPLETE_CLONES;
cache_mode = CACHEMODE_NONE;
target_max_bytes = 0;
void dump(Formatter *f) const;
uint64_t get_flags() const { return flags; }
+ bool has_flag(uint64_t f) const { return flags & f; }
/// This method will later return true for ec pools as well
bool ec_pool() const {
return ec_pool() || flags & FLAG_DEBUG_FAKE_EC_POOL;
}
+ /// true if incomplete clones may be present
+ bool allow_incomplete_clones() const {
+ return cache_mode != CACHEMODE_NONE || has_flag(FLAG_INCOMPLETE_CLONES);
+ }
+
unsigned get_type() const { return type; }
unsigned get_size() const { return size; }
unsigned get_min_size() const { return min_size; }