mengw15 commented on code in PR #6971:
URL: https://github.com/apache/texera/pull/6971#discussion_r3671076054


##########
amber/src/main/python/core/runnables/main_loop.py:
##########
@@ -97,21 +99,40 @@ def __init__(
             target=self.data_processor.run, daemon=True, 
name="data_processor_thread"
         ).start()
 
-    def _jump_to_loop_start(
-        self, executor: LoopEndOperator, coordinator_interface
-    ) -> None:
-        # The write address is setup config, keyed by the captured id. Fail
-        # loud BEFORE the jump RPC so a misconfigured loop does not rewind the
-        # schedule without a back-edge write. Anything raised here (a missing
-        # URI, or a failed state write after the jump) is reported by
-        # complete()'s guard as an operator-facing error.
-        uri = self.context.loop_start_state_uris.get(self._loop_start_id)
+    def _loop_start_base_uri(self) -> str:
+        # The loop's bookkeeping base URI is setup config, keyed by the
+        # captured id (see InitializeExecutorRequest.loopStartPortUris). Fail
+        # loud on a missing entry: anything raised here is reported by the
+        # caller's guard as an operator-facing error.
+        uri = self.context.loop_start_port_uris.get(self._loop_start_id)
         if not uri:
             raise RuntimeError(
-                f"no loop-back state URI configured for LoopStart "
+                f"no loop bookkeeping URI configured for LoopStart "
                 f"'{self._loop_start_id}' "
-                f"(have: {sorted(self.context.loop_start_state_uris)})"
+                f"(have: {sorted(self.context.loop_start_port_uris)})"
             )
+        return uri
+
+    def _read_loop_input_table(self) -> Table:
+        # The loop's input table is the Loop Start's input-port
+        # materialization -- data that already exists for the whole loop
+        # (Loop Start re-reads it every iteration; the back-edge truncates
+        # only the state doc at the same base URI, never the result doc).
+        # Reading it here at consume time means the table never has to ride
+        # inside the State content through the loop body.
+        result_uri = VFSURIFactory.result_uri(self._loop_start_base_uri())
+        document, _ = DocumentFactory.open_document(result_uri)

Review Comment:
   `amber-integration` is red on both ubuntu and macos here: 
`LoopIntegrationSpec` never completes (job cancelled at 20m), with `Access 
Denied` errors from the storage read path. The same suite is green on #6884 and 
on #6974 ~1.5h earlier with none of those, so it looks like it may be coming 
from this PR rather than environment noise.



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