vaticle / typedb

TypeDB: the polymorphic database powered by types
https://typedb.com
Mozilla Public License 2.0
3.72k stars 338 forks source link

Fix commit-time cleanup of chains of empty relations #6983

Closed flyingsilverfin closed 4 months ago

flyingsilverfin commented 4 months ago

Usage and product changes

In cases where chains of empty relations existed, for example r1 -> r2 -> r3... -> rX, it was possible that TypeDB did not correctly execute the automatic relation cleanup due to the order the relations happened to be traversed.

TypeDB now retries the commit-time cleanup of empty relations until there are no new deletions. We accept the higher runtime cost of this operation since 1) we expect the number of modified relations in a transaction to be relatively small (no more than thousands) 2) relation chains are relatively rare 3) relation chains that must clean up in dependent fashion are extremely rare.

Implementation

vaticle-bot commented 4 months ago

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Trivial Change

Code

Architecture