-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix metric offset overflow for large MLD partitions #6124
Fix metric offset overflow for large MLD partitions #6124
Conversation
746c710
to
56da876
Compare
using ValueOffset = std::uint32_t; | ||
using BoundaryOffset = std::uint32_t; | ||
using ValueOffset = std::size_t; | ||
using BoundaryOffset = std::size_t; | ||
using BoundarySize = std::uint32_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OSM contains ~800 million ways, so 32 bit should be safe to use for boundary sizes...for now.
de8e9cb
to
d86092c
Compare
Each MLD cell has source and destination nodes. MLD is keeping a |source| x |destination| sized table for various metrics (distances, durations, etc) from each source to all destinations in a cell. It stores all of the values for a metric in one large array, with an offset for each cell to find its values. The offset is currently limited to 32 bit values, which overflows on very large graphs (e.g. Planet OSM). We fix this by changing the offsets to be uint64_t types.
d86092c
to
a85d2e7
Compare
@mjjbell I think I'm going to make a new release once this is merged - any objections? |
@danpat sounds good 👍 I can see I tested the package publishing from Github Actions in https://github.com/mjjbell/osrm-backend/actions/runs/998677972, but I think I must have removed the generated artifacts to not confuse myself in the future. |
Proof that it is indeed a breaking change to the data format: #6128 |
Issue
As discovered in #6121
Each MLD cell has source and destination nodes. MLD is keeping a |source| x |destination| sized table
for various metrics (distances, durations, etc) from each source to all destinations in a cell.
It stores all of the values for a metric in one large array, with an offset for each cell to find its values. The offset is currently
limited to 32 bit values, which overflows on very large graphs (e.g. Planet OSM).
We fix this by changing the offsets to be uint64_t types.
Tasklist