diff options
author | Josh Durgin <jdurgin@redhat.com> | 2017-02-14 09:04:12 +0100 |
---|---|---|
committer | Josh Durgin <jdurgin@redhat.com> | 2017-04-20 02:45:43 +0200 |
commit | 6fba80c1fac7f012303b27ef1e6fdb9d90c81a40 (patch) | |
tree | fab2339cc0dd5317bdd4dceadbf359805304fdda /src | |
parent | OSDMonitor: get stripe_width via stripe_unit in ec profile (diff) | |
download | ceph-6fba80c1fac7f012303b27ef1e6fdb9d90c81a40.tar.xz ceph-6fba80c1fac7f012303b27ef1e6fdb9d90c81a40.zip |
osd, OSDMonitor, qa: mark ec overwrites non-experimental
Keep the pool flag around so we can distinguish between a pool that
should maintain hashes for each chunk, and a missing one is a bug, vs
an overwrites pool where we rely on bluestore checksums for detecting
corruption.
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mon/FSCommands.cc | 2 | ||||
-rw-r--r-- | src/mon/MonCommands.h | 2 | ||||
-rw-r--r-- | src/mon/OSDMonitor.cc | 15 | ||||
-rw-r--r-- | src/osd/ECBackend.cc | 12 | ||||
-rw-r--r-- | src/osd/osd_types.h | 2 |
5 files changed, 14 insertions, 19 deletions
diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index cc2dfe04c0b..630736c3989 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -849,7 +849,7 @@ int FileSystemCommandHandler::_check_pool( << " is an erasure-coded pool. Use of erasure-coded pools" << " for CephFS metadata is not permitted"; return -EINVAL; - } else if (pool->is_erasure() && !pool->is_hacky_ecoverwrites()) { + } else if (pool->is_erasure() && !pool->allows_ecoverwrites()) { // non-overwriteable EC pools are only acceptable with a cache tier overlay if (!pool->has_tiers() || !pool->has_read_tier() || !pool->has_write_tier()) { *ss << "pool '" << pool_name << "' (id '" << pool_id << "')" diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 3945e4b3480..9506814f7be 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -737,7 +737,7 @@ COMMAND("osd pool get " \ "get pool parameter <var>", "osd", "r", "cli,rest") COMMAND("osd pool set " \ "name=pool,type=CephPoolname " \ - "name=var,type=CephChoices,strings=size|min_size|crash_replay_interval|pg_num|pgp_num|crush_rule|crush_ruleset|hashpspool|nodelete|nopgchange|nosizechange|write_fadvise_dontneed|noscrub|nodeep-scrub|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|use_gmt_hitset|debug_fake_ec_pool|target_max_bytes|target_max_objects|cache_target_dirty_ratio|cache_target_dirty_high_ratio|cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|auid|min_read_recency_for_promote|min_write_recency_for_promote|fast_read|hit_set_grade_decay_rate|hit_set_search_last_n|scrub_min_interval|scrub_max_interval|deep_scrub_interval|recovery_priority|recovery_op_priority|scrub_priority|compression_mode|compression_algorithm|compression_required_ratio|compression_max_blob_size|compression_min_blob_size|csum_type|csum_min_block|csum_max_block|debug_white_box_testing_ec_overwrites " \ + "name=var,type=CephChoices,strings=size|min_size|crash_replay_interval|pg_num|pgp_num|crush_rule|crush_ruleset|hashpspool|nodelete|nopgchange|nosizechange|write_fadvise_dontneed|noscrub|nodeep-scrub|hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|use_gmt_hitset|debug_fake_ec_pool|target_max_bytes|target_max_objects|cache_target_dirty_ratio|cache_target_dirty_high_ratio|cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|auid|min_read_recency_for_promote|min_write_recency_for_promote|fast_read|hit_set_grade_decay_rate|hit_set_search_last_n|scrub_min_interval|scrub_max_interval|deep_scrub_interval|recovery_priority|recovery_op_priority|scrub_priority|compression_mode|compression_algorithm|compression_required_ratio|compression_max_blob_size|compression_min_blob_size|csum_type|csum_min_block|csum_max_block|allow_ec_overwrites " \ "name=val,type=CephString " \ "name=force,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ "set pool parameter <var> to <val>", "osd", "rw", "cli,rest") diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 07a99f23724..5cdbac9866c 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -5768,18 +5768,13 @@ int OSDMonitor::prepare_command_pool_set(map<string,cmd_vartype> &cmdmap, ss << "expecting value 'true' or '1'"; return -EINVAL; } - } else if (var == "debug_white_box_testing_ec_overwrites") { + } else if (var == "allow_ec_overwrites") { + if (!p.is_erasure()) { + ss << "ec overwrites can only be enabled for an erasure coded pool"; + return -EINVAL; + } if (val == "true" || (interr.empty() && n == 1)) { - if (cct->check_experimental_feature_enabled( - "debug_white_box_testing_ec_overwrites")) { p.flags |= pg_pool_t::FLAG_EC_OVERWRITES; - } else { - ss << "debug_white_box_testing_ec_overwrites is an experimental feature " - << "and must be enabled. Note, this feature does not yet actually " - << "work. This flag merely enables some of the preliminary support " - << "for testing purposes."; - return -ENOTSUP; - } } else if (val == "false" || (interr.empty() && n == 0)) { ss << "ec overwrites cannot be disabled once enabled"; return -EINVAL; diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index ea285cc4e6f..569bb89529e 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -954,7 +954,7 @@ void ECBackend::handle_sub_read( ++i) { int r = 0; ECUtil::HashInfoRef hinfo; - if (!get_parent()->get_pool().is_hacky_ecoverwrites()) { + if (!get_parent()->get_pool().allows_ecoverwrites()) { hinfo = get_hash_info(i->first); if (!hinfo) { r = -EIO; @@ -989,7 +989,7 @@ void ECBackend::handle_sub_read( ); } - if (!get_parent()->get_pool().is_hacky_ecoverwrites()) { + if (!get_parent()->get_pool().allows_ecoverwrites()) { // This shows that we still need deep scrub because large enough files // are read in sections, so the digest check here won't be done here. // Do NOT check osd_read_eio_on_bad_digest here. We need to report @@ -1732,7 +1732,7 @@ bool ECBackend::try_state_to_reads() Op *op = &(waiting_state.front()); if (op->requires_rmw() && pipeline_state.cache_invalid()) { - assert(get_parent()->get_pool().is_hacky_ecoverwrites()); + assert(get_parent()->get_pool().allows_ecoverwrites()); dout(20) << __func__ << ": blocking " << *op << " because it requires an rmw and the cache is invalid " << pipeline_state @@ -1786,7 +1786,7 @@ bool ECBackend::try_state_to_reads() dout(10) << __func__ << ": " << *op << dendl; if (!op->remote_read.empty()) { - assert(get_parent()->get_pool().is_hacky_ecoverwrites()); + assert(get_parent()->get_pool().allows_ecoverwrites()); objects_read_async_no_cache( op->remote_read, [this, op](map<hobject_t,pair<int, extent_map> > &&results) { @@ -1859,7 +1859,7 @@ bool ECBackend::try_reads_to_commit() dout(20) << __func__ << ": written: " << written << dendl; dout(20) << __func__ << ": op: " << *op << dendl; - if (!get_parent()->get_pool().is_hacky_ecoverwrites()) { + if (!get_parent()->get_pool().allows_ecoverwrites()) { for (auto &&i: op->log_entries) { if (i.requires_kraken()) { derr << __func__ << ": log entry " << i << " requires kraken" @@ -2365,7 +2365,7 @@ void ECBackend::be_deep_scrub( o.digest_present = false; return; } else { - if (!get_parent()->get_pool().is_hacky_ecoverwrites()) { + if (!get_parent()->get_pool().allows_ecoverwrites()) { assert(hinfo->has_chunk_hash()); if (hinfo->get_total_chunk_size() != pos) { dout(0) << "_scan_list " << poid << " got incorrect size on read" << dendl; diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 1c4e4c65a6c..550ea8dfca3 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -1448,7 +1448,7 @@ public: } uint64_t required_alignment() const { return stripe_width; } - bool is_hacky_ecoverwrites() const { + bool allows_ecoverwrites() const { return has_flag(FLAG_EC_OVERWRITES); } |