Giter Site home page Giter Site logo

Transaction Ordering about swym HOT 3 OPEN

mtak- avatar mtak- commented on August 21, 2024
Transaction Ordering

from swym.

Comments (3)

mtak- avatar mtak- commented on August 21, 2024

This is a really great question!

It seems that it is possible for two transactions to commit out of order with respect to the recorded times in the EpochLocks. Is this the case?

Yep.

I am pretty sure you get this, but just in case, the goal of swym is to have "Single Lock Atomicity" (SLA) style guarantees. Basically the outcome of those two transactions should only be the same as the purely sequential model - A=2, B=100, or A=101, B=100. It appears you agree that these are the only two outcomes when using swym.

What I hear you saying is that the version numbering on TCell's might not reflect the actual order in which values were published.

  1. Yes. You totally get it :).
  2. No. This out of order publishing cannot affect any other transactions. A is unreadable (due to being locked) by any third transaction for the entire duration of Tx2's commit. So this "in between" state is not observable. It is strange that the versions on the TCell's are effectively backwards from the order in which the writes "appear" to have happened using the SLA model. swym doesn't really utilize version information at a more fine grained level than simply asking the question, "was this value set sometime (doesn't matter when) before the transaction started".

In case you find it interesting (I sure do), a transaction with no read log, like Tx2 is unusual, and effectively has no constraints on it. In theory swym could guarantee that these transactions never fail, however, the commit operation may need a couple retries (due to lock acquiring failing), but the user code would only need to be run once.

Thanks for the great question!

from swym.

mtak- avatar mtak- commented on August 21, 2024

If that doesn't clear things up, feel free to ask follow up questions.

from swym.

mtak- avatar mtak- commented on August 21, 2024

Maybe looking at some cases for a Tx3 would also help.

Tx3 starts when EpochClock=0:
It can only read values A=start value, B=1

Tx3 starts when EpochClock=2:
It can only read values A=2, B=100

nontrivial case Tx3 starts when EpochClock=1:
It can only read B=100, and A is totally unreadable due to the lock being held on A, or A having a version number of 2. Therefore this transaction is doomed to retry.

from swym.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.