From 3df6a92df6bdfc0440c94d364e99683ded409c9d Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 10 Jan 2021 01:17:59 -0800 Subject: [PATCH] view: merge concurrent operations ordered by transaction commit time This will make it easier to test the result of concurrent operations (just make sure the operations don't commit during the same millisecond). --- lib/src/view.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/view.rs b/lib/src/view.rs index f242856a1..687960239 100644 --- a/lib/src/view.rs +++ b/lib/src/view.rs @@ -229,7 +229,7 @@ fn merge_op_heads( let op_heads = dag_walk::unreachable(op_heads, &neighbors_fn, &|op: &Operation| op.id().clone()); let mut op_heads: Vec<_> = op_heads.into_iter().collect(); - op_heads.sort_by_key(|op| op.id().0.clone()); + op_heads.sort_by_key(|op| op.store_operation().metadata.end_time.timestamp.clone()); let first_op_head = op_heads[0].clone(); let mut merged_view = op_store.read_view(first_op_head.view().id()).unwrap();