You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asim: ensure consistent sequencing of changes applied to a range
Upon investigating, we identified the non-deterministic behavior was due to the
sequence of changes applied on the ranges within one tick. Changes within a tick
are applied in one go. But the changes are stored in a map, and map iteration
order is non-deterministic. Thus, the sequence of events applied and published
via gossip could vary and could result in different event states. This patch
resolves the issue by changing the storage of changes to be applied from a map
to an array, ensuring consistent iteration and sequence of events. Note the
shift to an array doesn't pose any issues since all changes need to be applied
anyway.
With this fix, the test `TestAsimDeterministic` fails only under race. This is
less concerning since the simulator should run on a single goroutine without
concurrency. Although the cause of the test failure in race conditions in
unclear, fixing this is not a priority.
Part Of: cockroachdb#105904
Release Note: None
0 commit comments