luoyuxia commented on code in PR #143:
URL: https://github.com/apache/fluss-rust/pull/143#discussion_r2694866509


##########
crates/fluss/src/client/table/log_fetch_buffer.rs:
##########
@@ -360,22 +529,54 @@ impl CompletedFetch for DefaultCompletedFetch {
         &self.table_bucket
     }
 
+    fn api_error(&self) -> Option<&ApiError> {
+        None
+    }
+
+    fn take_error(&mut self) -> Option<Error> {
+        None
+    }
+
     fn fetch_records(&mut self, max_records: usize) -> Result<Vec<ScanRecord>> 
{
-        // todo: handle corrupt_last_record
+        if self.corrupt_last_record {
+            return Err(self.fetch_error());
+        }
+
         if self.consumed {
             return Ok(Vec::new());
         }
 
         let mut scan_records = Vec::new();
 
         for _ in 0..max_records {
-            if let Some(record) = self.next_fetched_record()? {
-                self.next_fetch_offset = record.offset() + 1;
-                self.records_read += 1;
-                scan_records.push(record);
-            } else {
-                break;
+            if self.cached_record_error.is_none() {

Review Comment:
   Thanks for take it into consideration.



-- 
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]

Reply via email to