Merge "Revert "Remove workaround for comparing database domain IDs.""