From 8b4de87f72b07808fdcd609a2840d3f80f5f737c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernardo=20De=20Marco=20Gon=C3=A7alves?= Date: Wed, 11 Nov 2026 10:04:59 -0300 Subject: [PATCH] Recalculate the allocated size in bytes for each Object Storage provider --- .../main/resources/META-INF/db/schema-42300to2400.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql b/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql index 541caae23c11..670f0a7c83ef 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql @@ -271,3 +271,13 @@ CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.disk_offering', 'error_policy', 'VAR -- Rename persisted FlashArray provider name (plugin getName() changed from 'Flash Array' to 'FlashArray') UPDATE `cloud`.`storage_pool` SET `storage_provider_name` = 'FlashArray' WHERE `storage_provider_name` = 'Flash Array'; + +--- Recalculate the allocated size in bytes for each Object Storage provider +UPDATE `cloud`.`object_store` +JOIN ( + SELECT object_store_id, SUM(quota) * 1024 * 1024 * 1024 AS total_quota + FROM `cloud`.`bucket` + WHERE removed IS NULL + GROUP BY object_store_id +) buckets_quota_sum_view ON `object_store`.id = buckets_quota_sum_view.object_store_id +SET `object_store`.allocated_size = buckets_quota_sum_view.total_quota;