Revert "Revert "sharding failover""

This reverts commit 33c655d15ef733e3521093bd6a5180603593f5db.