up code swap master-slave when master disconnect