You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by al...@apache.org on 2024/05/22 13:15:46 UTC

(asterixdb) branch master updated: [NO ISSUE][OTH] Increase number of archived requests

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

alsuliman 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 b16c450238 [NO ISSUE][OTH] Increase number of archived requests
b16c450238 is described below

commit b16c4502388d6adf31b040751f56a183ad3778d8
Author: Ali Alsuliman <al...@gmail.com>
AuthorDate: Wed May 22 01:48:57 2024 +0300

    [NO ISSUE][OTH] Increase number of archived requests
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    Increase the number of tracked archived requests to 1000.
    Set max statement length (and plan) to 64KB.
    
    Change-Id: I884656d3a6a323fdb787887bedb3bcc501eb94f1
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18302
    Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Reviewed-by: Ali Alsuliman <al...@gmail.com>
    Reviewed-by: Murtadha Hubail <mh...@apache.org>
---
 .../main/java/org/apache/asterix/translator/ClientRequest.java | 10 ++++++++--
 .../misc/completed_requests/completed_requests.3.plans.sqlpp   |  2 ++
 .../org/apache/asterix/common/config/ExternalProperties.java   |  2 +-
 .../apache/hyracks/dataflow/std/sort/AbstractFrameSorter.java  |  5 +++--
 4 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/ClientRequest.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/ClientRequest.java
index 31f197968d..bd6281402f 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/ClientRequest.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/ClientRequest.java
@@ -34,11 +34,14 @@ import org.apache.hyracks.api.job.resource.IJobCapacityController;
 import org.apache.hyracks.api.job.resource.IReadOnlyClusterCapacity;
 import org.apache.hyracks.api.util.ExceptionUtils;
 import org.apache.hyracks.util.LogRedactionUtil;
+import org.apache.hyracks.util.StorageUtil;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
 public class ClientRequest extends BaseClientRequest {
 
+    protected static final int MAX_STATEMENT_LENGTH =
+            StorageUtil.getIntSizeInBytes(64, StorageUtil.StorageUnit.KILOBYTE);
     protected final long creationTime = System.nanoTime();
     protected final Thread executor;
     protected final String statement;
@@ -50,7 +53,8 @@ public class ClientRequest extends BaseClientRequest {
     public ClientRequest(ICommonRequestParameters requestParameters) {
         super(requestParameters.getRequestReference());
         this.clientContextId = requestParameters.getClientContextId();
-        this.statement = requestParameters.getStatement();
+        String stmt = requestParameters.getStatement();
+        this.statement = stmt.length() > MAX_STATEMENT_LENGTH ? stmt.substring(0, MAX_STATEMENT_LENGTH) : stmt;
         this.executor = Thread.currentThread();
         this.jobState = new JobState();
     }
@@ -61,7 +65,9 @@ public class ClientRequest extends BaseClientRequest {
     }
 
     public void setPlan(String plan) {
-        this.plan = plan;
+        if (plan != null) {
+            this.plan = plan.length() > MAX_STATEMENT_LENGTH ? plan.substring(0, MAX_STATEMENT_LENGTH) : plan;
+        }
     }
 
     public synchronized void setJobId(JobId jobId) {
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/completed_requests/completed_requests.3.plans.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/completed_requests/completed_requests.3.plans.sqlpp
index 0e75d226d1..cf0c86c891 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/completed_requests/completed_requests.3.plans.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/misc/completed_requests/completed_requests.3.plans.sqlpp
@@ -25,6 +25,8 @@
 -- param job:string=true
 
 SET `compiler.parallelism` "1";
+// this of course defeats the purpose of the test. however, the currently min assigned memory is too low for a request
+SET `compiler.min.memory.allocation` "false";
 
 from completed_requests() t
 select value t
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/ExternalProperties.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/ExternalProperties.java
index 515aad65d0..8aa4532ca3 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/ExternalProperties.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/ExternalProperties.java
@@ -50,7 +50,7 @@ public class ExternalProperties extends AbstractProperties {
                 POSITIVE_INTEGER_BYTE_UNIT,
                 StorageUtil.getIntSizeInBytes(200, StorageUtil.StorageUnit.MEGABYTE),
                 "The maximum accepted web request size in bytes"),
-        REQUESTS_ARCHIVE_SIZE(NONNEGATIVE_INTEGER, 50, "The maximum number of archived requests to maintain"),
+        REQUESTS_ARCHIVE_SIZE(NONNEGATIVE_INTEGER, 1000, "The maximum number of archived requests to maintain"),
         LIBRARY_DEPLOY_TIMEOUT(POSITIVE_INTEGER, 1800, "Timeout to upload a UDF in seconds"),
         AZURE_REQUEST_TIMEOUT(POSITIVE_INTEGER, 120, "Timeout for Azure client requests in seconds");
 
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/sort/AbstractFrameSorter.java b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/sort/AbstractFrameSorter.java
index b121fbb992..20924d5544 100644
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/sort/AbstractFrameSorter.java
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/sort/AbstractFrameSorter.java
@@ -150,8 +150,9 @@ public abstract class AbstractFrameSorter implements IFrameSorter {
             return true;
         }
         if (getFrameCount() == 0) {
-            throw new HyracksDataException(
-                    "The input frame is too big for the sorting buffer, please allocate bigger buffer size");
+            throw new HyracksDataException("The required memory=" + requiredMemory + " for the frame data="
+                    + inputTupleAccessor.getBuffer().capacity() + " is too big for the sorting buffer. Used="
+                    + totalMemoryUsed + ", max=" + maxSortMemory + ", please allocate bigger buffer size");
         }
         return false;
     }