Skip to content

FlagEncoder versioning #281

Closed
Closed

Description

@karussell

If the access of a weight or something in the flags changed we have only the choice to increase the edge version which is ugly as people not using the one flagEncoder will also be forced to reindex it. So introduce a getVersion method and store this into the graph somehow.

Reading an older, different graph version is not the goal of this issue and is also a lot more complex but probably won't happen before 1.0

Activity

  1. added
    good first issue
    on Nov 6, 2014
  2. added this to the 0.4 milestone on Nov 6, 2014
  3. added a commit that references this issue on Nov 6, 2014
  4. removed this from the 0.4 milestone on Feb 23, 2015
  5. andreaswolf commented on Apr 29, 2015

    @andreaswolf
    Contributor

    Do I understand this right that effectively a version should be stored for each flag (or rather, one version for the "bag of flags" of one encoder)? So a hypothetic structure could be:

    [{
    flag1: foo, flag2: bar, version: 1
    },
    {
    flag3: baz, version: 3
    }]
    

    I think one byte should suffice for the version number, right?

  6. karussell commented on Apr 29, 2015

    @karussell
    MemberAuthor

    We could use a more fine grain solution but just one version per used encoder is sufficient for now. If the encoder version changes we throw an exception.

  7. andreaswolf commented on Apr 30, 2015

    @andreaswolf
    Contributor

    Ah, thought about it again… the used encoder versions can be stored once in the graph, right? My first draft was for each edge, but that does not make sense for a start.

  8. karussell commented on Apr 30, 2015

    @karussell
    MemberAuthor

    The purpose is entirely protecting the user from garbage data and so yes, once in the graph or in the properties would be sufficient. Maybe related to #313 and #285

  9. karussell commented on May 4, 2015

    @karussell
    MemberAuthor

    Fixed via #401

  10. devemux86 commented on May 4, 2015

    @devemux86
    Contributor

    👍

  11. devemux86 commented on May 4, 2015

    @devemux86
    Contributor

    Why not using the compatible encoders and skip the others here?

  12. 1 remaining item

  13. karussell commented on May 4, 2015

    @karussell
    MemberAuthor

    The issue just makes sure that e.g. if the CarFlagEncoder is not used at all and there was a version increment happening we don't force the user with an edge version increment to refeed the data.

  14. devemux86 commented on May 5, 2015

    @devemux86
    Contributor

    Thanks for the clarification Peter, I understand what you mean here.

  15. devemux86 commented on May 22, 2015

    @devemux86
    Contributor

    Peter I see that now if we try to load with the latest GH a graph created with GH just prior this PR, there is failure from GraphHopperStorage with messages like:

    WARNING: Encoding does not match:
    Graphhopper config: car|speedFactor=5.0|speedBits=5|turnCosts=true|version=1
    Graph: car|speedFactor=5.0|speedBits=5|turnCosts=true
    

    Considering that we have not any changes in graph structure, besides the introduction of version attribute, shouldn't the check pass (or is it a necessary inconvenience) for version's 1st time?

  16. devemux86 commented on May 22, 2015

    @devemux86
    Contributor

    I mean in EncodingManager the version check takes place only if the graph configuration has a version.

  17. karussell commented on May 22, 2015

    @karussell
    MemberAuthor

    is it a necessary inconvenience for version's 1st time

    Yes, should only be 1st time. Feel free to create a PR to avoid this :)

  18. devemux86 commented on May 22, 2015

    @devemux86
    Contributor

    Peter I think now we could proceed without the additional check in GraphHopperStorage since it takes always place before in EncodingManager?

  19. karussell commented on May 22, 2015

    @karussell
    MemberAuthor

    In encoding manager we just check the version of every flagencoder, in storage we check against the correct configuration of the loaded graph vs. encodingmanager

  20. devemux86 commented on May 23, 2015

    @devemux86
    Contributor

    Then at GraphHopperStorage we need to analyze where exactly is the fail at the comparison of the whole graph configuration (i.e. if it is only in version sub-string).

  21. karussell commented on May 23, 2015

    @karussell
    MemberAuthor

    Not sure what you mean. Do you mean the duplicate version check in storage and encodingmanager?

  22. devemux86 commented on May 23, 2015

    @devemux86
    Contributor

    I mean like you said that in GraphHopperStorage there is check for the whole graph configuration as one String, e.g. car|speedFactor=5.0|speedBits=5|turnCosts=true,foot|speedFactor=1.0|speedBits=4|turnCosts=false,bike|speedFactor=2.0|speedBits=4|turnCosts=false

    There should we analyze and check the lack of version individually?

  23. karussell commented on May 23, 2015

    @karussell
    MemberAuthor

    Why? What would we do with e.g. the information that only one profile does not match?

  24. devemux86 commented on May 23, 2015

    @devemux86
    Contributor

    There is probably only one case where we could "permit" the check to be successful.
    Right now with the introduction of the version where the graph structure didn't change and the version is 1.
    I'm still thinking if it's worth the effort or simply make users rebuild their graphs.

  25. devemux86 commented on May 23, 2015

    @devemux86
    Contributor

    i.e. if the configuration has only as difference the addition of version=1 and only that.

  26. karussell commented on May 23, 2015

    @karussell
    MemberAuthor

    Probably we'll decide before 0.5 release, because if there are other changes then this tweak is not worth the effort

  27. added this to the 0.5 milestone on May 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueimprovement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions