summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClay Gerrard <clay.gerrard@gmail.com>2022-05-03 09:57:45 -0500
committerClay Gerrard <clay.gerrard@gmail.com>2022-05-03 09:57:45 -0500
commit0b1cc8b0c4c7480549770596aacb439158ba8060 (patch)
treeead4b23491e662d12fdf06809093cbb5434a7623
parenta41286e1f8a6ca82862820d1a0740d67d5b008e5 (diff)
downloadswift-0b1cc8b0c4c7480549770596aacb439158ba8060.tar.gz
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
-rw-r--r--test/unit/proxy/controllers/test_obj.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/unit/proxy/controllers/test_obj.py b/test/unit/proxy/controllers/test_obj.py
index 01440906d..93c0ada20 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 = []