vaticle / typedb

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

Simplify isolation manager based on continuous sequence number guarantee #7036

Closed krishnangovindraj closed 2 months ago

krishnangovindraj commented 2 months ago

Usage and product changes

We simplify the isolation manager implementation to operate on a continuous sequencing of the 'global order' of transactions, rather than a discontinuous distributed sequence number.

Implementation

Updates SequenceNumber to be a u64 and uses it in the isolation manager.

The rationale was as follows: The isolation manager lies within the 'Scheduler' component described in the Calvin paper. The scheduler is aware of the total ordering of the transaction within an 'epoch'. We decide the complexity of translation between the sequence numbers generated by the distributed sequencer and a continuous enumeration generated by the schedulers is worth it to prevent the complexity of discontinuous sequence numbers creeping into the rest of the system.

The translation between the distributed & global sequence numbers may require tracking some historic mapping between them.