csun5285 commented on code in PR #66338:
URL: https://github.com/apache/doris/pull/66338#discussion_r3818473290


##########
be/src/storage/rowset/rowset_meta.h:
##########
@@ -303,11 +303,24 @@ class RowsetMeta : public MetadataAdder<RowsetMeta> {
     //
     // Returns true if all of the following conditions are met
     // 1. the rowset contains more than one segment
-    // 2. the rowset's start version == end version (non-singleton rowset was 
generated by compaction process
-    //    which always produces non-overlapped segments)
-    // 3. segments_overlap() flag is not NONOVERLAPPING (OVERLAP_UNKNOWN and 
OVERLAPPING are OK)
+    // 2. segments_overlap() flag is not NONOVERLAPPING
+    // 3. either the rowset is a singleton delta (a freshly ingested delta 
whose
+    //    segments may overlap and are only tagged OVERLAP_UNKNOWN), or the 
flag is
+    //    explicitly OVERLAPPING.
+    //
+    // The is_singleton_delta() guard must be kept for the OVERLAP_UNKNOWN 
case: a
+    // non-singleton rowset (start_version < end_version, i.e. produced by 
compaction)
+    // whose segments are already ordered/non-overlapping was historically 
written with
+    // OVERLAP_UNKNOWN (older versions did not set the flag). Treating those as
+    // overlapping would inflate get_compaction_score()/get_merge_way_num() to 
the
+    // segment count and degrade the ordered read from a linear union to a 
multi-way
+    // merge heap after an upgrade or restore of old data. Row-binlog LMax 
quick merge
+    // does produce non-singleton overlapping segments, but it writes 
segments_overlap
+    // = OVERLAPPING explicitly (see Compaction::do_compact_ordered_rowsets), 
so it is
+    // covered by the explicit-OVERLAPPING branch without relaxing 
OVERLAP_UNKNOWN.
     bool is_segments_overlapping() const {
-        return num_segments() > 1 && is_singleton_delta() && 
segments_overlap() != NONOVERLAPPING;
+        return num_segments() > 1 && segments_overlap() != NONOVERLAPPING &&

Review Comment:
   这里不要放宽原来的语义,只放宽  row-binlog rowset 即可,` (is_singleton_delta() || 
(is_row_binlog() && segments_overlap() == OVERLAPPING))`



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