You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Chip Childers (JIRA)" <ji...@apache.org> on 2013/05/08 16:05:17 UTC

[jira] [Updated] (CLOUDSTACK-974) listServiceOfferings doesn't sort by sortKey for non-root users

     [ https://issues.apache.org/jira/browse/CLOUDSTACK-974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chip Childers updated CLOUDSTACK-974:
-------------------------------------

    Fix Version/s:     (was: 4.0.2)
                   4.2.0
    
> listServiceOfferings doesn't sort by sortKey for non-root users
> ---------------------------------------------------------------
>
>                 Key: CLOUDSTACK-974
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-974
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: API
>    Affects Versions: 4.0.0, 4.0.1
>            Reporter: Wido den Hollander
>            Assignee: Prachi Damle
>            Priority: Minor
>             Fix For: 4.2.0
>
>
> I was just notified by a colleague that there is different behaviour between the Admin UI and User UI.
> When you list all Service Offerings in the Admin interface they get sorted by sortKey descending.
> If you go and create an Instance as a user through the wizard the Service Offerings aren't sorted, they are in the order like they are in the database.
> I logged the MySQL queries and they are:
> ** ADMIN **
> SELECT disk_offering.id, disk_offering.domain_id, disk_offering.unique_name, disk_offering.name, disk_offering.display_text, disk_offering.disk_size, disk_offering.tags, disk_offering.type, disk_offering.removed, disk_offering.created, disk_offering.recreatable, disk_offering.use_local_storage, disk_offering.system_use, disk_offering.customized, disk_offering.uuid, disk_offering.sort_key, service_offering.cpu, service_offering.speed, service_offering.ram_size, service_offering.nw_rate, service_offering.mc_rate, service_offering.ha_enabled, service_offering.limit_cpu_use, service_offering.host_tag, service_offering.default_use, service_offering.vm_type, service_offering.sort_key
> FROM service_offering INNER JOIN disk_offering ON service_offering.id=disk_offering.id
> WHERE disk_offering.type='Service'
> AND disk_offering.system_use = 0
> AND disk_offering.system_use = 0
> AND disk_offering.removed IS NULL
> ORDER BY service_offering.sort_key DESC
> ** USER **
> SELECT disk_offering.id, disk_offering.domain_id, disk_offering.unique_name, disk_offering.name, disk_offering.display_text, disk_offering.disk_size, disk_offering.tags, disk_offering.type, disk_offering.removed, disk_offering.created, disk_offering.recreatable, disk_offering.use_local_storage, disk_offering.system_use, disk_offering.customized, disk_offering.uuid, disk_offering.sort_key, service_offering.cpu, service_offering.speed, service_offering.ram_size, service_offering.nw_rate, service_offering.mc_rate, service_offering.ha_enabled, service_offering.limit_cpu_use, service_offering.host_tag, service_offering.default_use, service_offering.vm_type, service_offering.sort_key
> FROM service_offering INNER JOIN disk_offering ON service_offering.id=disk_offering.id
> WHERE disk_offering.type='Service'
> AND disk_offering.domain_id IS NULL
> AND disk_offering.system_use = 0
> AND disk_offering.removed IS NULL
> To me it seems this goes wrong in ManagementServerImpl.searchForServiceOfferings:
> Filter searchFilter = new Filter(ServiceOfferingVO.class, "sortKey", isAscending, cmd.getStartIndex(), cmd.getPageSizeVal());
> getStartIndex and getPageSizeVal are both NULL since the user UI doesn't add page nor pagesize to the API request.

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