From: Matt Benjamin Date: Tue, 17 Nov 2020 01:20:05 +0000 (-0500) Subject: rgwlc: correctly dimension lc shard index vector X-Git-Tag: v15.2.9~49^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38824%2Fhead;p=ceph.git 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 (cherry picked from commit 988c35b374260961842bb8e7514a7f5fc7d7767c) --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 2d6357c83fbb..bb30bb00cc0f 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -1655,7 +1655,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++;