Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EC11C200BAB for ; Sat, 22 Oct 2016 16:14:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EA716160ADF; Sat, 22 Oct 2016 14:14:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3D773160AD7 for ; Sat, 22 Oct 2016 16:14:00 +0200 (CEST) Received: (qmail 86325 invoked by uid 500); 22 Oct 2016 14:13:54 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 86315 invoked by uid 99); 22 Oct 2016 14:13:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Oct 2016 14:13:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F0B60E0A59; Sat, 22 Oct 2016 14:13:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rajani@apache.org To: commits@cloudstack.apache.org Date: Sat, 22 Oct 2016 14:13:54 -0000 Message-Id: <428f6a6815044877940601f488c63bb3@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] git commit: updated refs/heads/4.8 to fae9034 archived-at: Sat, 22 Oct 2016 14:14:01 -0000 Merge pull request #1624 from greenqloud/pr-volume-usage-events-fixes-4.8 Fixes regarding VOLUME_DELETE events resulting from account deletionNew version of #1491. **Original Description** New version of #1373, but updated for the 4.7 branch with another fix that allows it to properly find expunged root volumes. This is a bug fix, which is why we target the 4.7 branch. Original pull request: Fixes regarding usage event emission. UsageEventUtils was previously not checking deleted accounts, which meant that if an account was deleted that had some resources running on it, those resources would get destroyed without emitting any events. Furthermore, the VOLUME_DELETE event of ROOT volumes is the responsibility of the UserVmManager, which gets circumvented when expunging resources following the account deletion. Added a check to the AccountManager which catches the ROOT volumes that need to be deleted and emits events for them. To test this: Create a new user. As that user, create and destroy an instance. This should cause the VM_CREATE, VM_START, VM_STOP, VM_DESTROY, VOLUME_CREATE, and VOLUME_DELETE events to be emitted. Create a new instance as the same user. Log in as admin, and delete the user. The same set of events should be emitted, and there should be no duplicate DELETE events for the ROOT volume of the previous instance. * pr/1624: Emit a VOLUME_DELETE usage event when account deletion destroys an instance. Signed-off-by: Rajani Karuturi Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fae90341 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fae90341 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fae90341 Branch: refs/heads/4.8 Commit: fae90341beb51fd0daa1814ec2f8700c0894e551 Parents: a664e03 d989c5d Author: Rajani Karuturi Authored: Sat Oct 22 19:42:20 2016 +0530 Committer: Rajani Karuturi Committed: Sat Oct 22 19:42:20 2016 +0530 ---------------------------------------------------------------------- .../src/com/cloud/user/AccountManagerImpl.java | 12 +- .../com/cloud/user/AccountManagerImplTest.java | 220 ++----------- ...AccountManagerImplVolumeDeleteEventTest.java | 209 +++++++++++++ .../cloud/user/AccountManagetImplTestBase.java | 242 +++++++++++++++ .../test/com/cloud/user/MockUsageEventDao.java | 307 +++++++++++++++++++ 5 files changed, 787 insertions(+), 203 deletions(-) ----------------------------------------------------------------------