Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

crawler: provide informations from rdir to integrity crawler #1768

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion oio/cli/admin/service_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ def check_chunks(self, service, chunks, checker):
url = 'http://' + service
for chunk in chunks:
checker.check(Target(self.app.options.account,
chunk=url + '/' + chunk[2]))
chunk=url + '/' + chunk[2],
content_id=chunk[1], cid=chunk[0]))
for res in self._format_results(checker):
yield res
19 changes: 13 additions & 6 deletions oio/crawler/integrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ class Target(object):
"""

def __init__(self, account, container=None, obj=None,
chunk=None, content_id=None, version=None):
chunk=None, content_id=None, version=None,
cid=None):
self.account = account
self.container = container
self.obj = obj
self.content_id = content_id
self.version = version
self.chunk = chunk
self.cid = cid

def copy(self):
return Target(
Expand All @@ -75,6 +77,8 @@ def __repr__(self):
out = 'account=%s' % self.account
if self.container:
out += ', container=' + self.container
if self.cid:
out += ', cid=' + self.cid
if self.obj:
out += ', obj=' + self.obj
if self.content_id:
Expand Down Expand Up @@ -230,11 +234,14 @@ def write_error(self, target, irreparable=False):

def write_rebuilder_input(self, target, irreparable=False):
# FIXME(FVE): cid can be computed from account and container names
ct_meta = self.list_cache[(target.account, target.container)][1]
try:
cid = ct_meta['system']['sys.name'].split('.', 1)[0]
except KeyError:
cid = ct_meta['properties']['sys.name'].split('.', 1)[0]
if target.cid:
cid = target.cid
else:
ct_meta = self.list_cache[(target.account, target.container)][1]
try:
cid = ct_meta['system']['sys.name'].split('.', 1)[0]
except KeyError:
cid = ct_meta['properties']['sys.name'].split('.', 1)[0]
error = list()
if irreparable:
error.append('#IRREPARABLE')
Expand Down