* reland "Refactors global key duplication detection (#46183)" This reverts commit d2b66dbfcf. * fix test
d2b66dbfcf