swift 2.32.1__py2.py3-none-any.whl → 2.33.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- swift/account/server.py +1 -11
- swift/cli/info.py +28 -1
- swift-2.32.1.data/scripts/swift-recon-cron → swift/cli/recon_cron.py +4 -13
- swift/cli/reload.py +141 -0
- swift/common/daemon.py +12 -2
- swift/common/db.py +12 -8
- swift/common/http_protocol.py +76 -3
- swift/common/manager.py +18 -5
- swift/common/memcached.py +18 -12
- swift/common/middleware/proxy_logging.py +35 -27
- swift/common/middleware/s3api/acl_handlers.py +1 -1
- swift/common/middleware/s3api/controllers/__init__.py +3 -0
- swift/common/middleware/s3api/controllers/acl.py +3 -2
- swift/common/middleware/s3api/controllers/logging.py +2 -2
- swift/common/middleware/s3api/controllers/multi_upload.py +30 -6
- swift/common/middleware/s3api/controllers/object_lock.py +44 -0
- swift/common/middleware/s3api/s3api.py +4 -0
- swift/common/middleware/s3api/s3request.py +19 -12
- swift/common/middleware/s3api/s3response.py +13 -2
- swift/common/middleware/s3api/utils.py +1 -1
- swift/common/middleware/slo.py +395 -298
- swift/common/middleware/staticweb.py +45 -14
- swift/common/middleware/tempurl.py +132 -91
- swift/common/request_helpers.py +32 -8
- swift/common/storage_policy.py +1 -1
- swift/common/swob.py +5 -2
- swift/common/utils/__init__.py +230 -135
- swift/common/utils/timestamp.py +23 -2
- swift/common/wsgi.py +8 -0
- swift/container/backend.py +126 -21
- swift/container/replicator.py +42 -6
- swift/container/server.py +264 -145
- swift/container/sharder.py +50 -30
- swift/container/updater.py +1 -0
- swift/obj/auditor.py +2 -1
- swift/obj/diskfile.py +55 -19
- swift/obj/expirer.py +1 -13
- swift/obj/mem_diskfile.py +2 -1
- swift/obj/mem_server.py +1 -0
- swift/obj/replicator.py +2 -2
- swift/obj/server.py +12 -23
- swift/obj/updater.py +1 -0
- swift/obj/watchers/dark_data.py +72 -34
- swift/proxy/controllers/account.py +3 -2
- swift/proxy/controllers/base.py +217 -127
- swift/proxy/controllers/container.py +274 -289
- swift/proxy/controllers/obj.py +98 -141
- swift/proxy/server.py +2 -12
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-container-info +3 -0
- swift-2.33.1.data/scripts/swift-recon-cron +24 -0
- {swift-2.32.1.dist-info → swift-2.33.1.dist-info}/AUTHORS +3 -1
- {swift-2.32.1.dist-info → swift-2.33.1.dist-info}/METADATA +4 -3
- {swift-2.32.1.dist-info → swift-2.33.1.dist-info}/RECORD +94 -91
- {swift-2.32.1.dist-info → swift-2.33.1.dist-info}/WHEEL +1 -1
- {swift-2.32.1.dist-info → swift-2.33.1.dist-info}/entry_points.txt +1 -0
- swift-2.33.1.dist-info/pbr.json +1 -0
- swift-2.32.1.dist-info/pbr.json +0 -1
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-account-audit +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-account-auditor +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-account-info +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-account-reaper +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-account-replicator +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-account-server +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-config +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-container-auditor +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-container-reconciler +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-container-replicator +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-container-server +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-container-sharder +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-container-sync +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-container-updater +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-dispersion-populate +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-dispersion-report +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-drive-audit +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-form-signature +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-get-nodes +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-init +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-object-auditor +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-object-expirer +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-object-info +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-object-reconstructor +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-object-relinker +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-object-replicator +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-object-server +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-object-updater +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-oldies +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-orphans +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-proxy-server +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-recon +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-reconciler-enqueue +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-ring-builder +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-ring-builder-analyzer +0 -0
- {swift-2.32.1.data → swift-2.33.1.data}/scripts/swift-ring-composer +0 -0
- {swift-2.32.1.dist-info → swift-2.33.1.dist-info}/LICENSE +0 -0
- {swift-2.32.1.dist-info → swift-2.33.1.dist-info}/top_level.txt +0 -0
swift/obj/watchers/dark_data.py
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
#
|
17
17
|
# This is an audit watcher that manages the dark data in the cluster.
|
18
18
|
# Since the API for audit watchers is intended to use external plugins,
|
19
|
-
# this code is invoked as if it were external: through
|
19
|
+
# this code is invoked as if it were external: through load_pkg_resources().
|
20
20
|
# Our setup.py comes pre-configured for convenience, but the operator has
|
21
21
|
# to enable this watcher honestly by additing DarkDataWatcher to watchers=
|
22
22
|
# in object-server.conf. The default is off, as if this does not exist.
|
@@ -42,6 +42,10 @@ servers agree, it will silently fail to detect anything if even one
|
|
42
42
|
of container servers in the ring is down or unreacheable. This is
|
43
43
|
done in the interest of operators who run with action=delete.
|
44
44
|
|
45
|
+
If a container is sharded, there is a small edgecase where an object row could
|
46
|
+
be misplaced. So it is recommended to always start with action=log, before
|
47
|
+
your confident to run action=delete.
|
48
|
+
|
45
49
|
Finally, keep in mind that Dark Data watcher needs the container
|
46
50
|
ring to operate, but runs on an object node. This can come up if
|
47
51
|
cluster has nodes separated by function.
|
@@ -57,7 +61,7 @@ from eventlet import Timeout
|
|
57
61
|
from swift.common.direct_client import direct_get_container
|
58
62
|
from swift.common.exceptions import ClientException, QuarantineRequest
|
59
63
|
from swift.common.ring import Ring
|
60
|
-
from swift.common.utils import split_path, Timestamp
|
64
|
+
from swift.common.utils import split_path, Namespace, Timestamp
|
61
65
|
|
62
66
|
|
63
67
|
class ContainerError(Exception):
|
@@ -114,7 +118,7 @@ class DarkDataWatcher(object):
|
|
114
118
|
|
115
119
|
obj_path = object_metadata['name']
|
116
120
|
try:
|
117
|
-
obj_info = get_info_1(self.container_ring, obj_path
|
121
|
+
obj_info = get_info_1(self.container_ring, obj_path)
|
118
122
|
except ContainerError:
|
119
123
|
self.tot_unknown += 1
|
120
124
|
return
|
@@ -137,39 +141,73 @@ class DarkDataWatcher(object):
|
|
137
141
|
#
|
138
142
|
# Get the information for 1 object from container server
|
139
143
|
#
|
140
|
-
def get_info_1(container_ring, obj_path
|
144
|
+
def get_info_1(container_ring, obj_path):
|
141
145
|
|
142
146
|
path_comps = split_path(obj_path, 1, 3, True)
|
143
147
|
account_name = path_comps[0]
|
144
148
|
container_name = path_comps[1]
|
145
149
|
obj_name = path_comps[2]
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
150
|
+
visited = set()
|
151
|
+
|
152
|
+
def check_container(account_name, container_name):
|
153
|
+
record_type = 'auto'
|
154
|
+
if (account_name, container_name) in visited:
|
155
|
+
# Already queried; So we have a last ditch effort and specifically
|
156
|
+
# ask for object data as this could be pointing back to the root
|
157
|
+
# If the container doesn't have objects then this will return
|
158
|
+
# no objects and break the loop.
|
159
|
+
record_type = 'object'
|
160
|
+
else:
|
161
|
+
visited.add((account_name, container_name))
|
162
|
+
|
163
|
+
container_part, container_nodes = \
|
164
|
+
container_ring.get_nodes(account_name, container_name)
|
165
|
+
if not container_nodes:
|
166
|
+
raise ContainerError()
|
167
|
+
|
168
|
+
# Perhaps we should do something about the way we select the container
|
169
|
+
# nodes. For now we just shuffle. It spreads the load, but it does not
|
170
|
+
# improve upon the the case when some nodes are down, so auditor slows
|
171
|
+
# to a crawl (if this plugin is enabled).
|
172
|
+
random.shuffle(container_nodes)
|
173
|
+
|
174
|
+
err_flag = 0
|
175
|
+
shards = set()
|
176
|
+
for node in container_nodes:
|
177
|
+
try:
|
178
|
+
# The prefix+limit trick is used when a traditional listing
|
179
|
+
# is returned, while includes is there for shards.
|
180
|
+
# See the how GET routes it in swift/container/server.py.
|
181
|
+
headers, objs_or_shards = direct_get_container(
|
182
|
+
node, container_part, account_name, container_name,
|
183
|
+
prefix=obj_name, limit=1,
|
184
|
+
extra_params={'includes': obj_name, 'states': 'listing'},
|
185
|
+
headers={'X-Backend-Record-Type': record_type})
|
186
|
+
except (ClientException, Timeout):
|
187
|
+
# Something is wrong with that server, treat as an error.
|
188
|
+
err_flag += 1
|
189
|
+
continue
|
190
|
+
if headers.get('X-Backend-Record-Type') == 'shard':
|
191
|
+
# When using includes=obj_name, we don't need to anything
|
192
|
+
# like find_shard_range(obj_name, ... objs_or_shards).
|
193
|
+
if len(objs_or_shards) != 0:
|
194
|
+
namespace = Namespace(objs_or_shards[0]['name'],
|
195
|
+
objs_or_shards[0]['lower'],
|
196
|
+
objs_or_shards[0]['upper'])
|
197
|
+
shards.add((namespace.account, namespace.container))
|
198
|
+
continue
|
199
|
+
if objs_or_shards and objs_or_shards[0]['name'] == obj_name:
|
200
|
+
return objs_or_shards[0]
|
201
|
+
|
202
|
+
# If we got back some shards, recurse
|
203
|
+
for account_name, container_name in shards:
|
204
|
+
res = check_container(account_name, container_name)
|
205
|
+
if res:
|
206
|
+
return res
|
207
|
+
|
208
|
+
# We only report the object as dark if all known servers agree to it.
|
209
|
+
if err_flag:
|
210
|
+
raise ContainerError()
|
211
|
+
return None
|
212
|
+
|
213
|
+
return check_container(account_name, container_name)
|
@@ -63,8 +63,9 @@ class AccountController(Controller):
|
|
63
63
|
partition = self.app.account_ring.get_part(self.account_name)
|
64
64
|
concurrency = self.app.account_ring.replica_count \
|
65
65
|
if self.app.get_policy_options(None).concurrent_gets else 1
|
66
|
-
node_iter = NodeIter(
|
67
|
-
|
66
|
+
node_iter = NodeIter(
|
67
|
+
'account', self.app, self.app.account_ring, partition,
|
68
|
+
self.logger, req)
|
68
69
|
params = req.params
|
69
70
|
params['format'] = 'json'
|
70
71
|
req.params = params
|