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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to