When Trove emits exists notification, it includes an audit period. This should be the most recently completed audit period/ period of usage. This how nova does it - https://github.com/openstack/nova/blob/master/nova/notifications.py#L250 and the openstack recommendation: https://wiki.openstack.org/wiki/NotificationEventExamples
However, Trove emits exists event with a future audit period , which seems incorrect. https://github.com/openstack/trove/blob/master/trove/extensions/mgmt/instances/models.py#L188
At a minimum, this should be fixed to reflect exists event for the recently completed audit period -
Swapping the audit_start and audit_end times(or something similar):
audit_start = utils.isotime(
now - datetime.timedelta(
seconds=CONF.exists_notification_ticks * CONF.report_interval),
subsecond=True)
audit_end = utils.isotime(now, subsecond=True)
Fix proposed to branch: master /review. openstack. org/269854
Review: https:/