[
https://issues.apache.org/jira/browse/CLOUDSTACK-9888?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
jay updated CLOUDSTACK-9888:
----------------------------
Summary: Duplicate usage while processing usage events (was: Duplicates
are generated while processing usage events)
> Duplicate usage while processing usage events
> ---------------------------------------------
>
> Key: CLOUDSTACK-9888
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9888
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Reporter: jay
>
> Usage manager start processing events from current date or last processed
> event.
> In case of exception, exception is suppressed in the current implementation
> and usage server process rest of the events.
> when usage server starts again it picks the unprocessed event (due to
> exception) and processes rest of the events even though they are processed,
> this causes duplication of usage records.
> To avoid duplication usage server should stop when ever there is an exception.
> code:
> long lastSuccess = m_usageJobDao.getLastJobSuccessDateMillis();
> if (lastSuccess != 0) {
> startDateMillis = lastSuccess+1; // 1 millisecond after
> }
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)