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


##########
cloud/src/meta-service/meta_service.cpp:
##########
@@ -3799,6 +3799,112 @@ struct UpdateDeleteBitmapTxnStats {
     size_t total_txn_count = 0;
 };
 
+static bool check_delete_bitmap_point_delete(MetaServiceCode& code, 
std::string& msg,
+                                             std::unique_ptr<Transaction>& txn,
+                                             const std::string& key,
+                                             const UpdateDeleteBitmapRequest* 
request,
+                                             size_t request_index, bool& 
point_delete,
+                                             bool& delete_bitmap_exists,
+                                             std::optional<uint16_t>& 
max_blob_sequence) {
+    point_delete = 
request->enable_remove_agg_pre_rowsets_delete_bitmap_by_keys() &&
+                   request->lock_id() == 
COMPACTION_WITHOUT_LOCK_DELETE_BITMAP_LOCK_ID;

Review Comment:
   `_write_delete_bitmap_kvs` is also used for the `delete_bitmap_keys_v2` 
loop, but this check indexes `rowset_ids()`, `versions()`, and `segment_ids()` 
using that loop's `request_index`. A -3 request with point-delete enabled and 
v2 entries can therefore read past the v1 arrays (especially when it has no v1 
entries) and crash or validate against the wrong key. Restrict this path to v1 
entries or validate/use the key being written before indexing these arrays.
   
   This issue also appears in the following locations of the same file:
   - line 4050
   - line 4174
   - line 4175



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