Skip to content

Commit 1588bc4

Browse files
committed
Fix bug
1 parent 02dd75b commit 1588bc4

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

rust/worker/src/execution/orchestration/compact.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,22 @@ impl Handler<TaskResult<MaterializeLogOutput, MaterializeLogOperatorError>>
676676
}
677677
};
678678

679-
self.write(materialized_result.result, ctx.receiver(), ctx)
680-
.await;
679+
if materialized_result.result.is_empty() {
680+
self.num_write_tasks -= 1;
681+
682+
if self.num_write_tasks == 0 {
683+
// There is nothing to flush, proceed to register
684+
self.register(
685+
self.pulled_log_offset.unwrap(),
686+
Arc::new([]),
687+
ctx.receiver(),
688+
)
689+
.await;
690+
}
691+
} else {
692+
self.write(materialized_result.result, ctx.receiver(), ctx)
693+
.await;
694+
}
681695
}
682696
}
683697

0 commit comments

Comments
 (0)