From: Reed H. <fis...@gm...> - 2010-08-26 02:38:57
|
Hi: I am very concerned with some problems about Write/Read operations: 1. what is write operation waiting for when it return? 2. goal = 3, client <=> cs1 <=> cs2 <=> cs3 , if writing to cs2 or cs3 failed, how to deal with that? 3. What consistency level: Strong Consistency or Weak Consistency or Eventually Consistency (see en.wikipedia.org/wiki/Eventual_consistency ) 4. How to ensue data consistency? I'v almost read every page in moosefs.org and every mail in mail-lists. but little information about w/r operation detail. I find some information from mail list " With goal=3 data transmission looks like this: client <=> cs1 <=> cs2 <=> cs3 client waiting write operation end util : cs1 finish writing, and cs2 finish writing, and cs3 finish writing. In this case, when client finish writing, MFS have 3 copies of data. Your point B is closer to the real writing process. But the client doesn’t wait with sending data. It sends new data before it receives confirmation of writing previous data. Only removing from write queue takes place after writing confirmation. " I also read the source with the help of SourceInsight, trace the code from mfs_write() ---> write_data(), in write_data(), I see source *if (status==0) {* * **if (offset+size>id->maxfleng) {** **// move fleng* * **id->maxfleng = offset+size;* * **}* * **id->writewaiting++;* * **while (id->flushwaiting>0) {* * **pthread_cond_wait(&(id->writecond),&glock);* * **}* * **id->writewaiting--;* * **}* * **pthread_mutex_unlock(&glock);* * **if (status!=0) {* * **return status;* * **}* then call write_block() to send write operation to jqueue, thread: write_worker() will send the real data. Does write operation will wait on *pthread_cond_wait() above?? * In mfs_read() function, I find many functions about write, such as write_data_flush(), write_data_end, write_data_flush_inode. It make me confused. Would please provide more documents about Write/Read operation, thanks a lot! -- --------------------------------------------------------------- by fishwarter |