Skip to content

[Usage] Fix wrong usage_type#7229

Merged
DaanHoogland merged 3 commits intoapache:mainfrom
scclouds:fix-wrong-usage-type-in-io-write
Mar 3, 2023
Merged

[Usage] Fix wrong usage_type#7229
DaanHoogland merged 3 commits intoapache:mainfrom
scclouds:fix-wrong-usage-type-in-io-write

Conversation

@SadiJr
Copy link
Copy Markdown
Contributor

@SadiJr SadiJr commented Feb 14, 2023

Description

IO write events have been saved in the database using the usage_type of the VM_DISK_BYTES_WRITE type, which causes an inconsistency in the database. This behavior has been fixed by this PR. Plus, the old data saved in the database has been normalized.

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)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

It was tested in a local lab:

  1. I waited for the job of the Usage plugin to run;
  2. Before, ACS saved the IO write event with the wrong usage_type in the database;
  3. Now, ACS saves these events with the right usage_type, and the old events are normalized.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 14, 2023

Codecov Report

Merging #7229 (42e8800) into main (eef63d9) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #7229      +/-   ##
============================================
- Coverage     12.67%   12.67%   -0.01%     
  Complexity     8641     8641              
============================================
  Files          2716     2716              
  Lines        256112   256111       -1     
  Branches      39926    39926              
============================================
- Hits          32461    32460       -1     
  Misses       219522   219522              
  Partials       4129     4129              
Impacted Files Coverage Δ
...ervisor/kvm/resource/LibvirtComputingResource.java 18.30% <ø> (-0.04%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

1 similar comment
@github-actions
Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Copy Markdown
Contributor

@stephankruggg stephankruggg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLGTM, not manually tested

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@DaanHoogland DaanHoogland added this to the 4.18.0.0 milestone Mar 2, 2023
Copy link
Copy Markdown
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

Copy link
Copy Markdown
Contributor

@BryanMLima BryanMLima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested this in a local lab. I upgraded from a version with this error and the old events were fixed; furthermore, the new usage events were with the correct usage type in the DB.

Comment on lines +1577 to +1585


-- Change usage of VM_DISK_IO_WRITE to use right usage_type
UPDATE
`cloud_usage`.`cloud_usage`
SET
usage_type = 22
WHERE
usage_type = 24 AND usage_display like '% io write'; No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the milestone changed to version 4.18.1.0 this needs to be changed to the correct schema file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BryanMLima
I think this can be merged into 4.18.0.0

@DaanHoogland DaanHoogland modified the milestones: 4.18.1.0, 4.18.0.0 Mar 3, 2023
@DaanHoogland DaanHoogland merged commit ad64ee3 into apache:main Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants