@@ -185,7 +185,7 @@ where
185
185
* reader = Some ( reader_local. clone ( ) ) ;
186
186
187
187
// Tracks the input frontier, used to populate the lower bound of new batches.
188
- let mut input_frontier = Antichain :: from_elem ( <G :: Timestamp as Timestamp >:: minimum ( ) ) ;
188
+ let mut prev_frontier = Antichain :: from_elem ( <G :: Timestamp as Timestamp >:: minimum ( ) ) ;
189
189
190
190
// For stashing input upserts, ordered increasing by time (`BinaryHeap` is a max-heap).
191
191
let mut priority_queue = BinaryHeap :: < std:: cmp:: Reverse < ( G :: Timestamp , Tr :: Key , Option < Tr :: Val > ) > > :: new ( ) ;
@@ -202,11 +202,13 @@ where
202
202
}
203
203
} ) ;
204
204
205
- // Test to see if strict progress has occurred, which happens whenever any element of
206
- // the old frontier is not greater or equal to the new frontier. It is only in this
207
- // case that we have any data processing to do.
208
- let progress = input_frontier. elements ( ) . iter ( ) . any ( |t2| !input. frontier ( ) . less_equal ( t2) ) ;
209
- if progress {
205
+ // Assert that the frontier never regresses.
206
+ assert ! ( PartialOrder :: less_equal( & prev_frontier. borrow( ) , & input. frontier( ) . frontier( ) ) ) ;
207
+
208
+ // Test to see if strict progress has occurred, which happens whenever the new
209
+ // frontier isn't equal to the previous. It is only in this case that we have any
210
+ // data processing to do.
211
+ if prev_frontier. borrow ( ) != input. frontier ( ) . frontier ( ) {
210
212
211
213
// If there is at least one capability not in advance of the input frontier ...
212
214
if capabilities. elements ( ) . iter ( ) . any ( |c| !input. frontier ( ) . less_equal ( c. time ( ) ) ) {
@@ -293,8 +295,8 @@ where
293
295
builder. push ( update) ;
294
296
}
295
297
}
296
- let batch = builder. done ( input_frontier . clone ( ) , upper. clone ( ) , Antichain :: from_elem ( G :: Timestamp :: minimum ( ) ) ) ;
297
- input_frontier . clone_from ( & upper) ;
298
+ let batch = builder. done ( prev_frontier . clone ( ) , upper. clone ( ) , Antichain :: from_elem ( G :: Timestamp :: minimum ( ) ) ) ;
299
+ prev_frontier . clone_from ( & upper) ;
298
300
299
301
// Communicate `batch` to the arrangement and the stream.
300
302
writer. insert ( batch. clone ( ) , Some ( capability. time ( ) . clone ( ) ) ) ;
@@ -325,12 +327,12 @@ where
325
327
}
326
328
327
329
// Update our view of the input frontier.
328
- input_frontier . clear ( ) ;
329
- input_frontier . extend ( input. frontier ( ) . frontier ( ) . iter ( ) . cloned ( ) ) ;
330
+ prev_frontier . clear ( ) ;
331
+ prev_frontier . extend ( input. frontier ( ) . frontier ( ) . iter ( ) . cloned ( ) ) ;
330
332
331
333
// Downgrade capabilities for `reader_local`.
332
- reader_local. set_logical_compaction ( input_frontier . borrow ( ) ) ;
333
- reader_local. set_physical_compaction ( input_frontier . borrow ( ) ) ;
334
+ reader_local. set_logical_compaction ( prev_frontier . borrow ( ) ) ;
335
+ reader_local. set_physical_compaction ( prev_frontier . borrow ( ) ) ;
334
336
}
335
337
336
338
if let Some ( mut fuel) = effort. clone ( ) {
0 commit comments