SENTRY-564: Sentry metastore upgrade order is computed incorrectly (Sravya Tirukkovalur via Lenni Kuff)