You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Sanjeev N (JIRA)" <ji...@apache.org> on 2013/06/17 11:23:20 UTC

[jira] [Commented] (CLOUDSTACK-3038) [Object_Store_Refactor] Deleting account fails when there are snapshots present on primary for this account

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-3038?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13685392#comment-13685392 ] 

Sanjeev N commented on CLOUDSTACK-3038:
---------------------------------------

mysql> select * from snapshots where account_id=7\G;
*************************** 1. row ***************************
              id: 1
  data_center_id: 1
      account_id: 7
       domain_id: 1
       volume_id: 5
disk_offering_id: 12
          status: CreatedOnPrimary
            path: NULL
            name: 7af94ea3-3041-4792-9ca4-2250fc076f3c_ROOT-5_20130614161522
            uuid: 54c80842-556f-4f5f-b02b-1a1efa4ba9e7
   snapshot_type: 0
type_description: MANUAL
            size: 21474836480
         created: 2013-06-14 16:15:22
         removed: NULL
  backup_snap_id: NULL
        swift_id: NULL
      sechost_id: NULL
    prev_snap_id: NULL
 hypervisor_type: XenServer
         version: 2.2
           s3_id: NULL
1 row in set (0.00 sec)

ERROR:
No query specified

mysql> select * from snapshot_store_ref where snapshot_id=1\G;
*************************** 1. row ***************************
                id: 1
          store_id: 1
       snapshot_id: 1
           created: 2013-06-14 16:15:22
      last_updated: NULL
            job_id: NULL
        store_role: Primary
              size: 0
     physical_size: 0
parent_snapshot_id: 0
      install_path: eb70bcb5-c966-4014-aa2b-3fcb51d73d39
             state: Ready
      update_count: 2
           updated: 2013-06-14 16:15:24
1 row in set (0.00 sec)

ERROR:
No query specified

mysql> select * from image_store;
+----+--------------------------------------------------+---------------------+----------+--------------------------------------------------+----------------+--------+------------+--------------------------------------+--------+---------------------+---------+------------+
| id | name                                             | image_provider_name | protocol | url                                              | data_center_id | scope  | role       | uuid                                 | parent | created             | removed | total_size |
+----+--------------------------------------------------+---------------------+----------+--------------------------------------------------+----------------+--------+------------+--------------------------------------+--------+---------------------+---------+------------+
|  1 | imagestore                                       | S3                  | http     | NULL                                             |           NULL | REGION | Image      | 9eb0800d-41ab-4338-a449-cd4624a7fe19 | NULL   | 2013-06-14 12:00:03 | NULL    |       NULL |
|  2 | nfs://10.147.28.7/export/home/sanjeev/sec_xen_os | NFS                 | nfs      | nfs://10.147.28.7/export/home/sanjeev/sec_xen_os |              1 | ZONE   | ImageCache | 1051ada9-d511-4d67-8dce-98455de01697 | NULL   | 2013-06-14 12:11:12 | NULL    |       NULL |
+----+--------------------------------------------------+---------------------+----------+--------------------------------------------------+----------------+--------+------------+--------------------------------------+--------+---------------------+---------+------------+
2 rows in set (0.00 sec)

mysql>

                
> [Object_Store_Refactor] Deleting account fails when there are snapshots present on primary for this account
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-3038
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3038
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Management Server
>    Affects Versions: 4.2.0
>         Environment: Latest build on object_store branch
>            Reporter: Sanjeev N
>            Priority: Critical
>             Fix For: 4.2.0
>
>
> Deleting account fails when there are snapshots present on primary for this account
> Steps to Reproduce:
> =================
> 1.Bring up CS in advanced zone with S3 as the secondary storage provider
> 2.Create a domain-admin account
> 3.With the domain-admin created at step2 deploy guest vms using the default cent os templates downloaded to S3 
> 3.Create Manual/Recurring snapshots on the root/data disk of the guest vms(Snapshot will be created on primary but backing up to secondary will fail which is a know issue)
> 4. Delete the domain-admin account
> Observations:
> ===========
> Account creation failed with DB Exceptions. Following is the log snippet from management server log:
> 2013-06-17 10:27:17,911 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-86:job-94) Executing org.apache.cloudstack.api.command.admin.account.DeleteAccountCmd for job-94
> 2013-06-17 10:27:17,981 DEBUG [cloud.user.AccountManagerImpl] (Job-Executor-86:job-94) Removed account 7
> 2013-06-17 10:27:17,998 DEBUG [agent.transport.Request] (Job-Executor-86:job-94) Seq 4-1483016562: Sending  { Cmd , MgmtId: 6615759585382, via: 4, Ver: v1, Flags: 100111, [{"com.cloud.agent.api.DeleteSnapshotsDirCommand":{"store":{"com.cloud.agent.api.to.S3TO":{"id":1,"uuid":"9eb0800d-41ab-4338-a449-cd4624a7fe19","accessKey":"9M7I6JPYZHDNLG43TWCD","secretKey":"KL7IAVYcYO8URicgniNjeCmL7k3tYKMpJRXNHw==","endPoint":"10.147.29.57:8080","bucketName":"imagestore","httpsFlag":false,"created":"Jun 14, 2013 8:00:03 AM"}},"directory":"snapshots/7/5","wait":0}}] }
> 2013-06-17 10:27:18,099 DEBUG [agent.transport.Request] (AgentManager-Handler-15:null) Seq 4-1483016562: Processing:  { Ans: , MgmtId: 6615759585382, via: 4, Ver: v1, Flags: 110, [{"com.cloud.agent.api.Answer":{"result":true,"details":"Deleted snapshot %s from bucket imagestore.","wait":0}}] }
> 2013-06-17 10:27:18,099 DEBUG [agent.manager.AgentAttache] (AgentManager-Handler-15:null) Seq 4-1483016562: No more commands found
> 2013-06-17 10:27:18,099 DEBUG [agent.transport.Request] (Job-Executor-86:job-94) Seq 4-1483016562: Received:  { Ans: , MgmtId: 6615759585382, via: 4, Ver: v1, Flags: 110, { Answer } }
> 2013-06-17 10:27:18,099 DEBUG [storage.snapshot.SnapshotManagerImpl] (Job-Executor-86:job-94) Deleted all snapshots for volume: 5 under account: 7
> 2013-06-17 10:27:18,102 DEBUG [db.Transaction.Transaction] (Job-Executor-86:job-94) Rolling back the transaction: Time = 2 Name =  -AsyncJobManagerImpl$1.run:401-Executors$RunnableAdapter.call:471-FutureTask$Sync.innerRun:334-FutureTask.run:166-ThreadPoolExecutor.runWorker:1110-ThreadPoolExecutor$Worker.run:603-Thread.run:679; called by -Transaction.rollback:890-Transaction.removeUpTo:833-Transaction.close:657-TransactionContextBuilder.interceptException:63-ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept:133-SnapshotManagerImpl.deleteSnapshotDirsForAccount:688-AccountManagerImpl.cleanupAccount:581-AccountManagerImpl.deleteAccount:544-AccountManagerImpl.deleteUserAccount:1255-ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept:125-RegionManagerImpl.deleteUserAccount:177-RegionServiceImpl.deleteUserAccount:118
> 2013-06-17 10:27:18,104 WARN  [cloud.user.AccountManagerImpl] (Job-Executor-86:job-94) Failed to cleanup account Acct[7-test-WA24HE] due to
> com.cloud.utils.exception.CloudRuntimeException: DB Exception on: com.mysql.jdbc.JDBC4PreparedStatement@39a10f0: DELETE FROM snapshots WHERE snapshots.id= 1
>         at com.cloud.utils.db.GenericDaoBase.expunge(GenericDaoBase.java:1137)
>         at com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
>         at com.cloud.storage.snapshot.SnapshotManagerImpl.deleteSnapshotDirsForAccount(SnapshotManagerImpl.java:688)
>         at com.cloud.user.AccountManagerImpl.cleanupAccount(AccountManagerImpl.java:581)
>         at com.cloud.user.AccountManagerImpl.deleteAccount(AccountManagerImpl.java:544)
>         at com.cloud.user.AccountManagerImpl.deleteUserAccount(AccountManagerImpl.java:1255)
>         at com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
>         at org.apache.cloudstack.region.RegionManagerImpl.deleteUserAccount(RegionManagerImpl.java:177)
>         at org.apache.cloudstack.region.RegionServiceImpl.deleteUserAccount(RegionServiceImpl.java:118)
>         at org.apache.cloudstack.api.command.admin.account.DeleteAccountCmd.execute(DeleteAccountCmd.java:100)
>         at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:155)
>         at com.cloud.async.AsyncJobManagerImpl$1.run(AsyncJobManagerImpl.java:437)
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:679)
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`cloud`.`snapshot_store_ref`, CONSTRAINT `fk_snapshot_store_ref__snapshot_id` FOREIGN KEY (`snapshot_id`) REFERENCES `snapshots` (`id`))
>         at sun.reflect.GeneratedConstructorAccessor235.newInstance(Unknown Source)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
>         at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
>         at com.mysql.jdbc.Util.getInstance(Util.java:386)
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1040)
>         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
>         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
>         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
>         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
>         at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
>         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
>         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2450)
>         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2371)
>         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2355)
>         at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
>         at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
>         at com.cloud.utils.db.GenericDaoBase.expunge(GenericDaoBase.java:1128)
>         ... 25 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira