Copilot commented on code in PR #12945:
URL: https://github.com/apache/cloudstack/pull/12945#discussion_r3026721321


##########
engine/schema/src/main/java/com/cloud/storage/dao/SnapshotDaoImpl.java:
##########
@@ -220,6 +221,7 @@ public Long countSnapshotsForAccount(long accountId) {
         SearchCriteria<Long> sc = CountSnapshotsByAccount.create();
         sc.setParameters("account", accountId);
         sc.setParameters("status", State.Error, State.Destroyed);
+        sc.setParameters("snapshotTypeNEQ", Snapshot.Type.GROUP.ordinal());
         return customSearch(sc, null).get(0);

Review Comment:
   Consider adding/adjusting a DAO test to cover the new counting semantics 
here (excluding Snapshot.Type.GROUP from countSnapshotsForAccount). This method 
is used during resource count recalculation, so a regression test that GROUP 
snapshots are not counted (while non-GROUP snapshots are) would help prevent 
future discrepancies.



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