summaryrefslogtreecommitdiffstats
path: root/qa/tasks/backfill_toofull.py
diff options
context:
space:
mode:
authorMykola Golub <mgolub@suse.com>2021-10-13 17:22:09 +0200
committerMykola Golub <mgolub@suse.com>2021-10-16 14:28:53 +0200
commit429ac06cbb44b8a8263beb0d0780a01cedb517ba (patch)
treee4e082c88fd7f242e0ef9d5a2832800bab133412 /qa/tasks/backfill_toofull.py
parentMerge pull request #43571 from tchaikov/wip-bl-prepare-iovs (diff)
downloadceph-429ac06cbb44b8a8263beb0d0780a01cedb517ba.tar.xz
ceph-429ac06cbb44b8a8263beb0d0780a01cedb517ba.zip
qa/tasks/backfill_toofull: make test work when compression on
The osd backfill reservation does not take compression into account so we need to operate with "uncompressed" bytes when calculating nearfull ratio. Signed-off-by: Mykola Golub <mgolub@suse.com>
Diffstat (limited to 'qa/tasks/backfill_toofull.py')
-rw-r--r--qa/tasks/backfill_toofull.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/qa/tasks/backfill_toofull.py b/qa/tasks/backfill_toofull.py
index f2156bea601..1a866595d26 100644
--- a/qa/tasks/backfill_toofull.py
+++ b/qa/tasks/backfill_toofull.py
@@ -139,10 +139,22 @@ def task(ctx, config):
# data, so if the osd backfill reservation incorrectly calculates "toofull"
# the test will detect this (fail).
#
+ # Note, we need to operate with "uncompressed" bytes because currently
+ # osd backfill reservation does not take compression into account.
+ #
# We also need to update nearfull ratio to prevent "full ratio(s) out of order".
- backfillfull = min(used_kb + primary_used_kb, total_kb * 0.9) / total_kb
- nearfull_min = max(used_kb, primary_used_kb) / total_kb
+ pdf = manager.get_pool_df(pool)
+ log.debug("pool %s df: %s" % (pool, df))
+ assert pdf
+ compress_ratio = 1.0 * pdf['compress_under_bytes'] / pdf['compress_bytes_used'] \
+ if pdf['compress_bytes_used'] > 0 else 1.0
+ log.debug("compress_ratio: %s" % compress_ratio)
+
+ backfillfull = (used_kb + primary_used_kb) * compress_ratio / total_kb
+ assert backfillfull < 0.9
+ nearfull_min = max(used_kb, primary_used_kb) * compress_ratio / total_kb
+ assert nearfull_min < backfillfull
delta = backfillfull - nearfull_min
nearfull = nearfull_min + delta * 0.1
backfillfull = nearfull_min + delta * 0.2