github-actions[bot] commented on code in PR #62453:
URL: https://github.com/apache/doris/pull/62453#discussion_r3085864007


##########
fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java:
##########
@@ -432,6 +435,10 @@ private void addScanRangeLocations(Partition partition,
         // assign a snapshot version of all partitions.

Review Comment:
   This offset override only runs in the non-cloud path. When 
`Config.isCloudMode() && Config.enable_cloud_snapshot_version`, 
`updateScanRangeVersions()` later installs the latest partition visible version 
for each tablet and ignores `streamUpdate`, so cloud stream scans read the 
base-table snapshot rather than the stream's committed offset. If table streams 
are not supported in that mode yet, this path should fail explicitly instead of 
silently returning incorrect results.



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/stream/OlapTableStream.java:
##########
@@ -154,4 +163,56 @@ void fillTableStreamConsumptionInfo(List<TRow> dataBatch) {
             }
         }
     }
+
+    public boolean hasData(Partition partition) {
+        // if all available visible data has been consumed, return false
+        // todo(TsukiokaKogane): change offset from partition version to 
commit tso
+        return !partitionOffset.containsKey(partition.getId())
+                || 
!partitionOffset.get(partition.getId()).equals(partition.getVisibleVersion())
+                || historicalPartitionOffset.containsKey(partition.getId());
+    }
+
+    public OlapTableStreamUpdate getStreamUpdate(List<Long> 
selectedPartitionIds) {
+        if (selectedPartitionIds.isEmpty()) {
+            return null;

Review Comment:
   `next` is later used by `OlapScanNode` as the scan visible version. For a 
non-historical stream, `partitionOffset` is the last consumed version, so after 
the base partition advances from v2 to v3 this still sets the read snapshot to 
v2. The query re-reads the old snapshot instead of the new data, and 
`unprotectedUpdateStreamUpdate()` writes the same value back, so the offset 
never advances. A default stream (`show_initial_rows = false`) gets stuck on 
its creation snapshot.



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