Skip to content

Conversation

@dumbbell
Copy link
Collaborator

Why

The computation of a node's system-time-based start time is based on its monotonic-time-based start time plus the current time offset.

However, since Erlang/OTP 26, that time offset is volatile by default. Therefore the computed system-time-based start time can change too. It happens in CI and this affects the seed node selection in the peer discovery code: because the sorting is unstable when the start time is the criteria, different instances of the peen discovery code could select a different node.

How

The same code is used to compute the start time. However, the computed value is cached in a persistent_term for future queries. This way we ensure that the value is computed once and thus all queries will return the same result.

[Why]
The computation of a node's system-time-based start time is based on its
monotonic-time-based start time plus the current time offset.

However, since Erlang/OTP 26, that time offset is volatile by default.
Therefore the computed system-time-based start time can change too. It
happens in CI and this affects the seed node selection in the peer
discovery code: because the sorting is unstable when the start time is
the criteria, different instances of the peen discovery code could
select a different node.

[How]
The same code is used to compute the start time. However, the computed
value is cached in a persistent_term for future queries. This way we
ensure that the value is computed once and thus all queries will return
the same result.
@dumbbell dumbbell force-pushed the fix-peer-disc-node-sorting-with-erlang26 branch from 0d89189 to 3dd8a24 Compare January 23, 2025 17:17
@dumbbell
Copy link
Collaborator Author

Superseeded by #13490.

@dumbbell dumbbell closed this Mar 27, 2025
@dumbbell dumbbell deleted the fix-peer-disc-node-sorting-with-erlang26 branch March 27, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants