dr-auto-sync: judge whether `RocksWriteBatchVec` is empty
close tikv/tikv#13194
@@ -134,8 +134,10 @@ impl ResetToVersionWorker {
box_try!(wb.delete_cf(CF_WRITE, &key));
box_try!(wb.delete_cf(CF_DEFAULT, default_key.as_encoded()));
}
+ if !wb.is_empty() {
wb.write().unwrap();
wb.clear();
+ }
Ok(has_more)
}
@@ -165,7 +167,10 @@ impl ResetToVersionWorker {
break;
}
}
+ if !wb.is_empty() {
wb.write().unwrap();
+ wb.clear();
+ }
Ok(has_more)
}
}
