@liw Indeed the longer you let a "rock star" behave badly whilst continuing to become more indispensable the worse the problem becomes and the more disruptive it can be to resolve the situation.
I've experienced this myself when I was 5 months into a job and my employer's badly behaving rock star of many years finally left the company. Not only did I have to figure out his poorly documented "clever" implementations, I had to face the fallout of his behaviour and his attempts to steal customers!