Implemented get_master/1 and get_replica/2.