You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/08/30 08:13:41 UTC

[GitHub] [cloudstack] ravening opened a new issue #4195: Count mismatch for list diskofferings api

ravening opened a new issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195


   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and master branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   API, Server
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on master branch.
   -->
   
   ~~~
   4.14.0.0
   ~~~
   
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   Ubuntu16
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   The count value returned by listDiskofferings api is different from total number of actual returned elements.
   
   ##### STEPS TO REPRODUCE
   <!--
   For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate.
   
   For new features, show how the feature would be used.
   -->
   
   <!-- Paste example playbooks or commands between quotes below -->
   ~~~
   1. Create a domain under ROOT called "test1"
   2. Create a child domain for "test1" called "test1-child"
   3. Create disk offerings ONLY for the domain "test1-child"
   4. Login as "test1" domain in cloudmonkey using cloudmonkey -p test1
   5. Run the list diskofferings command with and without isrecursive flag
   ~~~
   
   <!-- You can also paste gist.github.com links for larger files -->
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   
   ~~~
   Without isrecursive flag I should see a total of 9 items returned as the count says 9
   With isrecursive flag set to true, I should see a total of 9 elements returned as the count says 9
   ~~~
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   
   <!-- Paste verbatim command output between quotes below -->
   ~~~
   Without isrecursive flag I see only 6 elements returned
   
   (test1) 🐵 > list diskofferings filter=name
   {
     "count": 9, <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     "diskoffering": [
       {
         "name": "Small"
       },
       {
         "name": "Medium"
       },
       {
         "name": "Large"
       },
       {
         "name": "Custom"
       },
       {
         "name": "root-offering"
       },
       {
         "name": "test1"
       }
     ]
   }
   
   
   
   With isrecursive=true, I see 8 items returned
   
   (test1) 🐵 > list diskofferings filter=name isrecursive=true
   {
     "count": 9,  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     "diskoffering": [
       {
         "name": "Small"
       },
       {
         "name": "Medium"
       },
       {
         "name": "Large"
       },
       {
         "name": "Custom"
       },
       {
         "name": "test-11"
       },
       {
         "name": "test1"
       },
       {
         "name": "test-11-only"
       },
       {
         "name": "child-domain-test-11"
       }
     ]
   }
   ~~~
   
   
   @rhtyd @shwstppr 
   
   what should the `count` variable contain here?
   
   In the code `server/src/main/java/com/cloud/api/query/QueryManagerImpl.java` function `searchForDiskOfferingsInternal`, I see that if `isrecursive=true` is passed, it is doing some filtering on the list but it does not return the final size of the list instead it returns the initial size of the list
   
   ```
    return new Pair<>(result.first(), result.second());
   ```
   
   Instead, it should return 
   ```
   return new Pair<>(result.first(), result.first().size());
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] shwstppr edited a comment on issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
shwstppr edited a comment on issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195#issuecomment-653192127


   @ravening as per my understanding it cannot always return `result.first.size()`. Second parameter is total count while count of first will be pageSize at max. I can be wrong here though.
   
   Your issue seems a real bug. It should return correct size for `isrecursive=true`. It seems to be including parent domains in count.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] shwstppr commented on issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
shwstppr commented on issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195#issuecomment-653192127


   @ravening as per my understanding it cannot always return `result.first.size()`. Second parameter is total count while count of first will be pageSize.
   
   Though your issue seems a real bug. It should return correct size for `isrecursive=true`. It seems to be including parent domains in count.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195#issuecomment-773888527


   @ravening can you look if #4374 solves your problem? closing for now, but please reopen if you feel it is still an issue.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] shwstppr edited a comment on issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
shwstppr edited a comment on issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195#issuecomment-653192127


   @ravening as per my understanding it cannot always return `result.first.size()`. Second parameter is total count while count of first will be pageSize at max.
   
   Though your issue seems a real bug. It should return correct size for `isrecursive=true`. It seems to be including parent domains in count.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195#issuecomment-908140323


   >  I dont have permission to reopen this issue
   
   strange, it is yours. but here you go.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] ravening commented on issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
ravening commented on issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195#issuecomment-908142899


   > @ravening , can you link the PR with the "Linked pull requests" item on the right, please?
   
   @DaanHoogland since you closed it, I wont have permission to reopen it. I dont have the permission to link the pr also but here is the pr https://github.com/apache/cloudstack/pull/5307


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195#issuecomment-908140822


   @ravening , can you link the PR with the "Linked pull requests" item on the right, please?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland closed issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
DaanHoogland closed issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] ravening commented on issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
ravening commented on issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195#issuecomment-908110442


   > @ravening can you look if #4374 solves your problem? closing for now, but please reopen if you feel it is still an issue.
   
   @DaanHoogland that fix doesnt solve the issue. Can you please reopen the issue again as its being tracked by another pr?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195#issuecomment-768910678


   @ravening , @davidjumani did some improvcements in this respect fr 4.15 (I'll link the pull if i get time to find it) can you try with 4.15 please?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195#issuecomment-773888527


   @ravening can you look if #4374 solves your problem? closing for now, but please reopen if you feel it is still an issue.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland closed issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
DaanHoogland closed issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] ravening edited a comment on issue #4195: Count mismatch for list diskofferings api

Posted by GitBox <gi...@apache.org>.
ravening edited a comment on issue #4195:
URL: https://github.com/apache/cloudstack/issues/4195#issuecomment-908110442


   > @ravening can you look if #4374 solves your problem? closing for now, but please reopen if you feel it is still an issue.
   
   @DaanHoogland that fix doesnt solve the issue. Can you please reopen the issue again as its being tracked by another pr? I dont have permission to reopen this issue


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org