zhaohaidao commented on code in PR #143:
URL: https://github.com/apache/fluss-rust/pull/143#discussion_r2687292489
##########
crates/fluss/src/client/table/scanner.rs:
##########
@@ -803,7 +1013,19 @@ impl LogFetcher {
// Fetch records from next_in_line
if let Some(mut next_fetch) = next_in_line {
let records =
- self.fetch_records_from_fetch(&mut next_fetch,
records_remaining)?;
+ match self.fetch_records_from_fetch(&mut next_fetch,
records_remaining) {
+ Ok(records) => records,
+ Err(e) => {
+ if result.is_empty() {
+ return Err(e);
+ }
+ if !next_fetch.is_consumed() {
Review Comment:
Currently, when Rust returns an Err in fetch_records_from_fetch, if
next_fetch has not been consumed, it will put next_in_line_fetch back so that
it can continue next time. The version you provided uses ? to directly return
an Err, which does not backfetch and may result in the loss of unconsumed
fetches.
I changed it to match here. When Err is called, if next_fetch has not been
consumed, it is first put back into next_in_line_fetch before returning Err(e).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]