@@ -613,13 +613,7 @@ impl RoutingInfo {
613613 . and_then ( |x| std:: str:: from_utf8 ( x) . ok ( ) )
614614 . and_then ( |x| x. parse :: < u64 > ( ) . ok ( ) ) ?;
615615 if key_count == 0 {
616- if is_readonly_cmd ( cmd) {
617- Some ( RoutingInfo :: SingleNode ( SingleNodeRoutingInfo :: Random ) )
618- } else {
619- Some ( RoutingInfo :: SingleNode (
620- SingleNodeRoutingInfo :: RandomPrimary ,
621- ) )
622- }
616+ Some ( RoutingInfo :: SingleNode ( SingleNodeRoutingInfo :: Random ) )
623617 } else {
624618 r. arg_idx ( 3 ) . map ( |key| RoutingInfo :: for_key ( cmd, key) )
625619 }
@@ -1116,23 +1110,12 @@ mod tests {
11161110 cmd ( "EVAL" ) . arg ( r#"redis.call("PING");"# ) . arg ( 0 ) ,
11171111 cmd ( "EVALSHA" ) . arg ( r#"redis.call("PING");"# ) . arg ( 0 ) ,
11181112 ] {
1119- // EVAL / EVALSHA are expected to be routed to a RandomPrimary
11201113 assert_eq ! (
11211114 RoutingInfo :: for_routable( cmd) ,
1122- Some ( RoutingInfo :: SingleNode (
1123- SingleNodeRoutingInfo :: RandomPrimary
1124- ) )
1115+ Some ( RoutingInfo :: SingleNode ( SingleNodeRoutingInfo :: Random ) )
11251116 ) ;
11261117 }
11271118
1128- // FCALL (with 0 keys) is expected to be routed to a random primary node
1129- assert_eq ! (
1130- RoutingInfo :: for_routable( cmd( "FCALL" ) . arg( "foo" ) . arg( 0 ) ) ,
1131- Some ( RoutingInfo :: SingleNode (
1132- SingleNodeRoutingInfo :: RandomPrimary
1133- ) )
1134- ) ;
1135-
11361119 // While FCALL with N keys is expected to be routed to a specific node
11371120 assert_eq ! (
11381121 RoutingInfo :: for_routable( cmd( "FCALL" ) . arg( "foo" ) . arg( 1 ) . arg( "mykey" ) ) ,
0 commit comments