Currently, relations geometry rebuild involves all members without filtering.
This could lead to unsuitable geometries for length or surface evaluation, as intended by Podoma.
Example with https://www.openstreetmap.org/relation/19536760 :
Such an error leads significant length variation. Measured: 12266 m vs Expected: 9798 m
It could be useful to define a list of possible roles to be involved in the geometry rebuild.
Such a filter could be processed when selecting members prior to get the final geometry.