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":
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.
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.