Make the migration less memory consuming
ClosedPublic

Authored by jskladan on Nov 24 2016, 4:52 PM.

Details

Summary

The psycopg does not use server-side cursor, and tries to just load all the
results of a query to the hosts memory.
This lessens the burden, although it still is quite memory-consuming because
we want to have the session which can rollback, and this basically stores all
the changed results locally, before applying the changes to DB.
This ended up using about 10 gigs of memory on dev (about 50k duplicate jobs,
about 3.5M results to be moved), which is still bad, but manageable enough
so I don't want to spend more time on it.

Test Plan

Tested in production! (dev actually...)

Diff Detail

Repository
rRSDB resultsdb
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jskladan retitled this revision from to Make the migration less memory consuming.Nov 24 2016, 4:52 PM
jskladan updated this object.
jskladan edited the test plan for this revision. (Show Details)
jskladan added reviewers: mkrizek, tflink, ralph2.
jskladan updated this revision to Diff 2696.Nov 24 2016, 5:18 PM
  • add yield_per to step 2 of schema upgrade
jskladan updated this revision to Diff 2697.Nov 24 2016, 7:26 PM
  • add yield_per to step 2 of schema upgrade
  • .
  • more logs
jskladan updated this revision to Diff 2698.Nov 24 2016, 9:00 PM
  • add yield_per to step 2 of schema upgrade
  • .
  • more logs
  • even moar logs
mkrizek accepted this revision.Nov 28 2016, 1:24 PM
This revision is now accepted and ready to land.Nov 28 2016, 1:24 PM
Closed by commit rRSDB9eec2bb614fd: Make the migration less memory consuming (authored by Josef Skladanka <jskladan@redhat.com>). · Explain WhyDec 6 2016, 2:03 PM
This revision was automatically updated to reflect the committed changes.