Skip to content

Commit a44b882

Browse files
committed
capability: avoid touching ChangeBatch on no-op downgrades
Signed-off-by: Petros Angelatos <[email protected]>
1 parent 54f9b49 commit a44b882

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

timely/src/dataflow/operators/capability.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ impl<T: Timestamp> Capability<T> {
151151
///
152152
/// Returns a [DowngradeError] if `self.time` is not less or equal to `new_time`.
153153
pub fn try_downgrade(&mut self, new_time: &T) -> Result<(), DowngradeError> {
154-
if let Some(new_capability) = self.try_delayed(new_time) {
155-
*self = new_capability;
154+
if self.time.less_equal(new_time) {
155+
if &self.time != new_time {
156+
*self = Self::new(new_time.clone(), self.internal.clone());
157+
}
156158
Ok(())
157159
} else {
158160
Err(DowngradeError(()))

0 commit comments

Comments
 (0)