From 988c35b374260961842bb8e7514a7f5fc7d7767c Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Mon, 16 Nov 2020 20:20:05 -0500 Subject: [PATCH] rgwlc: correctly dimension lc shard index vector The new parallel lc code relies on a vector of indexes to seed random-order shard processing. This vector was dimensioned to n (the shard count) - 1--which appears to elide the high index. Found and reported by Ji Weiqiang Fixes: https://tracker.ceph.com/issues/48255 Signed-off-by: Matt Benjamin --- src/rgw/rgw_lc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index c49e8c7e728..f6aa7504837 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -1658,7 +1658,7 @@ int RGWLC::list_lc_progress(string& marker, uint32_t max_entries, static inline vector random_sequence(uint32_t n) { - vector v(n-1, 0); + vector v(n, 0); std::generate(v.begin(), v.end(), [ix = 0]() mutable { return ix++;