[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadow tests fail when the host ID order is reversed (or when hosts are renamed) #2753

Open
stevenengler opened this issue Feb 16, 2023 · 1 comment
Labels
Type: Bug Error or flaw producing unexpected results

Comments

@stevenengler
Copy link
Contributor
stevenengler commented Feb 16, 2023

Shadow reads hosts from the configuration file into a BTreeMap keyed by their hostnames in order to have a consistent host order and preserve determinism. (Reordering hosts in the configuration file should not change the simulation.) The Manager assigns these hosts an ID given by their order in the B-tree. Shadow sometimes uses these IDs to decide the order to process things. For example the source host's ID is used as one of the comparisons in <Event as PartialOrd>::partial_cmp() to order events in the event queue.

Ideally, changing hosts' IDs should not significantly affect the simulation results. For example, if you rename a host in the Shadow config such that the new name is ordered differently relative to other hostnames, then the host will be given a different ID relative to those other hosts. Analogously, if we were to reverse the order that hosts are added to the Manager, the simulation results should not significantly change.

If we reverse the host ID order, we do see different simulation results, and several of Shadow's tests fail. We should reduce Shadow's dependence on host IDs for determinism and ensure all tests pass when the host IDs are reversed. For example, see #2568 which was a test to see what tests fail. (This isn't directly a determinism issue, but is related.)

@stevenengler stevenengler added the Type: Bug Error or flaw producing unexpected results label Feb 16, 2023
@stevenengler
Copy link
Contributor Author

#2378 is related, but is specifically about fairness rather than correctness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Error or flaw producing unexpected results
Projects
None yet
Development

No branches or pull requests

1 participant