Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

C4-23 Fix Mirror Health #125

Merged
merged 6 commits into from
Feb 12, 2020
Merged

C4-23 Fix Mirror Health #125

merged 6 commits into from
Feb 12, 2020

Conversation

willronchetti
Copy link
Member

  • Previously when purging items from ElasticSearch we would grab our 'ES Mirror' on the fly which ended up doing a very expensive AWS API request
  • Instead, do this once upon ESStorage initialization since the value we care about will never change regardless of blue/green deployment schedule

Copy link
Collaborator

@netsettler netsettler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine. The question I asked is not blocking.

log.info('PURGE: attempting to purge %s from mirror storage %s' % (rid, mirror_env))
# if we could not get mirror health, bail here
if 'error' in mirror_health:
if 'error' in self.mirror_health:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in this case you have a dictionary with an 'error' key in it? e.g.,

{"error": "unable to do something"}

Is that right? it'd be nice to have some kind of note saying what it was looking for.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes in fact we do - this actually tripped me up the first time I put this code up. See ff_utils.get_health_page (https://github.com/4dn-dcic/utils/blob/master/dcicutils/ff_utils.py#L867)

@willronchetti willronchetti merged commit 9ed46a5 into master Feb 12, 2020
@willronchetti willronchetti deleted the cache branch February 12, 2020 16:52
Copy link
Collaborator

@netsettler netsettler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That last change looks fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants