Skip to content

Commit f6349a7

Browse files
authored
Fix metric offset overflow for large MLD partitions (#6124)
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.
1 parent f1f9616 commit f6349a7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Routing:
1010
- FIXED: Fix generation of inefficient MLD partitions [#6084](https://github.com/Project-OSRM/osrm-backend/pull/6084)
1111
- FIXED: Fix MLD level mask generation to support 64-bit masks. [#6123](https://github.com/Project-OSRM/osrm-backend/pull/6123)
12+
- FIXED: Fix metric offset overflow for large MLD partitions. This breaks the **data format** [#6124](https://github.com/Project-OSRM/osrm-backend/pull/6124)
1213

1314
# 5.25.0
1415
- Changes from 5.24.0

include/partitioner/cell_storage.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ namespace detail
5252
template <storage::Ownership Ownership> class CellStorageImpl
5353
{
5454
public:
55-
using ValueOffset = std::uint32_t;
56-
using BoundaryOffset = std::uint32_t;
55+
using ValueOffset = std::uint64_t;
56+
using BoundaryOffset = std::uint64_t;
5757
using BoundarySize = std::uint32_t;
58-
using SourceIndex = std::uint32_t;
59-
using DestinationIndex = std::uint32_t;
6058

6159
static constexpr auto INVALID_VALUE_OFFSET = std::numeric_limits<ValueOffset>::max();
6260
static constexpr auto INVALID_BOUNDARY_OFFSET = std::numeric_limits<BoundaryOffset>::max();

0 commit comments

Comments
 (0)