From 0b1cc8b0c4c7480549770596aacb439158ba8060 Mon Sep 17 00:00:00 2001 From: Clay Gerrard Date: Tue, 3 May 2022 09:57:45 -0500 Subject: [PATCH] More tests for rebalance_missing_suppression_count This option already has everything ops needs to control client/server error responses during rebalance; we should document it's expected use more effectively. Change-Id: Ifce78b1a196745d1d771e7a85591e4d9effcf81c --- test/unit/proxy/controllers/test_obj.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/unit/proxy/controllers/test_obj.py b/test/unit/proxy/controllers/test_obj.py index 01440906df..93c0ada20c 100644 --- a/test/unit/proxy/controllers/test_obj.py +++ b/test/unit/proxy/controllers/test_obj.py @@ -1627,6 +1627,31 @@ class TestReplicatedObjController(CommonObjectControllerMixin, policy_opts.rebalance_missing_suppression_count = 2 do_test([Timeout(), 404, 404], 503) + # overloaded primary after double rebalance + # ... opts should increase rebalance_missing_suppression_count + policy_opts.rebalance_missing_suppression_count = 2 + do_test([Timeout(), 404, 404], 503) + + # two primaries out, but no rebalance + # ... default is fine for tombstones + policy_opts.rebalance_missing_suppression_count = 1 + do_test([Timeout(), Exception('kaboom!'), 404], 404, + include_timestamp=True) + # ... but maybe not ideal for missing names + # (N.B. 503 isn't really a BAD response here) + do_test([Timeout(), Exception('kaboom!'), 404], 503) + # still ... ops might think they should tune it down + policy_opts.rebalance_missing_suppression_count = 0 + do_test([Timeout(), Exception('kaboom!'), 404], 404) + # and we could maybe leave it like this for the next rebalance + do_test([Timeout(), 404, 404], 404) + # ... but it gets bad when faced with timeouts, b/c we can't trust a + # single primary 404 response during rebalance + do_test([Timeout(), Timeout(), 404], 404) + # ops needs to fix configs to get the 503 + policy_opts.rebalance_missing_suppression_count = 1 + do_test([Timeout(), Timeout(), 404], 503) + def test_GET_primaries_mixed_explode_and_timeout(self): req = swift.common.swob.Request.blank('/v1/a/c/o') primaries = []