CLOUDSTACK-2625, CLOUDSTACK-3401: Usage records are ordered by start_date which is not unique. While listing large datasets or when page size is small this will result in duplicates. Order records by id instead

(cherry picked from commit 63109a97b1)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	server/src/com/cloud/usage/UsageServiceImpl.java
This commit is contained in:
Kishan Kavala 2014-10-09 10:27:35 +05:30 committed by Rohit Yadav
parent 6d0a9b2482
commit 7a86dc516d
1 changed files with 2 additions and 2 deletions

View File

@ -180,8 +180,8 @@ public class UsageServiceImpl extends ManagerBase implements UsageService, Manag
s_logger.debug("getting usage records for account: " + accountId + ", domainId: " + domainId + ", between " + startDate + " and " + endDate + ", using pageSize: " + cmd.getPageSizeVal() + " and startIndex: " + cmd.getStartIndex());
}
Filter usageFilter = new Filter(UsageVO.class, "startDate", false, cmd.getStartIndex(), cmd.getPageSizeVal());
Filter usageFilter = new Filter(UsageVO.class, "id", true, cmd.getStartIndex(), cmd.getPageSizeVal());
SearchCriteria<UsageVO> sc = _usageDao.createSearchCriteria();
if (accountId != -1 && accountId != Account.ACCOUNT_ID_SYSTEM && !isAdmin && !isDomainAdmin) {