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

An import that fails between creating a page and creating a version leaves an empty page record #192

Open
Mr0grog opened this issue Jan 5, 2018 · 3 comments
Labels

Comments

@Mr0grog
Copy link
Member

Mr0grog commented Jan 5, 2018

If an import results in the creation of a new page record, but fails when creating the actual version of that page (because of invalid data), the empty page record gets left lying around afterward. While we think it’s OK for the DB to have pages with no versions, it’s not really desirable, and we shouldn’t wind up in that situation accidentally like this.

The import versions job needs to be careful to roll back the creation of a page if the version failed.

I can think of a couple straightforward ways of doing this:

  • Wrap the page + version creation together in a single transaction. Not sure on the overhead of this.
  • Keep a list of pages that were created by the job and, when cleaning up at the end, remove any that have no versions.

We also need a test for this.

@stale
Copy link

stale bot commented Jan 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in seven days if no further activity occurs. If it should not be closed, please comment! Thank you for your contributions.

@stale stale bot added the stale label Jan 10, 2019
@Mr0grog
Copy link
Member Author

Mr0grog commented Jan 10, 2019

This is actually a reasonably serious issue we need to fix.

@Mr0grog
Copy link
Member Author

Mr0grog commented May 31, 2019

Update: this issue is not so serious now that @bensheldon fixed edgi-govdata-archiving/web-monitoring-ui#363.

@Mr0grog Mr0grog moved this from Working to Icebox in Web Monitoring Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Web Monitoring
  
Icebox
Development

Successfully merging a pull request may close this issue.

1 participant