3 ms·
This is my understanding of what a G2-Item Anti-dependecy Cycle is from the linked paper example: -- Given (roughly) the following transactions: -- Tran
by micimize 6y ago
This is my understanding of what a G2-Item Anti-dependecy Cycle is from the linked paper example:
-- Given (roughly) the following transactions:
-- Transaction 1 (SELECT, T1)
with all_employees as (
select sum(salary) as salaries
from employees
),
department as (
select department, sum(salary) as salaries
from employees group by department
)
select sum(all_employees.salaries) - sum(department.salaries);
-- Transaction 2 (INSERT, T2)
insert into employees (name, department, salary)
values ('Tim', 'Sales', 70000);
-- G2-Item is where the INSERT completes between all_employees and department,
-- making the SELECT result inconsistent
This is called an "anti-dependency" issue because T2 clobbers the data T1 depends on before it completes.
They say Elle found 6 such cases in 2 min, which I'm guessing is a "very big number" of transactions, but can't figure out exactly how big that number is based on the included logs/results.
Also, "Elle has found unexpected anomalies in every database we've checked"
- aphyr 6y agoYeah, it was relatively infrequent in that particular workload--dramatically less than PostgreSQL's "repeatable read" exhibited. These histories are roughly 15K successful transactions long--see the stats field in results.edn. I'm hesitant to make strong statements about frequency, because I suspect this kind of thing depends strongly on workload, but I would hazard a gueesssss that it's not super common.