Routing Precedence Priority with Routing-Mark and Distance

I’ve found that a route with a routing-mark always takes priority over other routes, regardless of distance.

For example, if a connection (with routing mark x) matches both of the following routes, it will always take route #2 because of the mark even though it has a much larger distance.

Route #1
0.0.0.0/0 Gateway=192.168.1.1 Distance=1

Route #2
0.0.0.0/0 Gateway=192.168.2.1 Distance=20 Routing-Mark=x

Shouldn’t the connection always take the shortest route in this case?

Shouldn’t the presence of a routing-mark on a route simply make that route unavailable to connections WITHOUT a routing-mark, instead of making that route a priority to a connection WITH a routing-mark?

Think of a set of routes with the same routing mark as if they are all in a separate routing table. Lets call it ‘named routing table’. Also lets call a set of routes without routing mark the ‘default routing table’.

When taking a routing decision for a packet with routing mark set RouterOS first checks a named routing table, and then only falls back to the default routing table if no match is found in the named routing table. You can disable this fallback behavior by defining an appropriate routing rule.