The mishna teaches: if there are two men in the same town and both are
named Yosef ben Shimon, neither may produce a bond of indebtedness
against the other. Further, nobody else may produce a bond of indebtedness
against either of them. And if a man finds among his possessions a
quittance showing that the bond of Yosef ben Shimon was discharged, it
applies to both of them. So how should they proceed, since we want
Yosef to be able to borrow money? When writing the documents (both
bond and quittance) they should write the names to the third generation
(e.g. Yosef ben Shimon ben Reuven). If their names are the same to the
third generation, then they should add a description (e.g. Yosef ben
Shimon ben Reuven, the tall one). And if those are like too but one
is a kohein or levi and the other not, they should indicate that.
(I can't tell if they keep the description in this last case.) (172a)
Neither the mishna nor the g'mara here addresses the case where Yosef
ben Shimon was unique and then another one moved into town.
I assume we're talking about small towns here, where it's not implausible
for names to be unique and for people to know that. I'm a little surprised
that a description (which could be subjective or mutable) has higher
precedence than kohein/levi status (which is neither).
When I shared this at minyan this morning, somebody told me that one of
her family members has a last name that means "limp" (as in "has a", not as in "floppy"), which seemed peculiar to her. She said she was going to go teach him this mishna.