You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by ht...@apache.org on 2026/07/23 06:24:01 UTC

(asterixdb) branch master updated: [ASTERIXDB-3793][EXT] Consume Library digest once

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new ca8bc8266c [ASTERIXDB-3793][EXT] Consume Library digest once
ca8bc8266c is described below

commit ca8bc8266c9496aa498cef4b68771c2b1c4d1418
Author: Ian Maxon <im...@apache.org>
AuthorDate: Mon Jul 20 11:20:13 2026 -0700

    [ASTERIXDB-3793][EXT] Consume Library digest once
    
    When writing to cloud storage, the library digest was being consumed
    twice. The first call was to the descriptor, so that ended up containing
    the correct hash of the library. The second, to Metadata, was then
    calling it on an empty digest.
    
    Change-Id: Id676af0729fe5f61d69a9c5fb46d0323f625def8
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21449
    Reviewed-by: Ian Maxon <im...@apache.org>
    Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Reviewed-by: Hussain Towaileb <hu...@gmail.com>
---
 .../org/apache/asterix/api/http/server/NCUdfDSApiServlet.java  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCUdfDSApiServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCUdfDSApiServlet.java
index d5311cedde..9381cb9fee 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCUdfDSApiServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCUdfDSApiServlet.java
@@ -50,6 +50,8 @@ import io.netty.buffer.ByteBufInputStream;
 
 public class NCUdfDSApiServlet extends AbstractNCUdfServlet {
 
+    private String digestString;
+
     public NCUdfDSApiServlet(ConcurrentMap<String, Object> ctx, String[] paths, IApplicationContext appCtx) {
         super(ctx, paths, appCtx);
     }
@@ -58,8 +60,7 @@ public class NCUdfDSApiServlet extends AbstractNCUdfServlet {
             ExternalFunctionLanguage language, MessageDigest digest, Namespace namespace,
             IRequestReference requestReference, IServletRequest request) throws Exception {
         writeLibToCloud(uploadData, namespace, libName, digest, language);
-        doCreate(namespace, libName, language, ExternalLibraryUtils.digestToHexString(digest), null, true,
-                getSysAuthHeader(), requestReference, request);
+        doCreate(namespace, libName, language, digestString, null, true, getSysAuthHeader(), requestReference, request);
     }
 
     private void writeLibToCloud(LibraryUploadData uploadData, Namespace libNamespace, String libName,
@@ -83,8 +84,9 @@ public class NCUdfDSApiServlet extends AbstractNCUdfServlet {
             IOUtils.copyLarge(ui, outputStream, writeBuf);
             outputStream.flush();
             cloudIoMgr.sync(fh, true);
-            writeDescriptor(libraryManager, targetDescFile,
-                    new LibraryDescriptor(language, ExternalLibraryUtils.digestToHexString(digest)), true, writeBuf);
+            digestString = ExternalLibraryUtils.digestToHexString(digest);
+            writeDescriptor(libraryManager, targetDescFile, new LibraryDescriptor(language, digestString), true,
+                    writeBuf);
         } finally {
             cloudIoMgr.close(fh);
         }