"nova-manage db online_data_migrations" doesn't report matched/migrated properly

Bug #1695991 reported by Chris Friesen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Wishlist
Unassigned

Bug Description

When running "nova-manage db online_data_migrations", it will report how many items matched the query and how many of the matching items were migrated.

However, most of the migration routines are not properly reporting the "total matched" count when "max_count" is specified. This makes it difficult to know whether you have to call it again or not when specifying "--max-count" explicitly.

Take for example Flavor.migrate_flavors(). This limits the value of main_db_ids to a max of "count":

main_db_ids = _get_main_db_flavor_ids(ctxt, count)
count_all = len(main_db_ids)
<snip>
return count_all, count_hit

If someone sees that there were 50 items total and 50 items were converted, they may think that all the work is done. It would be better to call _get_main_db_flavor_ids() with no limit to the number of matches, and apply the limit to the number of conversions.

Alternately, we should document that if --max-count is used then "nova-manage db online_data_migrations" should be called multiple times until *no* matches are reported and we can basically ignore the number of hits. (Or until no hits are reported, which would more closely align with the code in the case that max-count isn't specified explicitly.)

Tags: nova-manage
Chris Friesen (cbf123)
description: updated
Sean Dague (sdague)
tags: added: nova-manage
Changed in nova:
status: New → Confirmed
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.