-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
Repl 2019-02-25
On “prepare” command, an oplog entry is written for each operation in the transaction with the new root field
{ “inTxn” : true }to denote it is a no-op. Then the primary follows the current “prepare” procedure: reserving an OpTime for Prepare Oplog Entry; preparing the WriteUnitOfWork; and writing down Prepare Oplog Entry, with the reserved OpTime. However, the format of Prepare Oplog Entry will include a new “prepareTransaction” command as its “o” root field rather than an “applyOps” command.
{ "ts": Timestamp(1538534640, 10), "t": NumberLong(1), "op": "c", "ns": "admin.$cmd", // The new prepare command. "o": { "prepareTransaction": 1 }, "lsid": < lsid > , "txnNumber": NumberLong("1"), // Pointing to the previous operation in the transaction. // Assuming there exists an operation at this OpTime for this transaction. "prevOpTime": { "ts": Timestamp(1538534630, 2), "t": NumberLong(1) } }
- is depended on by
-
SERVER-39441 Write the new prepare command on primary
- Closed