Skip to content

Add logs for storage pools reordering#10419

Open
julien-vaz wants to merge 4 commits intoapache:4.22from
scclouds:add-logs-storage-pool-reordering
Open

Add logs for storage pools reordering#10419
julien-vaz wants to merge 4 commits intoapache:4.22from
scclouds:add-logs-storage-pool-reordering

Conversation

@julien-vaz
Copy link
Contributor

Description

Since the storage pool reordering process was lacking logs for troubleshooting, some debug level log messages were added and trace level log messages were changed to the debug level. Also, the log messages were rewritten according to the new Log4j2 syntax.

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

How Has This Been Tested?

  1. A volume was created;
  2. Its disk offering was changed;
  3. It was verified that the log messages were properly being displayed.

@boring-cyborg
Copy link

boring-cyborg bot commented Feb 18, 2025

Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
Here are some useful points:

@codecov
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

❌ Patch coverage is 20.00000% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.62%. Comparing base (7324ef4) to head (7be068d).

Files with missing lines Patch % Lines
...torage/allocator/AbstractStoragePoolAllocator.java 20.00% 24 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #10419      +/-   ##
============================================
- Coverage     17.62%   17.62%   -0.01%     
+ Complexity    15668    15666       -2     
============================================
  Files          5917     5917              
  Lines        531255   531253       -2     
  Branches      64951    64947       -4     
============================================
- Hits          93639    93638       -1     
  Misses       427077   427077              
+ Partials      10539    10538       -1     
Flag Coverage Δ
uitests 3.70% <ø> (ø)
unittests 18.69% <20.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
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.

one general remark on these changes; I see only trace and debug logs, but if axtra logs are really needed I would expect at least hight level logging to be added (info and higher) were considerations made to do this? (DEBUG should not be on in production environments in principle, unless trouble shooting is going on)

@julien-vaz
Copy link
Contributor Author

Alright, I've just changed the level of logs on reordering methods, @DaanHoogland

Copy link
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.

makes mostly sense, just one info i'd like to question.

@julien-vaz
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@julien-vaz 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12691

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

Copy link
Member

@bernardodemarco bernardodemarco left a comment

Choose a reason for hiding this comment

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

clgtm

@github-actions
Copy link

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

@JoaoJandre
Copy link
Contributor

@julien-vaz could you fix the conflicts?

@julien-vaz
Copy link
Contributor Author

@julien-vaz could you fix the conflicts?

Sure!

@julien-vaz julien-vaz force-pushed the add-logs-storage-pool-reordering branch from 53c59bf to 04e69aa Compare June 4, 2025 21:26
@sureshanaparti sureshanaparti added this to the 4.21.0 milestone Jun 5, 2025
@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 13617

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-13481)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 57861 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10419-t13481-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@DaanHoogland
Copy link
Contributor

@sureshanaparti , do you think we need anymore testing on this? (/me not convinced)

@julien-vaz
Copy link
Contributor Author

julien-vaz commented Jun 23, 2025

I've just built the packages locally, so I'm triggering the Blue Orangutan again.

@julien-vaz
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@julien-vaz 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.

@rajujith
Copy link

@julien-vaz Since this is for the 4.22.1 release, could you retarget the PR to the 4.22 branch?

@DaanHoogland DaanHoogland changed the base branch from main to 4.22 January 12, 2026 09:58
@borisstoyanov borisstoyanov marked this pull request as ready for review January 26, 2026 09:09
Copilot AI review requested due to automatic review settings January 26, 2026 09:09
Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM, based on code review and BO tests. @sureshanaparti could you check the branch and merge please

@borisstoyanov borisstoyanov self-assigned this Jan 26, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances observability of storage pool reordering by adding and updating log messages and migrating them to Log4j2-style parameterized logging.

Changes:

  • Replaced String.format-based logging with Log4j2-style {} placeholders throughout AbstractStoragePoolAllocator.
  • Added and elevated several log statements (including to INFO level) around pool reordering by capacity, number of volumes, and disk provisioning type.
  • Adjusted logging for filtering and compatibility checks on storage pools to provide more structured and detailed context for troubleshooting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

reorderedPools.add(preferredIndex++, pool);
}
}
logger.debug("Reordered list of pools by disk provisioning type [{}]: [{}]", diskProfile.getProvisioningType(), pools);
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

This debug statement logs the original pools list even though the method has just built a reorderedPools list and is about to return it, which makes the message misleading when troubleshooting reordering by disk provisioning type. Consider logging the reordered list instead so the log output reflects the actual ordering that will be used.

Suggested change
logger.debug("Reordered list of pools by disk provisioning type [{}]: [{}]", diskProfile.getProvisioningType(), pools);
logger.debug("Reordered list of pools by disk provisioning type [{}]: [{}]", diskProfile.getProvisioningType(), reorderedPools);

Copilot uses AI. Check for mistakes.
Comment on lines 212 to +213
if (pools == null) {
logger.trace("There are no pools to reorder; returning null.");
logger.info("There are no pools to reorder.");
return null;
}
if (logger.isTraceEnabled()) {
logger.trace(String.format("reordering %d pools", pools.size()));
}
logger.info("Reordering [{}] pools", pools.size());
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

These log statements (and similar ones added below) have been raised to INFO level, which means every pool reordering attempt will now be emitted at INFO instead of DEBUG/TRACE and can significantly increase log volume in busy environments. This also goes beyond the PR description (which mentioned adding DEBUG logs and promoting TRACE to DEBUG), so please confirm that INFO is the intended level for these high-frequency paths or consider keeping them at DEBUG while still adopting the new Log4j2 placeholder syntax.

Copilot uses AI. Check for mistakes.
@borisstoyanov
Copy link
Contributor

@julien-vaz can you please resolve the conflicts

Julien Hervot de Mattos Vaz and others added 3 commits February 12, 2026 08:38
Substitui  por nova sintaxe do Log4j
…ocator/AbstractStoragePoolAllocator.java

Co-authored-by: dahn <daan.hoogland@gmail.com>
Copy link
Collaborator

@erikbocks erikbocks left a comment

Choose a reason for hiding this comment

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

clgtm

@erikbocks
Copy link
Collaborator

Hello, @borisstoyanov and @rajujith

The conflicts were solved, can we move forward with this PR? I think it is ready to be merged.

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland 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.

@sureshanaparti
Copy link
Contributor

@julien-vaz @erikbocks can you check the build errors.

Error:  testregisterBackupForVMwithOutSsid(org.apache.backup.networker.NetworkerClientTest)  Time elapsed: 0.387 s  <<< FAILURE!
...
Error:    NetworkerClientTest.testregisterBackupForVMwithOutSsid:637 No requests exactly matched. Most similar request was:  expected:<

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16813

@erikbocks
Copy link
Collaborator

@sureshanaparti I runned the tests locally and no problem was found. I will trigger the build again.

@erikbocks erikbocks closed this Feb 12, 2026
@erikbocks erikbocks reopened this Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.