Ivan Andika created HDDS-16167:
----------------------------------

             Summary: Create Ozone development best practice documentation
                 Key: HDDS-16167
                 URL: https://issues.apache.org/jira/browse/HDDS-16167
             Project: Apache Ozone
          Issue Type: Improvement
            Reporter: Ivan Andika
            Assignee: Ivan Andika


In the course of Ozone project lifetime, we have encountered a lot of issues 
and learned some patterns to follow and anti patterns to avoid.

We should start writing a best opiniated development practice of Ozone to 
prevent contributors falling to the same trap.

We can split the best practices to per-component (e.g. RocksDB, Ratis, OM, SCM, 
DN, etc) or conceptual (Concurrency, etc). Note that the focus should be on 
Ozone related logic and should be concise, other general patterns like in 
"Effective Java" or "Java Concurrency in Practice" should be avoided unless 
they are directly related to Ozone issues

Example best practices
 * RocksDB
 ** Do NOT hold a lock while doing a RocksDB range query (e.g. seek, iterate)
 ** Flatten a RocksDB schema so that each RocksDB entry size is bounded
 *** We have learned this with issues like very large MPU table entry, Ozone 
key versions that refer to the previous versions, Deleted table that contains 
multiple versions of blocks
 ** Do NOT set exclusiveManualCompaction
 * Ratis
 ** Do NOT block in the Ratis notification API since it will can cause Ratis to 
be stuck

 *** This includes Thread.join, etc
 *** Do not submit another Ratis request in a Ratis notification API since this 
can cause Ratis deadlock



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to