From 18419a87c50f798b1468e7265b30836f70eba1d1 Mon Sep 17 00:00:00 2001 From: Xav Paice Date: Mon, 3 Jul 2017 20:55:26 +1200 Subject: [PATCH] Add object-rsync-timeout option Adds the rsync_timeout option to to object-server.conf, so we can adjust it away from the default of 900s. If there are a number of large partitions needing replication, occasionally one needs to adjust the timeout in order to allow the rsync to complete rather than timeout and retry. Change-Id: I2d895741cb0528836a675deb6399005a5bf59ab5 Closes-bug: 1702039 --- config.yaml | 5 +++++ lib/swift_storage_context.py | 1 + templates/object-server.conf | 1 + unit_tests/test_swift_storage_context.py | 2 ++ 4 files changed, 9 insertions(+) diff --git a/config.yaml b/config.yaml index cea53d9..b114e4b 100644 --- a/config.yaml +++ b/config.yaml @@ -105,6 +105,11 @@ options: type: int description: | Number of replication workers to spawn. + object-rsync-timeout: + default: 900 + type: int + description: | + Max duration of a partition rsync. nagios-check-params: default: "-m -r 60 180 10 20" type: string diff --git a/lib/swift_storage_context.py b/lib/swift_storage_context.py index 71ab007..efa388e 100644 --- a/lib/swift_storage_context.py +++ b/lib/swift_storage_context.py @@ -92,5 +92,6 @@ class SwiftStorageServerContext(OSContextGenerator): 'object_max_connections': config('object-max-connections'), 'object_replicator_concurrency': config( 'object-replicator-concurrency'), + 'object_rsync_timeout': config('object-rsync-timeout'), } return ctxt diff --git a/templates/object-server.conf b/templates/object-server.conf index d49aeaa..1f1c5b6 100644 --- a/templates/object-server.conf +++ b/templates/object-server.conf @@ -16,6 +16,7 @@ threads_per_disk = {{ object_server_threads_per_disk }} [object-replicator] concurrency = {{ object_replicator_concurrency }} +rsync_timeout = {{ object_rsync_timeout }} [object-updater] diff --git a/unit_tests/test_swift_storage_context.py b/unit_tests/test_swift_storage_context.py index 004e669..e2bb0b2 100644 --- a/unit_tests/test_swift_storage_context.py +++ b/unit_tests/test_swift_storage_context.py @@ -90,6 +90,7 @@ class SwiftStorageContextTests(CharmTestCase): self.test_config.set('account-max-connections', '10') self.test_config.set('container-max-connections', '10') self.test_config.set('object-max-connections', '10') + self.test_config.set('object-rsync-timeout', '950') ctxt = swift_context.SwiftStorageServerContext() result = ctxt() ex = { @@ -102,5 +103,6 @@ class SwiftStorageContextTests(CharmTestCase): 'account_max_connections': '10', 'container_max_connections': '10', 'object_max_connections': '10', + 'object_rsync_timeout': '950', } self.assertEqual(ex, result)