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

gordon chung gord at live.ca
Wed Aug 30 13:22:05 UTC 2017



On 2017-08-30 08:45 AM, Mikhail Kebich wrote:
> Assume, that I made a request after events 1, 2, 3 and 4 were added to
> the database. After some time events 5, 6, 7, 8 and 9 were added to
> the database. I made another request to get the rest of events and
> received only events 8, 9 because of current sorting used for
> pagination.

ah, i see. iirc, we can choose what we sort on. can this be solved by 
just passing in a different sort key? or maybe we need to support 
returning results without sort.

> 
> I look for a way to go through events in order determined by the "id"
> field. The "id" field is not exposed via api because it is internal
> part of storage implementation. We can't use it in api calls.
> So, I proposed cursor api as an independent from storage
> implementation way to get events in the order they appear in a
> database.
> 
>> is cursor code part of oslo.db? the one issue i see is we'll need to
>> change api results which means we need to do some versioning changes as
>> well (not a blocker, just another discussion and more work)
> Actually, cursor is not more than the pagenate_query from oslo.db. It
> just uses the "id" field as a sort key.
> 
> Can I share patch with the prototype, maybe it will help in the discussion?

if you already have the code, go for it! :)

cheers,

-- 
gord


More information about the OpenStack-dev mailing list