morningman commented on code in PR #70827:
URL: https://github.com/apache/doris/pull/70827#discussion_r4651267400


##########
fe/fe-connector/fe-connector-lance/src/main/java/org/apache/doris/connector/lance/LanceCatalogClient.java:
##########
@@ -127,6 +130,19 @@ LanceTableMetadata loadTableMetadata(String dbName, String 
tableName, OptionalLo
         });
     }
 
+    /**
+     * Reads the field ids and the user indexes of one table at the fixed 
{@code version}, for planning ranges
+     * over index segments.
+     */
+    LanceIndexMetadata loadIndexMetadata(String dbName, String tableName, long 
version) {

Review Comment:
   The sequence is right (the deferred release runs on the in-flight thread 
after its TCCL is restored, outside the reclaimer's pin), but it cannot fail, 
so I'm leaving it as is.
   
   1. Not new here: `call()` has restored the TCCL before `leave()` since 
#70681 (master `LanceCatalogClient.java:252-253`); every metadata call on 
master takes this path.
   2. Nothing on the release path reads the TCCL. The JVM resolves a class 
through the defining loader of the class referring to it; the TCCL only affects 
code that asks for it. The path is `DirectoryNamespace`/`RestNamespace.close()` 
(lance-core 12.0.0: `if (handle != 0) releaseNative(handle)`) and 
`RootAllocator.close()` -> `BaseAllocator.close()` (collections, its static 
SLF4J logger, `Accountant`, `HistoricalLog`). JNI `FindClass` in 
`releaseNative` uses the loader of the class declaring the native method (the 
plugin's); liblance_jni has no `ClassLoader` reference. In lance-core, 
lance-namespace-*, Arrow memory/c-data/vector 19.0.0 and jar-jni, the only TCCL 
reader is a shaded Guava `Resources` no Lance class uses, and the only 
`ServiceLoader` user is Arrow's IPC `CompressionCodec.Factory`; neither is on 
this path.
   
   So releasing under the FE loader behaves like the reclaimer's pinned close; 
a race test would only assert a TCCL value nothing reads.
   



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