JingsongLi commented on code in PR #8930:
URL: https://github.com/apache/paimon/pull/8930#discussion_r3709217235


##########
paimon-python/pypaimon/table/source/vector_search_read.py:
##########
@@ -41,6 +41,7 @@ class VectorSearchRead(ABC):
 
     def read_plan(self, plan):
         # type: (VectorSearchScanPlan) -> GlobalIndexResult
+        self._plan_snapshot = plan.snapshot()

Review Comment:
   Storing the plan snapshot on the reader makes the result depend on previous 
calls. `read()` remains public and does not clear `_plan_snapshot`, so reusing 
a reader after `read_plan(plan_at_S1)` and then calling 
`read(splits_planned_at_S2)` makes the S2 live-row, scalar-index, and 
raw-fallback paths read from S1. The mutable field is also unsafe for 
concurrent reads, and the batch path has the same issue. After DV 
materialization this can return deleted rows or omit valid top-K results. Could 
we keep the reader stateless and pass the snapshot explicitly for each 
invocation (for example, `_read(splits, snapshot)`, with `read_plan` forwarding 
`plan.snapshot()`), instead of caching it on `self`?



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

Reply via email to