Copilot commented on code in PR #60919:
URL: https://github.com/apache/doris/pull/60919#discussion_r2867519981
##########
cloud/src/recycler/recycler.cpp:
##########
@@ -3365,6 +3365,18 @@ int InstanceRecycler::delete_rowset_data(
}
}
+ int64_t num_segments = rs.num_segments();
+ // Check num_segments before accessor lookup, because empty rowsets
+ // (e.g. base compaction output of empty rowsets) may have no
resource_id
+ // set. Skipping them early avoids a spurious "no such resource id"
error
+ // that marks the entire batch as failed and prevents txn_remove from
+ // cleaning up recycle KV keys.
+ if (num_segments <= 0) {
+ metrics_context.total_recycled_num++;
+ metrics_context.total_recycled_data_size += rs.total_disk_size();
+ continue;
+ }
Review Comment:
Add a unit test covering the regression scenario: a batch passed to
delete_rowset_data contains an empty rowset (num_segments==0, resource_id
empty) alongside normal rowsets, and the function should return success and
still delete data / allow the caller to clean up recycle KV keys for the rest
of the batch.
##########
cloud/src/recycler/recycler.cpp:
##########
@@ -3365,6 +3365,18 @@ int InstanceRecycler::delete_rowset_data(
}
}
+ int64_t num_segments = rs.num_segments();
+ // Check num_segments before accessor lookup, because empty rowsets
+ // (e.g. base compaction output of empty rowsets) may have no
resource_id
+ // set. Skipping them early avoids a spurious "no such resource id"
error
+ // that marks the entire batch as failed and prevents txn_remove from
+ // cleaning up recycle KV keys.
+ if (num_segments <= 0) {
+ metrics_context.total_recycled_num++;
+ metrics_context.total_recycled_data_size += rs.total_disk_size();
+ continue;
+ }
+
auto it = accessor_map_.find(rs.resource_id());
// possible if the accessor is not initilized correctly
Review Comment:
Fix spelling in the comment: "initilized" should be "initialized".
```suggestion
// possible if the accessor is not initialized correctly
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]