Berachos, Chapter 2, Mishnah 7. The Mishnah continues with another example of a case in which Rabban Gamliel acted in a way that departed from the usual halachic practice.
The text of the Mishnah:
"U'meis Tavi avdo, kibeil alav tanchumin" - Tavi, Rabban Gamliel's servant, was a Canaanite slave, who is not a Jew in every respect. When he died, Rabban Gamliel accepted condolences for him from people, in the manner that mourners are comforted.
"Amru lo talmidav: lo limadtanu rabbeinu she'ein mekablin tanchumin al ha'avadim?" - Surely you taught us that one does not accept condolences for slaves and servants.
"Amar lahem: ein Tavi avdi ki'she'ar kol ha'avadim, kasher hayah" - Tavi, who is mentioned in other places in the Gemara and the Mishnah (among them in Maseches Sukkah), is not like other slaves, for he was a worthy man.
What does "kasher hayah" mean:
The intention is not simply that he was a decent person. Tavi was an outstanding scholar, and he truly possessed those qualities that we find in a talmid chacham. For this reason Rabban Gamliel determined that it was fitting to accept condolences over the loss of this servant.
The explanation of the Gra:
The Gra explains that the students' question contained two aspects:
He was a slave and a servant, and one does not accept condolences for such a person.
Even had he been an ordinary Jew, he was not a relative, and one does not accept condolences for someone who is not a relative.
With his answer "kasher hayah" Rabban Gamliel responded to both aspects at once: since Tavi was a worthy and upright man, any person is permitted to accept condolences over the loss of a good and upright man to whom he was attached.
In summary: In this Mishnah we learned that Rabban Gamliel accepted condolences over the death of Tavi his servant, even though one does not accept condolences for slaves, because Tavi "kasher hayah" - he was a learned man who possessed the qualities of a talmid chacham. And according to the explanation of the Gra, this answer addressed both parts of the students' question: both that he was a slave and that he was not part of his family, for over the loss of a worthy and upright man, anyone attached to him is permitted to accept condolences.