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

Clear hash id database on package resync. #56

Merged
merged 2 commits into from
Oct 3, 2018

Conversation

simpoir
Copy link
Contributor

@simpoir simpoir commented Oct 2, 2018

This should avoid loop when inconsistencies are present in the database
through either corruption or server-restore. (LP: #1616116)

Testing instructions:

  • launch a landscape server and register (using ppa packages is somewhat simpler as hash-db is pre-populated).
  • register client against server. wait for package info
  • pg_dumpall
  • add a repo and wait for new package to show on client.
  • restore postgres backup.
  • trigger a package install from the new repo to have new package show up
  • if you haven't regenerated hash-ids on the server, clients will be stuck in a loop. this is to be expected as the server is inconsistent with itself.
  • client should resync once then will re-fetch hash on the next run. Some hash-id requests may go through in the meantime.

This should avoid loop when inconsistencies are present in the database
through either corruption or server-restore. (LP: #1616116)
@simpoir
Copy link
Contributor Author

simpoir commented Oct 2, 2018

A nice side-effect of dropping the hash database is a delay is induced in the package info refresh, thus throttling the refresh and avoiding the server being overloaded.

Copy link
Contributor

@sparkiegeek sparkiegeek left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@simpoir simpoir merged commit 666cd32 into canonical:master Oct 3, 2018
@simpoir simpoir deleted the 1616116_resync_loop branch October 3, 2018 21:04
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