You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "jerry-024 (via GitHub)" <gi...@apache.org> on 2026/08/13 07:05:30 UTC

[PR] feat(vindex): stream data split index builds [paimon-rust]

jerry-024 opened a new pull request, #707:
URL: https://github.com/apache/paimon-rust/pull/707

   <!--
   Thank you very much for contributing to Paimon Rust - we are happy that you want to help us improve it. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GitHub issue](https://github.com/apache/paimon-rust/issues). Exceptions are made for typos in documentation or comments, which need no issue.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
   
     - Make sure that the change passes the automated tests, i.e., `cargo test` passes.
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
   
   **(The sections below can be removed for hotfixes or typos)**
   -->
   
   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   Linked issue: close #xxx
   
   <!-- What is the purpose of the change -->
   
   ### Brief change log
   
   <!-- Please describe the changes made in this pull request and explain how they address the issue -->
   
   ### Tests
   
   <!-- List unit tests or integration cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature or require documentation updates -->
   


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(vindex): build indexes from streamed data splits [paimon-rust]

Posted by "jerry-024 (via GitHub)" <gi...@apache.org>.
jerry-024 commented on code in PR #707:
URL: https://github.com/apache/paimon-rust/pull/707#discussion_r3774194053


##########
crates/paimon/src/table/vindex_index_build_builder.rs:
##########
@@ -245,13 +431,38 @@ impl<'a> VindexIndexBuildBuilder<'a> {
             self.table.location().trim_end_matches('/'),
             file_name
         );
-        self.table
-            .file_io()
-            .new_output(&index_path)?
-            .write(Bytes::from(bytes))
-            .await?;
-
-        let status = self.table.file_io().get_status(&index_path).await?;
+        let write_result = async {
+            let async_writer = self
+                .table
+                .file_io()
+                .new_output(&index_path)?
+                .async_writer()
+                .await?;
+            let mut output = SyncIoBridge::new(async_writer);
+            tokio::task::spawn_blocking(move || -> std::io::Result<()> {
+                let mut writer = writer;
+                writer.write(&mut PosWriter::new(&mut output))?;
+                output.shutdown()

Review Comment:
   Good catch. I think this should be handled by orphan-file cleanup rather than adding cancellation-specific ownership logic to the index builder. A guard here would still not cover equivalent leaks caused by process/runtime shutdown, while orphan cleanup can consistently remove any unreferenced index files after the retention window. I will address the gap in the orphan cleanup path instead.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(vindex): build indexes from streamed data splits [paimon-rust]

Posted by "jerry-024 (via GitHub)" <gi...@apache.org>.
jerry-024 merged PR #707:
URL: https://github.com/apache/paimon-rust/pull/707


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(vindex): build indexes from streamed data splits [paimon-rust]

Posted by "shyjsarah (via GitHub)" <gi...@apache.org>.
shyjsarah commented on code in PR #707:
URL: https://github.com/apache/paimon-rust/pull/707#discussion_r3773971831


##########
crates/paimon/src/table/vindex_index_build_builder.rs:
##########
@@ -245,13 +431,38 @@ impl<'a> VindexIndexBuildBuilder<'a> {
             self.table.location().trim_end_matches('/'),
             file_name
         );
-        self.table
-            .file_io()
-            .new_output(&index_path)?
-            .write(Bytes::from(bytes))
-            .await?;
-
-        let status = self.table.file_io().get_status(&index_path).await?;
+        let write_result = async {
+            let async_writer = self
+                .table
+                .file_io()
+                .new_output(&index_path)?
+                .async_writer()
+                .await?;
+            let mut output = SyncIoBridge::new(async_writer);
+            tokio::task::spawn_blocking(move || -> std::io::Result<()> {
+                let mut writer = writer;
+                writer.write(&mut PosWriter::new(&mut output))?;
+                output.shutdown()

Review Comment:
   **Suggestion:** Since a running `spawn_blocking` task cannot be aborted, cancelling the outer build future may still allow this worker to finish `output.shutdown()` after the surrounding cleanup path has been dropped. The resulting index file would not be referenced by any commit message or manifest.
   
   If orphan index files are already covered by a separate cleanup mechanism, could we document or test that assumption here? Otherwise, it may be worth keeping a provisional output guard or another cleanup mechanism until the file is transferred into a `CommitMessage`.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org