Skip to content

Commit eb09eed

Browse files
committed
fix write down empty commits
1 parent bfa35d9 commit eb09eed

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/storage/src/render/persist_sink.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,14 +1085,16 @@ where
10851085
.cloned()
10861086
.collect::<Vec<_>>();
10871087

1088-
trace!(
1088+
info!(
10891089
"persist_sink {collection_id}/{shard_id}: \
1090-
append_batches: in_flight: {:?}, \
1091-
done: {:?}, \
1090+
append_batches: in_flight_descriptions size: {:?}, \
1091+
in_flight_batches size: {:?}, \
1092+
done size: {:?}, \
10921093
batch_frontier: {:?}, \
10931094
batch_description_frontier: {:?}",
1094-
in_flight_descriptions,
1095-
done_batches,
1095+
in_flight_descriptions.len(),
1096+
in_flight_batches.len(),
1097+
done_batches.len(),
10961098
batches_frontier,
10971099
batch_description_frontier
10981100
);
@@ -1112,6 +1114,7 @@ where
11121114
let mut done_batches_iter = done_batches.iter();
11131115

11141116
let Some(first_batch_description) = done_batches_iter.next() else {
1117+
upper_cap_set.downgrade(current_upper.borrow().iter());
11151118
continue;
11161119
};
11171120

@@ -1135,7 +1138,7 @@ where
11351138

11361139
let mut to_append = batches.iter_mut().map(|b| &mut b.batch).collect::<Vec<_>>();
11371140

1138-
while to_append.len() > 0 {
1141+
loop {
11391142
let result = {
11401143
let maybe_err = if *read_only_rx.borrow() {
11411144

@@ -1283,6 +1286,7 @@ where
12831286
to_append.clear();
12841287
current_upper.borrow_mut().clone_from(&batch_upper);
12851288
upper_cap_set.downgrade(current_upper.borrow().iter());
1289+
break;
12861290
}
12871291
Err(mismatch) => {
12881292
// We tried to do a non-contiguous append, that won't work.
@@ -1324,15 +1328,17 @@ where
13241328
batch_lower = mismatch.current.clone();
13251329
to_append = batches.iter_mut()
13261330
.sorted_by(|l, r| Ord::cmp(&l.data_ts, &r.data_ts))
1327-
.map(|batch| &mut batch.batch).collect::<Vec<_>>();
1331+
.map(|batch| &mut batch.batch)
1332+
.collect::<Vec<_>>();
13281333

13291334
// Best-effort attempt to delete unneeded batches.
13301335
future::join_all(batch_delete_futures).await;
13311336
continue;
13321337
} else {
13331338
// Best-effort attempt to delete unneeded batches.
13341339
future::join_all(batches.into_iter().map(|b| b.batch.delete())).await;
1335-
current_upper.replace(mismatch.current.clone());
1340+
current_upper.borrow_mut().clone_from(&mismatch.current);
1341+
upper_cap_set.downgrade(current_upper.borrow().iter());
13361342
}
13371343

13381344
if bail_on_concurrent_modification {

0 commit comments

Comments
 (0)