Project

General

Profile

Rados - multi-object transaction support » History » Version 7

Li Wang, 06/15/2015 11:06 AM

1 1 Li Wang
h1. Multi-object transaction support
2 2 Li Wang
3
*Summary*
4
This is for multi-object transaction support.
5
6
*Owners*
7
8
Li Wang (Ubuntukylin)
9 3 Li Wang
Yunchuan Wen (Ubuntukylin)
10 2 Li Wang
Name
11
12
*Interested Parties*
13
If you are interested in contributing to this blueprint, or want to be a "speaker" during the Summit session, list your name here.
14
Name (Affiliation)
15
Name (Affiliation)
16
Name
17
18
*Current Status*
19
Please describe the current status of Ceph as it relates to this blueprint.  Is there something that this replaces?  Are there current features that are related?
20
21
*Detailed Description*
22 5 Li Wang
(1) Allow client to define the following struct, 
23 4 Li Wang
struct MultiObjectTransaction {
24 7 Li Wang
  map<hobject_t, ObjectWriteOperation> object_ops;
25
  hobject_t master;
26 1 Li Wang
};
27 7 Li Wang
based on this, client could send a group of ops through MOSDOp to the PG coressponding to master object, call it MASTER
28 5 Li Wang
29 7 Li Wang
(2) Master receive MOSDOp from client, extract ObjectWriteOperations by PGs, and send them to corresponding PGs, call them SLAVE
30 1 Li Wang
31 7 Li Wang
(3) SLAVE receive MOSDOp from MASTER, if there are pending conventional single-object transactions with operations on the same object, wait until them finished; If there are pending multi-object transactions with the operations on the same object, return EAGAIN (we can not wait here, otherwise may dead lock, see http://article.gmane.org/gmane.comp.file-systems.ceph.devel/23783); Otherwise, contruct the transaction in the conventional way, return MASTER PG PREPARE_ACK, if error occured, for example, a 'read-then-comparation' failed, return MASTER error
32 1 Li Wang
33 6 Li Wang
(4) If MASTER receive error from SLAVE, it send ROLLBACK to all SLAVES, cancel the transaction, return client error
34
35
(5) MASTER collect all PREPARE_ACK, send SLAVES PREPARE_COMMIT
36
37
(6) SLAVE receive PREPARE_COMMIT from MASTER, write pending transaction into PG metadata, return MASTER PREPARE_COMMIT_ACK
38
39 7 Li Wang
(7) MASTER collect all PREPARE_COMMIT_ACK, construct a transaction, including a write to PG metadata to indicat the transaction COMMITTING, and the writes operations on its own data objects, submit the transaction to ObjectStore, then return client ACK, enable client to return from write operation, and send SLAVES COMMIT 
40 6 Li Wang
41 7 Li Wang
(8) SLAVE receive COMMIT, submit the pending transaction to ObjectStore, after the transaction finished (written to the real objects), delete the transaction from PG metadata, return MASTER COMMIT_ACK
42 6 Li Wang
43
(9) MASTER collect COMMIT_ACK, return client COMMIT, to indicate the transaction has been really finished, enable client to do read, delete the transaction from the PG metadata
44
45 5 Li Wang
46
47
48 2 Li Wang
49
*Work items*
50
This section should contain a list of work tasks created by this blueprint.  Please include engineering tasks as well as related build/release and documentation work.  If this blueprint requires cleanup of deprecated features, please list those tasks as well.
51
52
*Coding tasks*
53
Task 1
54
Task 2
55
Task 3
56
57
*Build / release tasks*
58
Task 1
59
Task 2
60
Task 3
61
62
*Documentation tasks*
63
Task 1
64
Task 2
65
Task 3
66
67
*Deprecation tasks*
68
Task 1
69
Task 2
70
Task 3