Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongo Server Side Transaction handles #6

Merged
merged 14 commits into from
Apr 10, 2019
Merged

Commits on Feb 27, 2019

  1. Use the globalsign testing harness.

    This should allow supporting more versions of Mongo than the existing
    mgo driver.
    jameinel committed Feb 27, 2019
    Configuration menu
    Copy the full SHA
    a71e200 View commit details
    Browse the repository at this point in the history
  2. Fix mixed whitespace issues.

    jameinel committed Feb 27, 2019
    Configuration menu
    Copy the full SHA
    9f9c39e View commit details
    Browse the repository at this point in the history
  3. More tests that fail with Mongo 4.0.

    Copying over the filterDBs changes and EnsureIndex fixes from
    globalsign/mgo.
    jameinel committed Feb 27, 2019
    Configuration menu
    Copy the full SHA
    2ba6a22 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d4f6294 View commit details
    Browse the repository at this point in the history
  5. Update Session to support tracking transactions.

    Currently Abort is not supported, and it only supports Insert
    operations, but the basic layout is plausible and seems like it will
    work.
    jameinel committed Feb 27, 2019
    Configuration menu
    Copy the full SHA
    a4146d4 View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2019

  1. Implement AbortTransaction.

    Interestingly, you can't see the documents that you've inserted in the
    session that inserted them...
    jameinel committed Feb 28, 2019
    Configuration menu
    Copy the full SHA
    e763a98 View commit details
    Browse the repository at this point in the history
  2. Start trying to implement query side of transactions.

    Need to pass in lsid and txnNumber to enable visibility of queries for
    things that you just created.
    jameinel committed Feb 28, 2019
    Configuration menu
    Copy the full SHA
    2232dc5 View commit details
    Browse the repository at this point in the history
  3. Implement support for Find and Update.

    Looks like we finally found the right attributes for where to put lsid
    and txnNumber. We now see the right visibility for updates and
    insertions. Still need to do Upsert/UpdateAll, etc.
    jameinel committed Feb 28, 2019
    Configuration menu
    Copy the full SHA
    79b643f View commit details
    Browse the repository at this point in the history
  4. Cleanup the tests a bit.

    jameinel committed Feb 28, 2019
    Configuration menu
    Copy the full SHA
    482a2df View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    73f9a11 View commit details
    Browse the repository at this point in the history
  6. Change away from annotating Ops.

    Instead, all the places that were putting a transaction on the op before
    submitting it, just use the code path that submits the request to deal
    with the transaction.
    jameinel committed Feb 28, 2019
    Configuration menu
    Copy the full SHA
    a15af30 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2019

  1. Fix multithreading issues.

    Also handle if a Session is Closed with an active transaction.
    Rework a lot of the Commit/Abort code paths, and make use of the
    Session.m object to properly handle Start/Abort/Commit.
    
    Needs tests around Insert/Update/Upsert/Remove/Find and
    Start/Commit/Abort sequencing.
    jameinel committed Mar 7, 2019
    Configuration menu
    Copy the full SHA
    7cd52d4 View commit details
    Browse the repository at this point in the history
  2. (broken) attempt at synchronizing Find/Remove/Insert.

    These don't actually work because while there may not be a *data* race
    in memory, they race eachother for things like 'who is the first to
    start the transaction'. They also potentially race around 'is the
    transaction finished'.
    
    This might be good enough, as we don't really want to try to make it
    possible to do things multithreaded, we just don't want the memory
    structures to get corrupted.
    
    One caveat is that the TXN isn't actually started until the first
    operation, so it may be that we want to support an outer routine calling
    StartTransaction, but it forks off a bunch of helper routines that
    are all issued inside the transaction. If we want that, then the best
    thing is to probably put a Mutex on the 'transaction' object itself. And
    then we need to hold the mutex while the query is being performed, so
    that we know we really have issued 'startTransaction' on the remote
    side.
    jameinel committed Mar 7, 2019
    Configuration menu
    Copy the full SHA
    acae056 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2019

  1. Cleanup multithreading support.

    Clone doesn't copy the session or transaction, that way we don't have to
    worry about txn updates, but also we certainly think that Copy() should
    have its own transaction identity. And it makes sense that Clone should
    too. Especially we don't want Copy during a txn to behave differently
    than Copy outside of a transaction.
    
    Get rid of txn.finished. Let the server decide if the transaction is
    active.
    jameinel committed Mar 10, 2019
    Configuration menu
    Copy the full SHA
    481d1d5 View commit details
    Browse the repository at this point in the history