ref #6359 improve partition handling