Implement function of rack-awareness replication (DONE)