You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to a bug in UsageBackupDaoImpl.removeUsage, entry in the cloud_usage.backup_usage doesn't get removed even after all the backups have been deleted and backup offering removed.
Backup usage doesn't get updated to 0 size when all backups are deleted.
Types of changes
Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change which adds functionality)
Bug fix (non-breaking change which fixes an issue)
Enhancement (improves an existing feature and functionality)
Cleanup (Code refactoring and cleanup, that may add test cases)
build/CI
test (unit or integration test code)
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Major
Minor
Bug Severity
BLOCKER
Critical
Major
Minor
Trivial
Screenshots (if appropriate):
How Has This Been Tested?
Before Fix:
10:03:37.297 [Usage-Job-1] ERROR com.cloud.usage.dao.UsageBackupDaoImpl_EnhancerByCloudStack_c6b7eb21 - Exception caught while removing UsageBackupVO: Remove backup usage exception: No value specified for parameter 4
com.cloud.exception.CloudException: Remove backup usage exception: No value specified for parameter 4
at com.cloud.usage.dao.UsageBackupDaoImpl.removeUsage(UsageBackupDaoImpl.java:76) ~[cloud-engine-schema-4.21.0.0-SNAPSHOT.jar:4.21.0.0-SNAPSHOT]
at com.cloud.usage.dao.UsageBackupDaoImpl_EnhancerByCloudStack_c6b7eb21.CGLIB$removeUsage$0(<generated>) ~[cloud-engine-schema-4.21.0.0-SNAPSHOT.jar:4.21.0.0-SNAPSHOT]
at com.cloud.usage.dao.UsageBackupDaoImpl_EnhancerByCloudStack_c6b7eb21_FastClassByCloudStack_515fb514.invoke(<generated>) ~[cloud-engine-schema-4.21.0.0-SNAPSHOT.jar:4.21.0.0-SNAPSHOT]
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[cglib-nodep-3.3.0.jar:?]
at com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:123) ~[cloud-utils-4.21.0.0-SNAPSHOT.jar:4.21.0.0-SNAPSHOT]
at com.cloud.usage.dao.UsageBackupDaoImpl_EnhancerByCloudStack_c6b7eb21.removeUsage(<generated>) ~[cloud-engine-schema-4.21.0.0-SNAPSHOT.jar:4.21.0.0-SNAPSHOT]
at com.cloud.usage.UsageManagerImpl.createBackupEvent(UsageManagerImpl.java:2077) ~[classes/:?]
at com.cloud.usage.UsageManagerImpl.createHelperRecord(UsageManagerImpl.java:986) ~[classes/:?]
at com.cloud.usage.UsageManagerImpl.parse(UsageManagerImpl.java:716) ~[classes/:?]
at com.cloud.usage.UsageManagerImpl.runInContextInternal(UsageManagerImpl.java:432) ~[classes/:?]
at com.cloud.usage.UsageManagerImpl$1.runInContext(UsageManagerImpl.java:369) ~[classes/:?]
at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49) ~[cloud-framework-managed-context-4.21.0.0-SNAPSHOT.jar:4.21.0.0-SNAPSHOT]
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56) ~[cloud-framework-managed-context-4.21.0.0-SNAPSHOT.jar:4.21.0.0-SNAPSHOT]
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103) ~[cloud-framework-managed-context-4.21.0.0-SNAPSHOT.jar:4.21.0.0-SNAPSHOT]
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53) ~[cloud-framework-managed-context-4.21.0.0-SNAPSHOT.jar:4.21.0.0-SNAPSHOT]
at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46) ~[cloud-framework-managed-context-4.21.0.0-SNAPSHOT.jar:4.21.0.0-SNAPSHOT]
at com.cloud.usage.UsageManagerImpl.run(UsageManagerImpl.java:371) ~[classes/:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
at java.lang.Thread.run(Thread.java:829) ~[?:?]
Caused by: java.sql.SQLException: No value specified for parameter 4
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:130) ~[mysql-connector-j-8.0.33.jar:8.0.33]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-j-8.0.33.jar:8.0.33]
at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:555) ~[mysql-connector-j-8.0.33.jar:8.0.33]
at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:339) ~[mysql-connector-j-8.0.33.jar:8.0.33]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1061) ~[mysql-connector-j-8.0.33.jar:8.0.33]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1009) ~[mysql-connector-j-8.0.33.jar:8.0.33]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1320) ~[mysql-connector-j-8.0.33.jar:8.0.33]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:994) ~[mysql-connector-j-8.0.33.jar:8.0.33]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[HikariCP-5.1.0.jar:?]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HikariCP-5.1.0.jar:?]
at com.cloud.usage.dao.UsageBackupDaoImpl.removeUsage(UsageBackupDaoImpl.java:72) ~[cloud-engine-schema-4.21.0.0-SNAPSHOT.jar:4.21.0.0-SNAPSHOT]
After Fix:
Created two backups for a vm (id=8) with a backup_offering (id=1)
(Ignore usage_backup id 20 as it from a previous testing)
2. Deleted one backup
3. Deleted another backup
4. Removed backup offering
How did you try to break this feature and the system with this change?
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.42%. Comparing base (ec533cd) to head (0a9b232). ⚠️ Report is 14 commits behind head on main.
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
cloud_usage.backup_usagedoesn't get removed even after all the backups have been deleted and backup offering removed.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Before Fix:
After Fix:
(Ignore usage_backup id 20 as it from a previous testing)
How did you try to break this feature and the system with this change?