@@ -270,6 +270,12 @@ impl ConfigValidator {
270
270
. to_string ( ) ,
271
271
} ) ;
272
272
}
273
+ ( RoutingMode :: PrefillDecode { .. } , PolicyConfig :: CacheAware { .. } ) => {
274
+ return Err ( ConfigError :: IncompatibleConfig {
275
+ reason : "CacheAware policy is not supported in PD disaggregated mode"
276
+ . to_string ( ) ,
277
+ } ) ;
278
+ }
273
279
_ => { }
274
280
}
275
281
@@ -471,6 +477,31 @@ mod tests {
471
477
. contains( "RoundRobin policy is not supported in PD disaggregated mode" ) ) ;
472
478
}
473
479
480
+ #[ test]
481
+ fn test_validate_cache_aware_with_pd_mode ( ) {
482
+ // CacheAware with PD mode should fail
483
+ let config = RouterConfig :: new (
484
+ RoutingMode :: PrefillDecode {
485
+ prefill_urls : vec ! [ ( "http://prefill:8000" . to_string( ) , None ) ] ,
486
+ decode_urls : vec ! [ "http://decode:8000" . to_string( ) ] ,
487
+ } ,
488
+ PolicyConfig :: CacheAware {
489
+ cache_threshold : 0.5 ,
490
+ balance_abs_threshold : 32 ,
491
+ balance_rel_threshold : 1.1 ,
492
+ eviction_interval_secs : 60 ,
493
+ max_tree_size : 1000 ,
494
+ } ,
495
+ ) ;
496
+
497
+ let result = ConfigValidator :: validate ( & config) ;
498
+ assert ! ( result. is_err( ) ) ;
499
+ assert ! ( result
500
+ . unwrap_err( )
501
+ . to_string( )
502
+ . contains( "CacheAware policy is not supported in PD disaggregated mode" ) ) ;
503
+ }
504
+
474
505
#[ test]
475
506
fn test_validate_power_of_two_with_regular_mode ( ) {
476
507
// PowerOfTwo with Regular mode should fail
0 commit comments