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).
This commit is contained in:
Martin von Zweigbergk 2021-01-10 01:17:59 -08:00
parent c4cd12e93e
commit 3df6a92df6

View file

@ -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();