Copilot commented on code in PR #60208:
URL: https://github.com/apache/doris/pull/60208#discussion_r2724362723


##########
cloud/src/recycler/recycler.cpp:
##########
@@ -1077,6 +1077,59 @@ int 
InstanceRecycler::check_recycle_and_tmp_rowset_exists(int64_t tablet_id,
     return 0;
 }
 
+int InstanceRecycler::check_rowset_snapshot_ref(int64_t tablet_id, const 
std::string& rowset_id,
+                                                bool* has_snapshot_ref) {

Review Comment:
   Missing null pointer check for the `has_snapshot_ref` parameter. Other 
similar functions in this file like `check_rowset_exists` (line 964) and 
`check_recycle_and_tmp_rowset_exists` (line 1022) validate their output 
parameters before use. This function should follow the same pattern for 
consistency and defensive programming.
   ```suggestion
                                                   bool* has_snapshot_ref) {
       if (has_snapshot_ref == nullptr) {
           LOG_WARNING("has_snapshot_ref is null when checking rowset snapshot 
ref")
                   .tag("instance_id", instance_id_)
                   .tag("tablet_id", tablet_id)
                   .tag("rowset_id", rowset_id);
           return -1;
       }
   ```



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

Reply via email to