Skip to content
  • Thomas Haller's avatar
    platform: preserve order of objects during dump · 94c02545
    Thomas Haller authored
    NMPCache can preserve the order of the objects. Until now, the order
    was however arbitrary. Soon we will require to preserve the order of
    routes.
    
    During a dump, force appending new objects at the end. That ensures,
    correct ordering during the dump.
    
    Note that we track objects in several distrinct indexes. Those partition the
    set of all objects. Outside a dump when receiving events about new objects (e.g.
    RTM_NEWROUTE), it is very unclear at which place the new object should be sorted.
    It is especially unclear, as an object might move from one partition (of
    an index) to another.
    In general, a deterministic order will only be useful in one particular
    instance: the NMP_CACHE_ID_TYPE_ROUTES_BY_DESTINATION index for routes.
    In this case, we will ensure a particular order of the routes.
    94c02545