maobaolong commented on pull request #920:
URL: https://github.com/apache/hadoop-ozone/pull/920#issuecomment-630844566


   @elek Thank you very mush for the long reply of you, it take me though more, 
the following is my reply:
   
   > I was just not sure how is it possible to use TWO with Ratis. Do you use 
two nodes Ratis cluster? 
   > I am interested if you have more details to share...
   
   I'm very glad you are interested the replication `2` works what i did. In 
fact, the master branch cannot works well with replication `2`, but i really 
did it under the helping of @runzhiwang who is a developer of ratis. 
   
   Firstly, i checkout the current master branch of ratis(commitId: 
60643005d0a6faaa25c1810fac9fcb68cda88c3b) and execute `mvn install ...`, then, 
i did some modification like https://github.com/apache/hadoop-ozone/pull/885 
did, it make me build successful. 
   
   Finally, i did a test under a 3 node Ozone cluster. 
   
   ```bash
   bin/ozone sh key put  -r 2 /myvol/mybucket/NOTICE.txt NOTICE.txt
   bin/ozone admin pipeline  list
   Pipeline[ Id: 69f66a9d-38e5-4c51-8b7e-bcc2052fa9df, Nodes: 
27137460-e588-4d63-bb06-15123772331c{ip: 127.0.0.1, host: localhost, 
networkLocation: /default-rack, certSerialId: 
null}affc3600-f15c-4e42-b4ff-4748f8d0cd5d{ip: 127.0.0.1, host: localhost, 
networkLocation: /default-rack, certSerialId: null}, Type:RATIS, Factor:2, 
State:OPEN, leaderId:27137460-e588-4d63-bb06-15123772331c, 
CreationTimestamp2020-05-19T08:08:35.185Z]
   bin/ozone sh key info /myvol/mybucket/NOTICE.txt 
   {
     "volumeName" : "myvol",
     "bucketName" : "mybucket",
     "name" : "NOTICE.txt",
     "dataSize" : 17540,
     "creationTime" : "2020-05-19T08:02:28.275Z",
     "modificationTime" : "2020-05-19T08:02:29.095Z",
     "replicationType" : "RATIS",
     "replicationFactor" : 2,
     "ozoneKeyLocations" : [ {
       "containerID" : 10,
       "localID" : 104194070824550403,
       "length" : 17540,
       "offset" : 0
     } ],
     "metadata" : { },
     "fileEncryptionInfo" : null
   }
   
   ```
   
   The above test can be successfully too if there are only 2 datanode in Ozone 
cluster.
   
   
   > It has totally different availability guarantee than Ratis/THREE as there 
is no majority just full quorum.
   
   I don't think there is no majority in a Ratis/TWO. In the 2 nodes group, 
there are different timeout before election for each node, when one of them 
achieve the election timeout the node can be a candidate, and `Vote to itself`, 
then ask the peers for vote it, so it can have majority and leader in 2 node 
group.
   
   > I guess it works only if you have two nodes all the time and It couldn't 
work with loosing any of the nodes.
   
   As far as i know, we use ratis pipeline to write block in container, and 
read block though grpc, so if we lose one of two replication, it can be read as 
normal. if fact, i just did a test for this.
   ```bash
   # setup a two node Ozone cluster.
   bin/ozone sh key put  -r 2 /myvol/mybucket/NOTICE.txt NOTICE.txt 
   # kill one of the HddsDatanodeService process.
   bin/ozone sh key get /myvol/mybucket/NOTICE.txt /tmp/foo
   md5sum /tmp/foo
   bb915076158b5871fd2e409a6dbacb1f  tmp/foo
   ```
   
   > In general ...
   Thank you to let me know more about the storage-class approach,  i'm very 
glad to discuss this approach more detail, it is better to have a jira track 
this approach, maybe we need to write a design doc as an attachment.
   
   As we don't know how long we will finish the storage-class approach, and 
i've support 2 replication already, further more, other number of replication 
can be supported under the further tests, i don't know if we can use my 
approach currently, there are 2 factor request in our scenario.
   
   > ChubaoFs
   It is a well known fs from JD.COM, we can get some idea from it, i'd love to 
study it more.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to