Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
berkaysynnada committed Oct 30, 2024
1 parent b63a631 commit 666b3fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/sorts/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub(crate) struct SortPreservingMergeStream<C: CursorValues> {
/// To resolve this, we are modifying the tie-breaking logic. Instead of always choosing the partition with the smallest index,
/// we now select the partition that has the fewest poll counts for the same value.
/// This ensures that multiple partitions with the same value are chosen equally, distributing the polling load in a round-robin fashion.
/// This approach balances the workload more effectively across partitions and avoids excessive buffer growth.Round robin tie breaker
/// This approach balances the workload more effectively across partitions and avoids excessive buffer growth.
enable_round_robin_tie_breaker: bool,

/// Flag indicating whether we are in the mode of round-robin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,12 @@ mod tests {
Ok(Arc::new(spm))
}

#[tokio::test(flavor = "multi_thread")]
/// This test verifies that memory usage stays within limits when the tie breaker is enabled.
/// Any errors here could indicate unintended changes in tie breaker logic.
///
/// Note: If you adjust constants in this test, ensure that memory usage differs
/// based on whether the tie breaker is enabled or disabled.
#[tokio::test(flavor = "multi_thread")]
async fn test_round_robin_tie_breaker_success() -> Result<()> {
let task_ctx = generate_task_ctx_for_round_robin_tie_breaker()?;
let spm = generate_spm_for_round_robin_tie_breaker(true)?;
Expand Down

0 comments on commit 666b3fe

Please sign in to comment.