# Percolator case study (Continue...)

+ prewrite:


![left](./student-guide/diagram/11-example-02-01.png)
------------------------------------------------------------
The first stage of prewrite
1. Write data under version 7 Current data $3
2. Select one of the Keys to be written as the Primary Key of the current transaction to indicate the state of the thing;
3. Step 1 and Step 2 are atomic operations, represented by the same color box;
4. Write data with key joe in version 7, “7: $9”
5. At the same time, write the lock corresponding information in lock, which is the primary key in step 2;
6. Steps 4 and 5 are atomic operations, represented by the same color box;
7. The transaction involves all keys being committed in the first phase.
