Closed
Description
Below (in a separate comment) is a modified delta_query.rs that
- uses a fixed number of workers (32)
- does not read the graph from files, but instead inserts six hard-coded edges, so that the resulting graph should have two triangles (<1,2,3> and <3,4,1>). All inserts are done from thread 0.
- IMPORTANT (this is what triggers the bug): after each insert, propagates changes through the pipeline:
input.insert(v.clone());
input.advance_to(i+1);
input.flush();
while probe.less_than(&(i+1)) {
worker.step();
}
- workers other than 0 simply step until reaching the last timestamp:
input.advance_to(6);
input.flush();
while probe.less_than(&6) {
worker.step();
}
when I run the modified example cargo run --example delta_query, the program randomly computes 0, 1, or 2 triangles:
# 0 triangles
$cargo run --example delta_query
Finished dev [unoptimized + debuginfo] target(s) in 0.05s
Running `/home/lryzhyk/projects/differential-dataflow/dogsdogsdogs/target/debug/examples/delta_query
worker0 at timestamp 1
worker0 at timestamp 2
worker0 at timestamp 3
worker0 at timestamp 4
worker0 at timestamp 5
worker0 at timestamp 6
# 1 triangle
$ cargo run --example delta_query
Finished dev [unoptimized + debuginfo] target(s) in 0.05s
Running `/home/lryzhyk/projects/differential-dataflow/dogsdogsdogs/target/debug/examples/delta_query`
worker0 at timestamp 1
worker0 at timestamp 2
worker0 at timestamp 3
worker0 at timestamp 4
worker0 at timestamp 5
Triangle: ((3, 4, 1), 5, 1)
worker0 at timestamp 6
If instead of looping on worker.step() after each insert I first insert all values (while advancing input timestamp) and then do
while probe.less_than(&6) {
worker.step();
}
then it computes two triangles as expected.
Am I using the API incorrectly or is this behavior indeed problematic?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels
Activity
ryzhyk commentedon Jun 24, 2019
Here is the complete modified
delta_query.rsfrankmcsherry commentedon Jun 25, 2019
I will investigate, thanks! :D
frankmcsherry commentedon Jun 25, 2019
Non-deterministic output is almost certainly a bug. I accept responsibility!
frontier race, fixes #183
frankmcsherry commentedon Jun 25, 2019
I'm pretty sure #184 fixes this. At least, it fixes what was certainly a bug and seems to cause your example to consistently produce correct output.
Thanks very much for the easily reproduced error, and the bug report (so embarrassing!).
I apologize that the stuff in this repo is still very DIY, and I'll try to bring a bit more helpful structure as I start using it more myself (we're running TPCH plans now, and will want to start thinking about these plans soon).