mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-06 01:17:46 +08:00
Merge remote-tracking branch 'origin/main' into codex/fix-antigravity-quota
This commit is contained in:
@@ -756,19 +756,28 @@ impl<'a> PoolKeyCursor<'a> {
|
||||
return None;
|
||||
}
|
||||
};
|
||||
let api_format = self.group.candidate.endpoint_api_format.as_str();
|
||||
rows.sort_by(|left, right| {
|
||||
let left_priority = self
|
||||
.routing_overlay
|
||||
.as_ref()
|
||||
.map_or(left.key_internal_priority, |overlay| {
|
||||
overlay.key_priority(&left.key_id, left.key_internal_priority)
|
||||
});
|
||||
let right_priority = self
|
||||
.routing_overlay
|
||||
.as_ref()
|
||||
.map_or(right.key_internal_priority, |overlay| {
|
||||
overlay.key_priority(&right.key_id, right.key_internal_priority)
|
||||
});
|
||||
let left_priority = self.routing_overlay.as_ref().map_or(
|
||||
left.key_internal_priority,
|
||||
|overlay| {
|
||||
overlay.key_priority_for_format(
|
||||
&left.key_id,
|
||||
api_format,
|
||||
left.key_internal_priority,
|
||||
)
|
||||
},
|
||||
);
|
||||
let right_priority = self.routing_overlay.as_ref().map_or(
|
||||
right.key_internal_priority,
|
||||
|overlay| {
|
||||
overlay.key_priority_for_format(
|
||||
&right.key_id,
|
||||
api_format,
|
||||
right.key_internal_priority,
|
||||
)
|
||||
},
|
||||
);
|
||||
left_priority
|
||||
.cmp(&right_priority)
|
||||
.then(left.key_id.cmp(&right.key_id))
|
||||
@@ -1987,11 +1996,13 @@ fn apply_pool_orchestration(
|
||||
orchestration: PoolCandidateOrchestration,
|
||||
) -> EligibleLocalExecutionCandidate {
|
||||
let scheduler_affinity_epoch = candidate.orchestration.scheduler_affinity_epoch;
|
||||
let sticky_key_attempts = candidate.orchestration.sticky_key_attempts;
|
||||
candidate.orchestration = LocalExecutionCandidateMetadata {
|
||||
candidate_group_id: orchestration.candidate_group_id,
|
||||
pool_key_index: orchestration.pool_key_index,
|
||||
pool_key_lease: None,
|
||||
scheduler_affinity_epoch,
|
||||
sticky_key_attempts,
|
||||
};
|
||||
candidate
|
||||
}
|
||||
@@ -2244,6 +2255,7 @@ mod tests {
|
||||
pool_key_index: Some(0),
|
||||
pool_key_lease: None,
|
||||
scheduler_affinity_epoch: None,
|
||||
sticky_key_attempts: None,
|
||||
}
|
||||
);
|
||||
assert_eq!(reordered[1].orchestration.pool_key_index, Some(1));
|
||||
@@ -2261,6 +2273,7 @@ mod tests {
|
||||
pool_key_index: None,
|
||||
pool_key_lease: None,
|
||||
scheduler_affinity_epoch: None,
|
||||
sticky_key_attempts: None,
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -5157,6 +5170,7 @@ mod tests {
|
||||
priority_mode: RoutingSetPriorityMode::Provider,
|
||||
scheduling_mode: RoutingSchedulingMode::CacheAffinity,
|
||||
keep_priority_on_conversion: false,
|
||||
sticky_key_attempts: aether_routing_core::DEFAULT_STICKY_KEY_ATTEMPTS,
|
||||
ranking_overlay: RankingOverlay {
|
||||
allowed_keys: key_ids.into_iter().map(str::to_string).collect(),
|
||||
..RankingOverlay::default()
|
||||
|
||||
@@ -208,6 +208,7 @@ mod tests {
|
||||
pool_key_index: None,
|
||||
pool_key_lease: None,
|
||||
scheduler_affinity_epoch: None,
|
||||
sticky_key_attempts: None,
|
||||
},
|
||||
ranking: None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user