[openstack-dev] [Panko] Ways to go through events in the order they appear in database

gordon chung gord at live.ca
Tue Sep 5 18:27:53 UTC 2017



On 05/09/17 09:27 AM, Jay Pipes wrote:
>
> Why not sort by created date/timestamp? Wouldn't that give you the same
> behaviour (for the most part).

we actually do that by default currently. the issue Mikhail ran into was 
because the timestamp we store is the timestamp of the message, not the 
timestamp it's actually recorded in the db. because of that, if we 
record the following(msg_id, timestamp, traits):

(event1, 01:00, {})
(event2, 01:10, {})
(event4, 01:30, {})

if a new event comes in as (event3, 01:20, {}), it will be invisible to 
the user if they "get events" with marker=event4 because while it is 
"newer" in terms of when it was recorded, it's not newer in terms of 
event timestamp.

i imagine if we were to support the ability to see event3 even if the 
marker is event4, we'd need to do what Jay suggested, and add a 
recorded_at/created_at field. supporting sorting by id as i previously 
suggested is probably not a great idea since id is implementation details.

cheers,

-- 
gord


More information about the OpenStack-dev mailing list