Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENG-4079: #673: Add read intents for serializable isolation during write
Summary: While running serializable transaction we could have read-modify-write operations. Besides adding write intents, those operations should also add read intents to detect conflict between transactions correctly. This revision implements adding these read intents and also contains the following fixes/updates required by serializable isolation: 1) Avoid sending read time in a transaction with serializable isolation. Serializable transactions effectively perform all reads at commit time, because read intents prevent values that a serializable transaction has read from changing until the transaction commits. 2) Acquire read+write locks while adding read+write intents in a transaction with serializable isolation. ?) Transaction with serializable isolation always conflict with committed transaction. [@sergei -- this needs to be removed, right?] 3) Resolve transaction conflicts before performing read operations for a read-modify-write operation, not the other way around. This ensures that no conflicting transactions whose provisional records were already present when our transaction started (or were added before our transaction acquired all its locks) can commit asynchronously and invalidate the results of our transaction's read operations. Test Plan: ybd --cxx-test serializable-txn-test --gtest_filter SerializableTxnTest.Increment Reviewers: timur, robert, mikhail Reviewed By: mikhail Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D5930
- Loading branch information
Showing with 561 additions and 179 deletions.
- +1 −1 java/yb-cql/src/test/java/org/yb/cql/TestIndex.java
- +10 −7 src/yb/client/async_rpc.cc
- +9 −6 src/yb/client/ql-transaction-test.cc
- +131 −0 src/yb/client/serializable-txn-test.cc
- +11 −2 src/yb/client/transaction.cc
- +6 −0 src/yb/common/transaction.cc
- +6 −0 src/yb/common/transaction.h
- +1 −1 src/yb/common/wire_protocol-test-util.h
- +70 −26 src/yb/docdb/conflict_resolution.cc
- +2 −1 src/yb/docdb/conflict_resolution.h
- +36 −9 src/yb/docdb/doc_operation.cc
- +40 −8 src/yb/docdb/doc_operation.h
- +4 −4 src/yb/docdb/doc_write_batch.cc
- +63 −45 src/yb/docdb/docdb.cc
- +8 −2 src/yb/docdb/docdb.h
- +4 −2 src/yb/docdb/docdb.proto
- +7 −10 src/yb/docdb/intent.h
- +2 −1 src/yb/docdb/intent_aware_iterator.cc
- +4 −2 src/yb/tablet/operations/write_operation.cc
- +11 −3 src/yb/tablet/operations/write_operation.h
- +88 −34 src/yb/tablet/tablet.cc
- +6 −0 src/yb/tablet/tablet_peer.cc
- +15 −12 src/yb/tablet/transaction_coordinator.cc
- +4 −3 src/yb/tserver/tablet_service.cc
- +22 −0 src/yb/util/status.h
Oops, something went wrong.