Rotten egg smell only in the hot water (cold water smells fine) points directly at the water heater. Sulfate-reducing bacteria live in the warm, oxygen-depleted environment inside the tank. They feed on sulfates in the water and produce hydrogen sulfide gas -- the rotten egg smell. The magnesium anode rod accelerates this reaction by releasing electrons that the bacteria use as an energy source. The fix is straightforward: replace the magnesium anode rod with an aluminum/zinc rod, which does not fuel the bacteria. Flush the tank to clear the existing hydrogen sulfide.