1 Move recon's locks to /var/run/swift and caches to /var/lib/swift/recon-cache. |
1 Move recon's locks to /var/run/swift and caches to /var/lib/swift/recon-cache. |
2 Change some of the ways we gather information, since those are normally |
2 Change some of the ways we gather information, since those are normally |
3 Linux-specific. Make the tests acknowledge these changes. |
3 Linux-specific. Make the tests acknowledge these changes. |
4 |
4 |
5 diff --git a/bin/swift-recon-cron b/bin/swift-recon-cron |
5 --- swift-2.2.2/bin/swift-recon-cron.~1~ 2015-02-01 23:44:11.000000000 -0800 |
6 --- a/bin/swift-recon-cron |
6 +++ swift-2.2.2/bin/swift-recon-cron 2015-02-26 16:49:51.937806748 -0800 |
7 +++ b/bin/swift-recon-cron |
7 @@ -57,8 +57,8 @@ def main(): |
8 @@ -49,8 +49,8 @@ def main(): |
|
9 sys.exit(1) |
8 sys.exit(1) |
10 conf = dict(c.items('filter:recon')) |
9 conf = dict(c.items('filter:recon')) |
11 device_dir = conf.get('devices', '/srv/node') |
10 device_dir = conf.get('devices', '/srv/node') |
12 - recon_cache_path = conf.get('recon_cache_path', '/var/cache/swift') |
11 - recon_cache_path = conf.get('recon_cache_path', '/var/cache/swift') |
13 - recon_lock_path = conf.get('recon_lock_path', '/var/lock') |
12 - recon_lock_path = conf.get('recon_lock_path', '/var/lock') |
14 + recon_cache_path = conf.get('recon_cache_path', '/var/lib/swift/recon-cache') |
13 + recon_cache_path = conf.get('recon_cache_path', '/var/lib/swift/recon-cache') |
15 + recon_lock_path = conf.get('recon_lock_path', '/var/run/swift') |
14 + recon_lock_path = conf.get('recon_lock_path', '/var/run/swift') |
16 cache_file = os.path.join(recon_cache_path, "object.recon") |
15 cache_file = os.path.join(recon_cache_path, "object.recon") |
17 lock_dir = os.path.join(recon_lock_path, "swift-recon-object-cron") |
16 lock_dir = os.path.join(recon_lock_path, "swift-recon-object-cron") |
18 conf['log_name'] = conf.get('log_name', 'recon-cron') |
17 conf['log_name'] = conf.get('log_name', 'recon-cron') |
19 diff --git a/etc/account-server.conf-sample b/etc/account-server.conf-sample |
18 --- swift-2.2.2/etc/account-server.conf-sample.~1~ 2015-02-01 23:44:11.000000000 -0800 |
20 --- a/etc/account-server.conf-sample |
19 +++ swift-2.2.2/etc/account-server.conf-sample 2015-02-26 16:49:51.938107313 -0800 |
21 +++ b/etc/account-server.conf-sample |
20 @@ -81,7 +81,7 @@ use = egg:swift#healthcheck |
22 @@ -78,7 +78,7 @@ use = egg:swift#healthcheck |
|
23 |
21 |
24 [filter:recon] |
22 [filter:recon] |
25 use = egg:swift#recon |
23 use = egg:swift#recon |
26 -# recon_cache_path = /var/cache/swift |
24 -# recon_cache_path = /var/cache/swift |
27 +# recon_cache_path = /var/lib/swift/recon-cache |
25 +# recon_cache_path = /var/lib/swift/recon-cache |
28 |
26 |
29 [account-replicator] |
27 [account-replicator] |
30 # You can override the default log routing for this app here (don't use set!): |
28 # You can override the default log routing for this app here (don't use set!): |
31 @@ -109,7 +109,7 @@ use = egg:swift#recon |
29 @@ -114,7 +114,7 @@ use = egg:swift#recon |
32 # Time in seconds to wait between replication passes |
30 # of run_pause. |
33 # run_pause = 30 |
31 # run_pause = 30 |
34 # |
32 # |
35 -# recon_cache_path = /var/cache/swift |
33 -# recon_cache_path = /var/cache/swift |
36 +# recon_cache_path = /var/lib/swift/recon-cache |
34 +# recon_cache_path = /var/lib/swift/recon-cache |
37 |
35 |
38 [account-auditor] |
36 [account-auditor] |
39 # You can override the default log routing for this app here (don't use set!): |
37 # You can override the default log routing for this app here (don't use set!): |
40 @@ -124,7 +124,7 @@ use = egg:swift#recon |
38 @@ -129,7 +129,7 @@ use = egg:swift#recon |
41 # log_facility = LOG_LOCAL0 |
39 # log_facility = LOG_LOCAL0 |
42 # log_level = INFO |
40 # log_level = INFO |
43 # accounts_per_second = 200 |
41 # accounts_per_second = 200 |
44 -# recon_cache_path = /var/cache/swift |
42 -# recon_cache_path = /var/cache/swift |
45 +# recon_cache_path = /var/lib/swift/recon-cache |
43 +# recon_cache_path = /var/lib/swift/recon-cache |
46 |
44 |
47 [account-reaper] |
45 [account-reaper] |
48 # You can override the default log routing for this app here (don't use set!): |
46 # You can override the default log routing for this app here (don't use set!): |
49 diff --git a/etc/container-server.conf-sample b/etc/container-server.conf-sample |
47 --- swift-2.2.2/etc/container-server.conf-sample.~1~ 2015-02-01 23:44:11.000000000 -0800 |
50 --- a/etc/container-server.conf-sample |
48 +++ swift-2.2.2/etc/container-server.conf-sample 2015-02-26 16:49:51.938374963 -0800 |
51 +++ b/etc/container-server.conf-sample |
49 @@ -90,7 +90,7 @@ use = egg:swift#healthcheck |
52 @@ -85,7 +85,7 @@ use = egg:swift#healthcheck |
|
53 |
50 |
54 [filter:recon] |
51 [filter:recon] |
55 use = egg:swift#recon |
52 use = egg:swift#recon |
56 -#recon_cache_path = /var/cache/swift |
53 -#recon_cache_path = /var/cache/swift |
57 +#recon_cache_path = /var/lib/swift/recon-cache |
54 +#recon_cache_path = /var/lib/swift/recon-cache |
58 |
55 |
59 [container-replicator] |
56 [container-replicator] |
60 # You can override the default log routing for this app here (don't use set!): |
57 # You can override the default log routing for this app here (don't use set!): |
61 @@ -108,7 +108,7 @@ use = egg:swift#recon |
58 @@ -115,7 +115,7 @@ use = egg:swift#recon |
62 # Time in seconds to wait between replication passes |
59 # of run_pause. |
63 # run_pause = 30 |
60 # run_pause = 30 |
64 # |
61 # |
65 -# recon_cache_path = /var/cache/swift |
62 -# recon_cache_path = /var/cache/swift |
66 +# recon_cache_path = /var/lib/swift/recon-cache |
63 +# recon_cache_path = /var/lib/swift/recon-cache |
67 |
64 |
68 [container-updater] |
65 [container-updater] |
69 # You can override the default log routing for this app here (don't use set!): |
66 # You can override the default log routing for this app here (don't use set!): |
70 @@ -128,7 +128,7 @@ use = egg:swift#recon |
67 @@ -135,7 +135,7 @@ use = egg:swift#recon |
71 # Seconds to suppress updating an account that has generated an error |
68 # Seconds to suppress updating an account that has generated an error |
72 # account_suppression_time = 60 |
69 # account_suppression_time = 60 |
73 # |
70 # |
74 -# recon_cache_path = /var/cache/swift |
71 -# recon_cache_path = /var/cache/swift |
75 +# recon_cache_path = /var/lib/swift/recon-cache |
72 +# recon_cache_path = /var/lib/swift/recon-cache |
76 |
73 |
77 [container-auditor] |
74 [container-auditor] |
78 # You can override the default log routing for this app here (don't use set!): |
75 # You can override the default log routing for this app here (don't use set!): |
79 @@ -141,7 +141,7 @@ use = egg:swift#recon |
76 @@ -148,7 +148,7 @@ use = egg:swift#recon |
80 # interval = 1800 |
77 # interval = 1800 |
81 # |
78 # |
82 # containers_per_second = 200 |
79 # containers_per_second = 200 |
83 -# recon_cache_path = /var/cache/swift |
80 -# recon_cache_path = /var/cache/swift |
84 +# recon_cache_path = /var/lib/swift/recon-cache |
81 +# recon_cache_path = /var/lib/swift/recon-cache |
85 |
82 |
86 [container-sync] |
83 [container-sync] |
87 # You can override the default log routing for this app here (don't use set!): |
84 # You can override the default log routing for this app here (don't use set!): |
88 diff --git a/etc/object-server.conf-sample b/etc/object-server.conf-sample |
85 --- swift-2.2.2/etc/drive-audit.conf-sample.~1~ 2015-02-01 23:44:11.000000000 -0800 |
89 --- a/etc/object-server.conf-sample |
86 +++ swift-2.2.2/etc/drive-audit.conf-sample 2015-02-26 17:03:18.476812691 -0800 |
90 +++ b/etc/object-server.conf-sample |
87 @@ -8,7 +8,7 @@ |
91 @@ -99,8 +99,8 @@ use = egg:swift#healthcheck |
88 # log_max_line_length = 0 |
|
89 # minutes = 60 |
|
90 # error_limit = 1 |
|
91 -# recon_cache_path = /var/cache/swift |
|
92 +# recon_cache_path = /var/lib/swift/recon-cache |
|
93 # unmount_failed_device = True |
|
94 # |
|
95 # By default, drive-audit logs only to syslog. Setting this option True |
|
96 --- swift-2.2.2/etc/object-expirer.conf-sample.~1~ 2015-02-01 23:44:11.000000000 -0800 |
|
97 +++ swift-2.2.2/etc/object-expirer.conf-sample 2015-02-26 17:03:28.102759740 -0800 |
|
98 @@ -50,7 +50,7 @@ |
|
99 # up to reclaim_age seconds before it gives up and deletes the entry in the |
|
100 # queue. |
|
101 # reclaim_age = 604800 |
|
102 -# recon_cache_path = /var/cache/swift |
|
103 +# recon_cache_path = /var/lib/swift/recon-cache |
|
104 |
|
105 [pipeline:main] |
|
106 pipeline = catch_errors proxy-logging cache proxy-server |
|
107 --- swift-2.2.2/etc/object-server.conf-sample.~1~ 2015-02-01 23:44:11.000000000 -0800 |
|
108 +++ swift-2.2.2/etc/object-server.conf-sample 2015-02-26 16:49:51.938657130 -0800 |
|
109 @@ -143,8 +143,8 @@ use = egg:swift#healthcheck |
92 |
110 |
93 [filter:recon] |
111 [filter:recon] |
94 use = egg:swift#recon |
112 use = egg:swift#recon |
95 -#recon_cache_path = /var/cache/swift |
113 -#recon_cache_path = /var/cache/swift |
96 -#recon_lock_path = /var/lock |
114 -#recon_lock_path = /var/lock |
97 +#recon_cache_path = /var/lib/swift/recon-cache |
115 +#recon_cache_path = /var/lib/swift/recon-cache |
98 +#recon_lock_path = /var/run/swift |
116 +#recon_lock_path = /var/run/swift |
99 |
117 |
100 [object-replicator] |
118 [object-replicator] |
101 # You can override the default log routing for this app here (don't use set!): |
119 # You can override the default log routing for this app here (don't use set!): |
102 @@ -134,7 +134,7 @@ use = egg:swift#recon |
120 @@ -186,7 +186,7 @@ use = egg:swift#recon |
103 # reclaim_age = 604800 |
121 # reclaim_age = 604800 |
104 # |
122 # |
105 # ring_check_interval = 15 |
123 # ring_check_interval = 15 |
106 -# recon_cache_path = /var/cache/swift |
124 -# recon_cache_path = /var/cache/swift |
107 +# recon_cache_path = /var/lib/swift/recon-cache |
125 +# recon_cache_path = /var/lib/swift/recon-cache |
108 # |
126 # |
109 # limits how long rsync error log lines are |
127 # limits how long rsync error log lines are |
110 # 0 means to log the entire line |
128 # 0 means to log the entire line |
111 @@ -155,7 +155,7 @@ use = egg:swift#recon |
129 @@ -224,7 +224,7 @@ use = egg:swift#recon |
112 # slowdown will sleep that amount between objects |
130 # slowdown will sleep that amount between objects |
113 # slowdown = 0.01 |
131 # slowdown = 0.01 |
114 # |
132 # |
115 -# recon_cache_path = /var/cache/swift |
133 -# recon_cache_path = /var/cache/swift |
116 +# recon_cache_path = /var/lib/swift/recon-cache |
134 +# recon_cache_path = /var/lib/swift/recon-cache |
117 |
135 |
118 [object-auditor] |
136 [object-auditor] |
119 # You can override the default log routing for this app here (don't use set!): |
137 # You can override the default log routing for this app here (don't use set!): |
120 @@ -168,7 +168,7 @@ use = egg:swift#recon |
138 @@ -241,7 +241,7 @@ use = egg:swift#recon |
121 # bytes_per_second = 10000000 |
139 # bytes_per_second = 10000000 |
122 # log_time = 3600 |
140 # log_time = 3600 |
123 # zero_byte_files_per_second = 50 |
141 # zero_byte_files_per_second = 50 |
124 -# recon_cache_path = /var/cache/swift |
142 -# recon_cache_path = /var/cache/swift |
125 +# recon_cache_path = /var/lib/swift/recon-cache |
143 +# recon_cache_path = /var/lib/swift/recon-cache |
126 |
144 |
127 # Takes a comma separated list of ints. If set, the object auditor will |
145 # Takes a comma separated list of ints. If set, the object auditor will |
128 # increment a counter for every object whose size is <= to the given break |
146 # increment a counter for every object whose size is <= to the given break |
129 diff --git a/swift/account/auditor.py b/swift/account/auditor.py |
147 --- swift-2.2.2/swift/account/auditor.py.~1~ 2015-02-01 23:44:11.000000000 -0800 |
130 --- a/swift/account/auditor.py |
148 +++ swift-2.2.2/swift/account/auditor.py 2015-02-26 16:49:51.938879416 -0800 |
131 +++ b/swift/account/auditor.py |
149 @@ -46,7 +46,7 @@ class AccountAuditor(Daemon): |
132 @@ -45,7 +45,7 @@ class AccountAuditor(Daemon): |
|
133 swift.common.db.DB_PREALLOCATION = \ |
150 swift.common.db.DB_PREALLOCATION = \ |
134 config_true_value(conf.get('db_preallocation', 'f')) |
151 config_true_value(conf.get('db_preallocation', 'f')) |
135 self.recon_cache_path = conf.get('recon_cache_path', |
152 self.recon_cache_path = conf.get('recon_cache_path', |
136 - '/var/cache/swift') |
153 - '/var/cache/swift') |
137 + '/var/lib/swift/recon-cache') |
154 + '/var/lib/swift/recon-cache') |
138 self.rcache = os.path.join(self.recon_cache_path, "account.recon") |
155 self.rcache = os.path.join(self.recon_cache_path, "account.recon") |
139 |
156 |
140 def _one_audit_pass(self, reported): |
157 def _one_audit_pass(self, reported): |
141 diff --git a/swift/common/db_replicator.py b/swift/common/db_replicator.py |
158 --- swift-2.2.2/swift/common/db_replicator.py.~1~ 2015-02-01 23:44:11.000000000 -0800 |
142 --- a/swift/common/db_replicator.py |
159 +++ swift-2.2.2/swift/common/db_replicator.py 2015-02-26 16:49:51.939223420 -0800 |
143 +++ b/swift/common/db_replicator.py |
160 @@ -171,7 +171,7 @@ class Replicator(Daemon): |
144 @@ -169,7 +169,7 @@ class Replicator(Daemon): |
|
145 config_true_value(conf.get('db_preallocation', 'f')) |
161 config_true_value(conf.get('db_preallocation', 'f')) |
146 self._zero_stats() |
162 self._zero_stats() |
147 self.recon_cache_path = conf.get('recon_cache_path', |
163 self.recon_cache_path = conf.get('recon_cache_path', |
148 - '/var/cache/swift') |
164 - '/var/cache/swift') |
149 + '/var/lib/swift/recon-cache') |
165 + '/var/lib/swift/recon-cache') |
150 self.recon_replicator = '%s.recon' % self.server_type |
166 self.recon_replicator = '%s.recon' % self.server_type |
151 self.rcache = os.path.join(self.recon_cache_path, |
167 self.rcache = os.path.join(self.recon_cache_path, |
152 self.recon_replicator) |
168 self.recon_replicator) |
153 diff --git a/swift/common/middleware/recon.py b/swift/common/middleware/recon.py |
169 --- swift-2.2.2/swift/common/middleware/recon.py.~1~ 2015-02-01 23:44:11.000000000 -0800 |
154 --- a/swift/common/middleware/recon.py |
170 +++ swift-2.2.2/swift/common/middleware/recon.py 2015-02-26 16:49:51.939514933 -0800 |
155 +++ b/swift/common/middleware/recon.py |
|
156 @@ -15,6 +15,7 @@ |
171 @@ -15,6 +15,7 @@ |
157 |
172 |
158 import errno |
173 import errno |
159 import os |
174 import os |
160 +import sys |
175 +import sys |
161 from swift import gettext_ as _ |
176 from swift import gettext_ as _ |
162 |
177 |
163 from swift import __version__ as swiftver |
178 from swift import __version__ as swiftver |
164 @@ -45,7 +46,7 @@ class ReconMiddleware(object): |
179 @@ -46,7 +47,7 @@ class ReconMiddleware(object): |
165 swift_dir = conf.get('swift_dir', '/etc/swift') |
180 swift_dir = conf.get('swift_dir', '/etc/swift') |
166 self.logger = get_logger(conf, log_route='recon') |
181 self.logger = get_logger(conf, log_route='recon') |
167 self.recon_cache_path = conf.get('recon_cache_path', |
182 self.recon_cache_path = conf.get('recon_cache_path', |
168 - '/var/cache/swift') |
183 - '/var/cache/swift') |
169 + '/var/lib/swift/recon-cache') |
184 + '/var/lib/swift/recon-cache') |
170 self.object_recon_cache = os.path.join(self.recon_cache_path, |
185 self.object_recon_cache = os.path.join(self.recon_cache_path, |
171 'object.recon') |
186 'object.recon') |
172 self.container_recon_cache = os.path.join(self.recon_cache_path, |
187 self.container_recon_cache = os.path.join(self.recon_cache_path, |
173 @@ -87,28 +88,43 @@ class ReconMiddleware(object): |
188 @@ -90,28 +91,43 @@ class ReconMiddleware(object): |
174 def get_mounted(self, openr=open): |
189 def get_mounted(self, openr=open): |
175 """get ALL mounted fs from /proc/mounts""" |
190 """get ALL mounted fs from /proc/mounts""" |
176 mounts = [] |
191 mounts = [] |
177 - with openr('/proc/mounts', 'r') as procmounts: |
192 - with openr('/proc/mounts', 'r') as procmounts: |
178 + if sys.platform == 'sunos5': |
193 + if sys.platform == 'sunos5': |
219 + if sys.platform == 'sunos5': |
234 + if sys.platform == 'sunos5': |
220 + return {} |
235 + return {} |
221 meminfo = {} |
236 meminfo = {} |
222 with openr('/proc/meminfo', 'r') as memlines: |
237 with openr('/proc/meminfo', 'r') as memlines: |
223 for i in memlines: |
238 for i in memlines: |
224 diff --git a/swift/container/auditor.py b/swift/container/auditor.py |
239 --- swift-2.2.2/swift/container/auditor.py.~1~ 2015-02-01 23:44:11.000000000 -0800 |
225 --- a/swift/container/auditor.py |
240 +++ swift-2.2.2/swift/container/auditor.py 2015-02-26 16:49:51.939751504 -0800 |
226 +++ b/swift/container/auditor.py |
241 @@ -44,7 +44,7 @@ class ContainerAuditor(Daemon): |
227 @@ -45,7 +45,7 @@ class ContainerAuditor(Daemon): |
|
228 swift.common.db.DB_PREALLOCATION = \ |
242 swift.common.db.DB_PREALLOCATION = \ |
229 config_true_value(conf.get('db_preallocation', 'f')) |
243 config_true_value(conf.get('db_preallocation', 'f')) |
230 self.recon_cache_path = conf.get('recon_cache_path', |
244 self.recon_cache_path = conf.get('recon_cache_path', |
231 - '/var/cache/swift') |
245 - '/var/cache/swift') |
232 + '/var/lib/swift/recon-cache') |
246 + '/var/lib/swift/recon-cache') |
233 self.rcache = os.path.join(self.recon_cache_path, "container.recon") |
247 self.rcache = os.path.join(self.recon_cache_path, "container.recon") |
234 |
248 |
235 def _one_audit_pass(self, reported): |
249 def _one_audit_pass(self, reported): |
236 diff --git a/swift/container/updater.py b/swift/container/updater.py |
250 --- swift-2.2.2/swift/container/updater.py.~1~ 2015-02-01 23:44:11.000000000 -0800 |
237 --- a/swift/container/updater.py |
251 +++ swift-2.2.2/swift/container/updater.py 2015-02-26 16:49:51.939968905 -0800 |
238 +++ b/swift/container/updater.py |
|
239 @@ -60,7 +60,7 @@ class ContainerUpdater(Daemon): |
252 @@ -60,7 +60,7 @@ class ContainerUpdater(Daemon): |
240 swift.common.db.DB_PREALLOCATION = \ |
253 swift.common.db.DB_PREALLOCATION = \ |
241 config_true_value(conf.get('db_preallocation', 'f')) |
254 config_true_value(conf.get('db_preallocation', 'f')) |
242 self.recon_cache_path = conf.get('recon_cache_path', |
255 self.recon_cache_path = conf.get('recon_cache_path', |
243 - '/var/cache/swift') |
256 - '/var/cache/swift') |
244 + '/var/lib/swift/recon-cache') |
257 + '/var/lib/swift/recon-cache') |
245 self.rcache = os.path.join(self.recon_cache_path, "container.recon") |
258 self.rcache = os.path.join(self.recon_cache_path, "container.recon") |
246 self.user_agent = 'container-updater %s' % os.getpid() |
259 self.user_agent = 'container-updater %s' % os.getpid() |
247 |
260 |
248 diff --git a/swift/obj/auditor.py b/swift/obj/auditor.py |
261 --- swift-2.2.2/swift/obj/auditor.py.~1~ 2015-02-01 23:44:11.000000000 -0800 |
249 --- a/swift/obj/auditor.py |
262 +++ swift-2.2.2/swift/obj/auditor.py 2015-02-26 16:49:51.940188415 -0800 |
250 +++ b/swift/obj/auditor.py |
263 @@ -227,7 +227,7 @@ class ObjectAuditor(Daemon): |
251 @@ -56,7 +56,7 @@ class AuditorWorker(object): |
264 self.conf_zero_byte_fps = int( |
252 self.quarantines = 0 |
265 conf.get('zero_byte_files_per_second', 50)) |
253 self.errors = 0 |
|
254 self.recon_cache_path = conf.get('recon_cache_path', |
266 self.recon_cache_path = conf.get('recon_cache_path', |
255 - '/var/cache/swift') |
267 - '/var/cache/swift') |
256 + '/var/lib/swift/recon-cache') |
268 + '/var/lib/swift/recon-cache') |
257 self.rcache = os.path.join(self.recon_cache_path, "object.recon") |
269 self.rcache = os.path.join(self.recon_cache_path, "object.recon") |
258 self.stats_sizes = sorted( |
270 |
259 [int(s) for s in list_from_csv(conf.get('object_size_stats'))]) |
271 def _sleep(self): |
260 diff --git a/swift/obj/expirer.py b/swift/obj/expirer.py |
272 --- swift-2.2.2/swift/obj/expirer.py.~1~ 2015-02-01 23:44:11.000000000 -0800 |
261 --- a/swift/obj/expirer.py |
273 +++ swift-2.2.2/swift/obj/expirer.py 2015-02-26 16:49:51.940400670 -0800 |
262 +++ b/swift/obj/expirer.py |
274 @@ -57,7 +57,7 @@ class ObjectExpirer(Daemon): |
263 @@ -54,7 +54,7 @@ class ObjectExpirer(Daemon): |
|
264 self.report_first_time = self.report_last_time = time() |
275 self.report_first_time = self.report_last_time = time() |
265 self.report_objects = 0 |
276 self.report_objects = 0 |
266 self.recon_cache_path = conf.get('recon_cache_path', |
277 self.recon_cache_path = conf.get('recon_cache_path', |
267 - '/var/cache/swift') |
278 - '/var/cache/swift') |
268 + '/var/lib/swift/recon-cache') |
279 + '/var/lib/swift/recon-cache') |
269 self.rcache = join(self.recon_cache_path, 'object.recon') |
280 self.rcache = join(self.recon_cache_path, 'object.recon') |
270 self.concurrency = int(conf.get('concurrency', 1)) |
281 self.concurrency = int(conf.get('concurrency', 1)) |
271 if self.concurrency < 1: |
282 if self.concurrency < 1: |
272 diff --git a/swift/obj/replicator.py b/swift/obj/replicator.py |
283 --- swift-2.2.2/swift/obj/replicator.py.~1~ 2015-02-01 23:44:11.000000000 -0800 |
273 --- a/swift/obj/replicator.py |
284 +++ swift-2.2.2/swift/obj/replicator.py 2015-02-26 16:49:51.940644907 -0800 |
274 +++ b/swift/obj/replicator.py |
285 @@ -77,7 +77,7 @@ class ObjectReplicator(Daemon): |
275 @@ -76,7 +76,7 @@ class ObjectReplicator(Daemon): |
|
276 self.http_timeout = int(conf.get('http_timeout', 60)) |
286 self.http_timeout = int(conf.get('http_timeout', 60)) |
277 self.lockup_timeout = int(conf.get('lockup_timeout', 1800)) |
287 self.lockup_timeout = int(conf.get('lockup_timeout', 1800)) |
278 self.recon_cache_path = conf.get('recon_cache_path', |
288 self.recon_cache_path = conf.get('recon_cache_path', |
279 - '/var/cache/swift') |
289 - '/var/cache/swift') |
280 + '/var/lib/swift/recon-cache') |
290 + '/var/lib/swift/recon-cache') |
281 self.rcache = os.path.join(self.recon_cache_path, "object.recon") |
291 self.rcache = os.path.join(self.recon_cache_path, "object.recon") |
282 self.headers = { |
292 self.conn_timeout = float(conf.get('conn_timeout', 0.5)) |
283 'Content-Length': '0', |
293 self.node_timeout = float(conf.get('node_timeout', 10)) |
284 diff --git a/swift/obj/updater.py b/swift/obj/updater.py |
294 --- swift-2.2.2/swift/obj/updater.py.~1~ 2015-02-01 23:44:11.000000000 -0800 |
285 --- a/swift/obj/updater.py |
295 +++ swift-2.2.2/swift/obj/updater.py 2015-02-26 16:49:51.940853387 -0800 |
286 +++ b/swift/obj/updater.py |
|
287 @@ -52,7 +52,7 @@ class ObjectUpdater(Daemon): |
296 @@ -52,7 +52,7 @@ class ObjectUpdater(Daemon): |
288 self.successes = 0 |
297 self.successes = 0 |
289 self.failures = 0 |
298 self.failures = 0 |
290 self.recon_cache_path = conf.get('recon_cache_path', |
299 self.recon_cache_path = conf.get('recon_cache_path', |
291 - '/var/cache/swift') |
300 - '/var/cache/swift') |
292 + '/var/lib/swift/recon-cache') |
301 + '/var/lib/swift/recon-cache') |
293 self.rcache = os.path.join(self.recon_cache_path, 'object.recon') |
302 self.rcache = os.path.join(self.recon_cache_path, 'object.recon') |
294 |
303 |
295 def get_container_ring(self): |
304 def _listdir(self, path): |
296 diff --git a/test/unit/common/middleware/test_recon.py b/test/unit/common/middleware/test_recon.py |
305 --- swift-2.2.2/test/unit/common/middleware/test_recon.py.~1~ 2015-02-01 23:44:11.000000000 -0800 |
297 --- a/test/unit/common/middleware/test_recon.py |
306 +++ swift-2.2.2/test/unit/common/middleware/test_recon.py 2015-02-26 16:49:51.941363136 -0800 |
298 +++ b/test/unit/common/middleware/test_recon.py |
307 @@ -21,7 +21,9 @@ import array |
299 @@ -18,7 +18,9 @@ from unittest import TestCase |
308 from swift.common import ring, utils |
300 from contextlib import contextmanager |
309 from shutil import rmtree |
301 from posix import stat_result, statvfs_result |
|
302 import os |
310 import os |
303 +import sys |
311 +import sys |
304 import mock |
312 import mock |
305 +from nose import SkipTest |
313 +from nose import SkipTest |
306 |
314 |
307 import swift.common.constraints |
|
308 from swift import __version__ as swiftver |
315 from swift import __version__ as swiftver |
309 @@ -277,10 +279,12 @@ class TestReconSuccess(TestCase): |
316 from swift.common.swob import Request |
|
317 @@ -384,10 +386,12 @@ class TestReconSuccess(TestCase): |
310 {'device': 'none', 'path': '/proc/fs/vmblock/mountPoint'}] |
318 {'device': 'none', 'path': '/proc/fs/vmblock/mountPoint'}] |
311 oart = OpenAndReadTester(mounts_content) |
319 oart = OpenAndReadTester(mounts_content) |
312 rv = self.app.get_mounted(openr=oart.open) |
320 rv = self.app.get_mounted(openr=oart.open) |
313 - self.assertEquals(oart.open_calls, [(('/proc/mounts', 'r'), {})]) |
321 - self.assertEquals(oart.open_calls, [(('/proc/mounts', 'r'), {})]) |
314 + self.assertEquals(oart.open_calls, [(('/etc/mnttab', 'r'), {})]) |
322 + self.assertEquals(oart.open_calls, [(('/etc/mnttab', 'r'), {})]) |
318 + if sys.platform == 'sunos5': |
326 + if sys.platform == 'sunos5': |
319 + raise SkipTest |
327 + raise SkipTest |
320 oart = OpenAndReadTester(['0.03 0.03 0.00 1/220 16306']) |
328 oart = OpenAndReadTester(['0.03 0.03 0.00 1/220 16306']) |
321 rv = self.app.get_load(openr=oart.open) |
329 rv = self.app.get_load(openr=oart.open) |
322 self.assertEquals(oart.read_calls, [((), {})]) |
330 self.assertEquals(oart.read_calls, [((), {})]) |
323 @@ -290,6 +294,8 @@ class TestReconSuccess(TestCase): |
331 @@ -397,6 +401,8 @@ class TestReconSuccess(TestCase): |
324 '1m': 0.029999999999999999}) |
332 '1m': 0.029999999999999999}) |
325 |
333 |
326 def test_get_mem(self): |
334 def test_get_mem(self): |
327 + if sys.platform == 'sunos5': |
335 + if sys.platform == 'sunos5': |
328 + raise SkipTest |
336 + raise SkipTest |
329 meminfo_content = ['MemTotal: 505840 kB', |
337 meminfo_content = ['MemTotal: 505840 kB', |
330 'MemFree: 26588 kB', |
338 'MemFree: 26588 kB', |
331 'Buffers: 44948 kB', |
339 'Buffers: 44948 kB', |
332 @@ -401,7 +407,7 @@ class TestReconSuccess(TestCase): |
340 @@ -508,7 +514,7 @@ class TestReconSuccess(TestCase): |
333 self.assertEquals(self.fakecache.fakeout_calls, |
341 self.assertEquals(self.fakecache.fakeout_calls, |
334 [((['replication_time', 'replication_stats', |
342 [((['replication_time', 'replication_stats', |
335 'replication_last'], |
343 'replication_last'], |
336 - '/var/cache/swift/account.recon'), {})]) |
344 - '/var/cache/swift/account.recon'), {})]) |
337 + '/var/lib/swift/recon-cache/account.recon'), {})]) |
345 + '/var/lib/swift/recon-cache/account.recon'), {})]) |
338 self.assertEquals(rv, { |
346 self.assertEquals(rv, { |
339 "replication_stats": { |
347 "replication_stats": { |
340 "attempted": 1, "diff": 0, |
348 "attempted": 1, "diff": 0, |
341 @@ -432,7 +438,7 @@ class TestReconSuccess(TestCase): |
349 @@ -539,7 +545,7 @@ class TestReconSuccess(TestCase): |
342 self.assertEquals(self.fakecache.fakeout_calls, |
350 self.assertEquals(self.fakecache.fakeout_calls, |
343 [((['replication_time', 'replication_stats', |
351 [((['replication_time', 'replication_stats', |
344 'replication_last'], |
352 'replication_last'], |
345 - '/var/cache/swift/container.recon'), {})]) |
353 - '/var/cache/swift/container.recon'), {})]) |
346 + '/var/lib/swift/recon-cache/container.recon'), {})]) |
354 + '/var/lib/swift/recon-cache/container.recon'), {})]) |
347 self.assertEquals(rv, { |
355 self.assertEquals(rv, { |
348 "replication_time": 200.0, |
356 "replication_time": 200.0, |
349 "replication_stats": { |
357 "replication_stats": { |
350 @@ -454,7 +460,7 @@ class TestReconSuccess(TestCase): |
358 @@ -561,7 +567,7 @@ class TestReconSuccess(TestCase): |
351 self.assertEquals(self.fakecache.fakeout_calls, |
359 self.assertEquals(self.fakecache.fakeout_calls, |
352 [((['object_replication_time', |
360 [((['object_replication_time', |
353 'object_replication_last'], |
361 'object_replication_last'], |
354 - '/var/cache/swift/object.recon'), {})]) |
362 - '/var/cache/swift/object.recon'), {})]) |
355 + '/var/lib/swift/recon-cache/object.recon'), {})]) |
363 + '/var/lib/swift/recon-cache/object.recon'), {})]) |
356 self.assertEquals(rv, {'object_replication_time': 200.0, |
364 self.assertEquals(rv, {'object_replication_time': 200.0, |
357 'object_replication_last': 1357962809.15}) |
365 'object_replication_last': 1357962809.15}) |
358 |
366 |
359 @@ -465,7 +471,7 @@ class TestReconSuccess(TestCase): |
367 @@ -572,7 +578,7 @@ class TestReconSuccess(TestCase): |
360 rv = self.app.get_updater_info('container') |
368 rv = self.app.get_updater_info('container') |
361 self.assertEquals(self.fakecache.fakeout_calls, |
369 self.assertEquals(self.fakecache.fakeout_calls, |
362 [((['container_updater_sweep'], |
370 [((['container_updater_sweep'], |
363 - '/var/cache/swift/container.recon'), {})]) |
371 - '/var/cache/swift/container.recon'), {})]) |
364 + '/var/lib/swift/recon-cache/container.recon'), {})]) |
372 + '/var/lib/swift/recon-cache/container.recon'), {})]) |
365 self.assertEquals(rv, {"container_updater_sweep": 18.476239919662476}) |
373 self.assertEquals(rv, {"container_updater_sweep": 18.476239919662476}) |
366 |
374 |
367 def test_get_updater_info_object(self): |
375 def test_get_updater_info_object(self): |
368 @@ -475,7 +481,7 @@ class TestReconSuccess(TestCase): |
376 @@ -582,7 +588,7 @@ class TestReconSuccess(TestCase): |
369 rv = self.app.get_updater_info('object') |
377 rv = self.app.get_updater_info('object') |
370 self.assertEquals(self.fakecache.fakeout_calls, |
378 self.assertEquals(self.fakecache.fakeout_calls, |
371 [((['object_updater_sweep'], |
379 [((['object_updater_sweep'], |
372 - '/var/cache/swift/object.recon'), {})]) |
380 - '/var/cache/swift/object.recon'), {})]) |
373 + '/var/lib/swift/recon-cache/object.recon'), {})]) |
381 + '/var/lib/swift/recon-cache/object.recon'), {})]) |
374 self.assertEquals(rv, {"object_updater_sweep": 0.79848217964172363}) |
382 self.assertEquals(rv, {"object_updater_sweep": 0.79848217964172363}) |
375 |
383 |
376 def test_get_auditor_info_account(self): |
384 def test_get_auditor_info_account(self): |
377 @@ -491,7 +497,7 @@ class TestReconSuccess(TestCase): |
385 @@ -598,7 +604,7 @@ class TestReconSuccess(TestCase): |
378 'account_auditor_pass_completed', |
386 'account_auditor_pass_completed', |
379 'account_audits_since', |
387 'account_audits_since', |
380 'account_audits_failed'], |
388 'account_audits_failed'], |
381 - '/var/cache/swift/account.recon'), {})]) |
389 - '/var/cache/swift/account.recon'), {})]) |
382 + '/var/lib/swift/recon-cache/account.recon'), {})]) |
390 + '/var/lib/swift/recon-cache/account.recon'), {})]) |
383 self.assertEquals(rv, {"account_auditor_pass_completed": 0.24, |
391 self.assertEquals(rv, {"account_auditor_pass_completed": 0.24, |
384 "account_audits_failed": 0, |
392 "account_audits_failed": 0, |
385 "account_audits_passed": 6, |
393 "account_audits_passed": 6, |
386 @@ -510,7 +516,7 @@ class TestReconSuccess(TestCase): |
394 @@ -617,7 +623,7 @@ class TestReconSuccess(TestCase): |
387 'container_auditor_pass_completed', |
395 'container_auditor_pass_completed', |
388 'container_audits_since', |
396 'container_audits_since', |
389 'container_audits_failed'], |
397 'container_audits_failed'], |
390 - '/var/cache/swift/container.recon'), {})]) |
398 - '/var/cache/swift/container.recon'), {})]) |
391 + '/var/lib/swift/recon-cache/container.recon'), {})]) |
399 + '/var/lib/swift/recon-cache/container.recon'), {})]) |
392 self.assertEquals(rv, {"container_auditor_pass_completed": 0.24, |
400 self.assertEquals(rv, {"container_auditor_pass_completed": 0.24, |
393 "container_audits_failed": 0, |
401 "container_audits_failed": 0, |
394 "container_audits_passed": 6, |
402 "container_audits_passed": 6, |
395 @@ -538,7 +544,7 @@ class TestReconSuccess(TestCase): |
403 @@ -645,7 +651,7 @@ class TestReconSuccess(TestCase): |
396 self.assertEquals(self.fakecache.fakeout_calls, |
404 self.assertEquals(self.fakecache.fakeout_calls, |
397 [((['object_auditor_stats_ALL', |
405 [((['object_auditor_stats_ALL', |
398 'object_auditor_stats_ZBF'], |
406 'object_auditor_stats_ZBF'], |
399 - '/var/cache/swift/object.recon'), {})]) |
407 - '/var/cache/swift/object.recon'), {})]) |
400 + '/var/lib/swift/recon-cache/object.recon'), {})]) |
408 + '/var/lib/swift/recon-cache/object.recon'), {})]) |
401 self.assertEquals(rv, { |
409 self.assertEquals(rv, { |
402 "object_auditor_stats_ALL": { |
410 "object_auditor_stats_ALL": { |
403 "audit_time": 115.14418768882751, |
411 "audit_time": 115.14418768882751, |
|
412 @@ -692,7 +698,7 @@ class TestReconSuccess(TestCase): |
|
413 self.assertEquals(self.fakecache.fakeout_calls, |
|
414 [((['object_auditor_stats_ALL', |
|
415 'object_auditor_stats_ZBF'], |
|
416 - '/var/cache/swift/object.recon'), {})]) |
|
417 + '/var/lib/swift/recon-cache/object.recon'), {})]) |
|
418 self.assertEquals(rv, { |
|
419 "object_auditor_stats_ALL": { |
|
420 'disk1': { |