From 77614a0e99abbfa7942d842999198338409b39b1 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Thu, 21 Dec 2017 13:32:08 -0500 Subject: [PATCH] scan: insert toxic matched extents into hash table as they are discovered When a toxic extent is discovered, insert the offending hash/address/toxic entry into the hash table. When a previously discovered toxic extent is encountered, do nothing, i.e. allow the offending hash/address/toxic entry in the hash table to expire. Previously both inserts were removed from the code, but the former one is required. The latter prevents bees from forgiving toxic extents (or any hash matching one) should they be relocated, deleted, or simply become non-toxic. Signed-off-by: Zygo Blaxell --- src/bees-context.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bees-context.cc b/src/bees-context.cc index e18711f..9823011 100644 --- a/src/bees-context.cc +++ b/src/bees-context.cc @@ -431,6 +431,7 @@ BeesContext::scan_one_extent(const BeesFileRange &bfr, const Extent &e) if (found_addr.is_toxic()) { BEESINFO("WORKAROUND: abandoned toxic match for hash " << hash << " addr " << found_addr); // Don't push these back in because we'll never delete them. + // Extents may become non-toxic so give them a chance to expire. // hash_table->push_front_hash_addr(hash, found_addr); BEESCOUNT(scan_toxic_hash); return bfr; @@ -447,12 +448,10 @@ BeesContext::scan_one_extent(const BeesFileRange &bfr, const Extent &e) if (resolved.is_toxic()) { BEESINFO("WORKAROUND: abandoned toxic match at found_addr " << found_addr << " matching bbd " << bbd); BEESCOUNT(scan_toxic_match); -#if 0 - // Don't push these back in because we'll never delete them. - // Make sure we never see this hash again + // Make sure we never see this hash again. + // It has become toxic since it was inserted into the hash table. found_addr.set_toxic(); hash_table->push_front_hash_addr(hash, found_addr); -#endif abandon_extent = true; } else if (!resolved.count()) { BEESCOUNT(scan_resolve_zero);