slo: Default allow_async_delete to true
We've had this option for a year now, and it seems to help. Let's enable it for everyone. Note that Swift clients still need to opt into the async delete via a query param, while S3 clients get it for free. Change-Id: Ib4164f877908b855ce354cc722d9cb0be8be9921
This commit is contained in:
parent
1b8708d9c5
commit
fa1058b6ed
@ -34,7 +34,6 @@ use = egg:swift#dlo
|
|||||||
|
|
||||||
[filter:slo]
|
[filter:slo]
|
||||||
use = egg:swift#slo
|
use = egg:swift#slo
|
||||||
allow_async_delete = True
|
|
||||||
|
|
||||||
[filter:container_sync]
|
[filter:container_sync]
|
||||||
use = egg:swift#container_sync
|
use = egg:swift#container_sync
|
||||||
|
@ -1090,7 +1090,7 @@ use = egg:swift#slo
|
|||||||
# `?multipart-manifest=delete&async=on`. You may want to keep this off if it
|
# `?multipart-manifest=delete&async=on`. You may want to keep this off if it
|
||||||
# negatively impacts your expirers; in that case, the deletes will still
|
# negatively impacts your expirers; in that case, the deletes will still
|
||||||
# be done as part of the client request.
|
# be done as part of the client request.
|
||||||
# allow_async_delete = false
|
# allow_async_delete = true
|
||||||
|
|
||||||
# Note: Put after auth and staticweb in the pipeline.
|
# Note: Put after auth and staticweb in the pipeline.
|
||||||
# If you don't put it in the pipeline, it will be inserted for you.
|
# If you don't put it in the pipeline, it will be inserted for you.
|
||||||
|
@ -1102,7 +1102,7 @@ class StaticLargeObject(object):
|
|||||||
max_manifest_segments=DEFAULT_MAX_MANIFEST_SEGMENTS,
|
max_manifest_segments=DEFAULT_MAX_MANIFEST_SEGMENTS,
|
||||||
max_manifest_size=DEFAULT_MAX_MANIFEST_SIZE,
|
max_manifest_size=DEFAULT_MAX_MANIFEST_SIZE,
|
||||||
yield_frequency=DEFAULT_YIELD_FREQUENCY,
|
yield_frequency=DEFAULT_YIELD_FREQUENCY,
|
||||||
allow_async_delete=False):
|
allow_async_delete=True):
|
||||||
self.conf = conf
|
self.conf = conf
|
||||||
self.app = app
|
self.app = app
|
||||||
self.logger = get_logger(conf, log_route='slo')
|
self.logger = get_logger(conf, log_route='slo')
|
||||||
@ -1719,7 +1719,7 @@ def filter_factory(global_conf, **local_conf):
|
|||||||
yield_frequency = int(conf.get('yield_frequency',
|
yield_frequency = int(conf.get('yield_frequency',
|
||||||
DEFAULT_YIELD_FREQUENCY))
|
DEFAULT_YIELD_FREQUENCY))
|
||||||
allow_async_delete = config_true_value(conf.get('allow_async_delete',
|
allow_async_delete = config_true_value(conf.get('allow_async_delete',
|
||||||
'false'))
|
'true'))
|
||||||
|
|
||||||
register_swift_info('slo',
|
register_swift_info('slo',
|
||||||
max_manifest_segments=max_manifest_segments,
|
max_manifest_segments=max_manifest_segments,
|
||||||
|
@ -4546,7 +4546,7 @@ class TestSwiftInfo(unittest.TestCase):
|
|||||||
self.assertEqual(swift_info['slo'].get('min_segment_size'), 1)
|
self.assertEqual(swift_info['slo'].get('min_segment_size'), 1)
|
||||||
self.assertEqual(swift_info['slo'].get('max_manifest_size'),
|
self.assertEqual(swift_info['slo'].get('max_manifest_size'),
|
||||||
mware.max_manifest_size)
|
mware.max_manifest_size)
|
||||||
self.assertIs(swift_info['slo'].get('allow_async_delete'), False)
|
self.assertIs(swift_info['slo'].get('allow_async_delete'), True)
|
||||||
self.assertEqual(1000, mware.max_manifest_segments)
|
self.assertEqual(1000, mware.max_manifest_segments)
|
||||||
self.assertEqual(8388608, mware.max_manifest_size)
|
self.assertEqual(8388608, mware.max_manifest_size)
|
||||||
self.assertEqual(1048576, mware.rate_limit_under_size)
|
self.assertEqual(1048576, mware.rate_limit_under_size)
|
||||||
@ -4555,21 +4555,21 @@ class TestSwiftInfo(unittest.TestCase):
|
|||||||
self.assertEqual(10, mware.yield_frequency)
|
self.assertEqual(10, mware.yield_frequency)
|
||||||
self.assertEqual(2, mware.concurrency)
|
self.assertEqual(2, mware.concurrency)
|
||||||
self.assertEqual(2, mware.bulk_deleter.delete_concurrency)
|
self.assertEqual(2, mware.bulk_deleter.delete_concurrency)
|
||||||
self.assertIs(False, mware.allow_async_delete)
|
self.assertIs(True, mware.allow_async_delete)
|
||||||
|
|
||||||
def test_registered_non_defaults(self):
|
def test_registered_non_defaults(self):
|
||||||
conf = dict(
|
conf = dict(
|
||||||
max_manifest_segments=500, max_manifest_size=1048576,
|
max_manifest_segments=500, max_manifest_size=1048576,
|
||||||
rate_limit_under_size=2097152, rate_limit_after_segment=20,
|
rate_limit_under_size=2097152, rate_limit_after_segment=20,
|
||||||
rate_limit_segments_per_sec=2, yield_frequency=5, concurrency=1,
|
rate_limit_segments_per_sec=2, yield_frequency=5, concurrency=1,
|
||||||
delete_concurrency=3, allow_async_delete='y')
|
delete_concurrency=3, allow_async_delete='n')
|
||||||
mware = slo.filter_factory(conf)('have to pass in an app')
|
mware = slo.filter_factory(conf)('have to pass in an app')
|
||||||
swift_info = utils.get_swift_info()
|
swift_info = utils.get_swift_info()
|
||||||
self.assertTrue('slo' in swift_info)
|
self.assertTrue('slo' in swift_info)
|
||||||
self.assertEqual(swift_info['slo'].get('max_manifest_segments'), 500)
|
self.assertEqual(swift_info['slo'].get('max_manifest_segments'), 500)
|
||||||
self.assertEqual(swift_info['slo'].get('min_segment_size'), 1)
|
self.assertEqual(swift_info['slo'].get('min_segment_size'), 1)
|
||||||
self.assertEqual(swift_info['slo'].get('max_manifest_size'), 1048576)
|
self.assertEqual(swift_info['slo'].get('max_manifest_size'), 1048576)
|
||||||
self.assertIs(swift_info['slo'].get('allow_async_delete'), True)
|
self.assertIs(swift_info['slo'].get('allow_async_delete'), False)
|
||||||
self.assertEqual(500, mware.max_manifest_segments)
|
self.assertEqual(500, mware.max_manifest_segments)
|
||||||
self.assertEqual(1048576, mware.max_manifest_size)
|
self.assertEqual(1048576, mware.max_manifest_size)
|
||||||
self.assertEqual(2097152, mware.rate_limit_under_size)
|
self.assertEqual(2097152, mware.rate_limit_under_size)
|
||||||
@ -4578,7 +4578,7 @@ class TestSwiftInfo(unittest.TestCase):
|
|||||||
self.assertEqual(5, mware.yield_frequency)
|
self.assertEqual(5, mware.yield_frequency)
|
||||||
self.assertEqual(1, mware.concurrency)
|
self.assertEqual(1, mware.concurrency)
|
||||||
self.assertEqual(3, mware.bulk_deleter.delete_concurrency)
|
self.assertEqual(3, mware.bulk_deleter.delete_concurrency)
|
||||||
self.assertIs(True, mware.allow_async_delete)
|
self.assertIs(False, mware.allow_async_delete)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user