Damans227 commented on code in PR #14310:
URL: https://github.com/apache/cloudstack/pull/14310#discussion_r4194673736


##########
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java:
##########
@@ -2055,12 +2064,20 @@ private void updateBackupUsageRecords(final 
BackupProvider backupProvider, DataC
                     Pair<Long, Long> sizes = entry.getValue();
                     Long backupSize = sizes.first();
                     Long protectedSize = sizes.second();
+                    Pair<Long, Long> key = new Pair<>(vm.getId(), offeringId);
+                    Pair<Long, Long> metric = new Pair<>(backupSize, 
protectedSize);
+                    published.put(key, metric);
+                    if (metric.equals(lastPublished.get(key))) {

Review Comment:
   the new table and the lock cover it, thanks



##########
engine/schema/src/main/resources/META-INF/db/schema-42210to42220.sql:
##########
@@ -18,3 +18,15 @@
 --;
 -- Schema upgrade from 4.22.1.0 to 4.22.2.0
 --;
+
+-- Last backup usage metric published per VM and backup offering
+CREATE TABLE IF NOT EXISTS `cloud`.`backup_usage_metric` (

Review Comment:
   can we hook the 4.22.2 upgrade step into the upgrade checker here? right now 
this table never gets made and the backup smoke test fails deleting a backup



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

Reply via email to