You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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:
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.
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.
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
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.
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?
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
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).
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?
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.
Activity
as we introduced a new weighting and #281 we needed to increase the e…
andreaswolf commentedon Apr 29, 2015
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:
I think one byte should suffice for the version number, right?
karussell commentedon Apr 29, 2015
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.
andreaswolf commentedon Apr 30, 2015
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.
karussell commentedon Apr 30, 2015
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
karussell commentedon May 4, 2015
Fixed via #401
devemux86 commentedon May 4, 2015
👍
devemux86 commentedon May 4, 2015
Why not using the compatible encoders and skip the others here?
1 remaining item
karussell commentedon May 4, 2015
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.
devemux86 commentedon May 5, 2015
Thanks for the clarification Peter, I understand what you mean here.
devemux86 commentedon May 22, 2015
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:
Considering that we have not any changes in graph structure, besides the introduction of
versionattribute, shouldn't the check pass (or is it a necessary inconvenience) forversion's 1st time?devemux86 commentedon May 22, 2015
I mean in EncodingManager the version check takes place only if the graph configuration has a version.
karussell commentedon May 22, 2015
Yes, should only be 1st time. Feel free to create a PR to avoid this :)
devemux86 commentedon May 22, 2015
Peter I think now we could proceed without the additional check in
GraphHopperStoragesince it takes always place before inEncodingManager?karussell commentedon May 22, 2015
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
devemux86 commentedon May 23, 2015
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).
karussell commentedon May 23, 2015
Not sure what you mean. Do you mean the duplicate version check in storage and encodingmanager?
devemux86 commentedon May 23, 2015
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=falseThere should we analyze and check the lack of version individually?
karussell commentedon May 23, 2015
Why? What would we do with e.g. the information that only one profile does not match?
devemux86 commentedon May 23, 2015
There is probably only one case where we could "permit" the check to be successful.
Right now with the introduction of the
versionwhere 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.
devemux86 commentedon May 23, 2015
i.e. if the configuration has only as difference the addition of
version=1and only that.karussell commentedon May 23, 2015
Probably we'll decide before 0.5 release, because if there are other changes then this tweak is not worth the effort