Project

General

Profile

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

Revision 6 (Li Wang, 06/15/2015 10:53 AM) → Revision 7/25 (Li Wang, 06/15/2015 11:06 AM)

h1. Multi-object transaction support 

 *Summary* 
 This is for multi-object transaction support. 

 *Owners* 

 Li Wang (Ubuntukylin) 
 Yunchuan Wen (Ubuntukylin) 
 Name 

 *Interested Parties* 
 If you are interested in contributing to this blueprint, or want to be a "speaker" during the Summit session, list your name here. 
 Name (Affiliation) 
 Name (Affiliation) 
 Name 

 *Current Status* 
 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? 

 *Detailed Description* 
 (1) Allow client to define the following struct,  
 struct MultiObjectTransaction { 
   
  map<hobject_t, ObjectWriteOperation> object_ops; 
   
  hobject_t master; 
 }; 
 based on this, client could send a group of ops through MOSDOp to the PG coressponding to master object, call it master PG, or MASTER in short 

 (2) Master PG receive the MOSDOp from client, extract the ObjectWriteOperations by on objects belonging to different PGs, and send them to corresponding PGs, call them slave PGs, or SLAVE in short 

 (3) SLAVE receive MOSDOp from MASTER, if there are pending conventional single-object transactions with operations share 
 the operation on the same object, wait until them finished; If there are pending multi-object transactions with share the operations operation 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); lock); Otherwise, contruct the transaction in the conventional way, return MASTER master PG PREPARE_ACK, if error occured, 
 for example, a 'read-then-comparation' read then comparation failed, then return MASTER error number 

 (4) If MASTER receive error from SLAVE, it send ROLLBACK to all SLAVES, cancel the transaction, return client error 

 (5) MASTER collect all PREPARE_ACK, send SLAVES PREPARE_COMMIT 

 (6) SLAVE receive PREPARE_COMMIT from MASTER, write pending transaction into PG metadata, return MASTER PREPARE_COMMIT_ACK 

 (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 to its own data objects, submit the transaction to ObjectStore, then return client ACK, enable client to return from write operation, and send SLAVES COMMIT  

 (8) SLAVE receive COMMIT, submit the pending transaction to ObjectStore, after the transaction finished (written to the real objects), object), delete the transaction from PG metadata, return MASTER COMMIT_ACK 

 (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 





 *Work items* 
 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. 

 *Coding tasks* 
 Task 1 
 Task 2 
 Task 3 

 *Build / release tasks* 
 Task 1 
 Task 2 
 Task 3 

 *Documentation tasks* 
 Task 1 
 Task 2 
 Task 3 

 *Deprecation tasks* 
 Task 1 
 Task 2 
 Task 3