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

dbecker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 4366941cf881db3dd9e66bc21280c3de633c9cdd
Author: Saurabh Katiyal <[email protected]>
AuthorDate: Mon Oct 21 13:58:15 2024 +0530

    IMPALA-13148: Show the number of in-progress Catalog operations
    
    Added counter for In-progress Catalog Operations in /operations page
    
    Change-Id: Ie579560f88a9693d53b93122c1bba7952eeb46b1
    Reviewed-on: http://gerrit.cloudera.org:8080/21957
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 be/src/catalog/catalog-server.cc       | 2 ++
 tests/custom_cluster/test_web_pages.py | 9 ++++++---
 www/catalog_operations.tmpl            | 2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/be/src/catalog/catalog-server.cc b/be/src/catalog/catalog-server.cc
index d9d8cd0e6..c06575894 100644
--- a/be/src/catalog/catalog-server.cc
+++ b/be/src/catalog/catalog-server.cc
@@ -1221,6 +1221,8 @@ void CatalogServer::GetCatalogOpRecords(const 
TGetOperationUsageResponse& respon
       document);
   document->AddMember("inflight_catalog_operations", inflight_catalog_ops,
       document->GetAllocator());
+  document->AddMember("num_inflight_catalog_ops",
+      response.in_flight_catalog_operations.size(), document->GetAllocator());
   Value finished_catalog_ops(kArrayType);
   CatalogOpListToJson(response.finished_catalog_operations, 
&finished_catalog_ops,
       document);
diff --git a/tests/custom_cluster/test_web_pages.py 
b/tests/custom_cluster/test_web_pages.py
index c53bfbe09..00e6a04d9 100644
--- a/tests/custom_cluster/test_web_pages.py
+++ b/tests/custom_cluster/test_web_pages.py
@@ -297,7 +297,8 @@ class TestWebPage(CustomClusterTestSuite):
     assert response.status_code == requests.codes.ok
     operations = json.loads(response.text)
     assert "inflight_catalog_operations" in operations
-    return operations["inflight_catalog_operations"]
+    assert "num_inflight_catalog_ops" in operations
+    return operations
 
   @staticmethod
   def _get_finished_catalog_operations():
@@ -377,7 +378,9 @@ class TestWebPage(CustomClusterTestSuite):
       assert "RPC recv timed out" in str(e)
     # In impalad side, the query fails by the above error. However, in 
catalogd side,
     # the RPCs are still running. Check the in-flight operations.
-    inflight_operations = self._get_inflight_catalog_operations()
+    operations = self._get_inflight_catalog_operations()
+    assert operations["num_inflight_catalog_ops"] == 2
+    inflight_operations = operations["inflight_catalog_operations"]
     assert len(inflight_operations) == 2
     for op in inflight_operations:
       assert op["status"] == "STARTED"
@@ -387,7 +390,7 @@ class TestWebPage(CustomClusterTestSuite):
     assert inflight_operations[0]["thread_id"] != 
inflight_operations[1]["thread_id"]
 
     # Wait until the catalog operations finish
-    while len(self._get_inflight_catalog_operations()) != 0:
+    while self._get_inflight_catalog_operations()["num_inflight_catalog_ops"] 
!= 0:
       time.sleep(1)
 
     # Verify both RPC attempts are shown as finished operations.
diff --git a/www/catalog_operations.tmpl b/www/catalog_operations.tmpl
index c00b1bc14..0198dd4c4 100644
--- a/www/catalog_operations.tmpl
+++ b/www/catalog_operations.tmpl
@@ -83,7 +83,7 @@ under the License.
 <div class="card">
   <div class="card-header">
       <h5 class="card-title">
-      In-progress Catalog Operations
+      {{num_inflight_catalog_ops}} In-progress Catalog Operations
       </h5>
   </div>
   <div class="card-body">

Reply via email to