Status

Current state[One of "Under Discussion", "Accepted", "Rejected"]

Discussion thread: 

JIRA or Github Issue: 

Released: <Doris Version>

Google Doc: <If the design in question is unclear or needs to be discussed and reviewed, a Google Doc can be used first to facilitate comments from others.>

Motivation

Now, the performance of metadata processing such as creating and truncating tables or adding columns to tables is not satisfactory when table have many partitions or tablets,

and when user insert into table they need to add partition before which is not so convenient for user to use.  By the way, the performance for ReentrantReadWriteLock is also not so good

while many readers exist.

Related Research

https://www.overops.com/blog/java-8-stampedlocks-vs-readwritelocks-and-synchronized/ 

https://www.javaspecialists.eu/talks/jfokus13/PhaserAndStampedLock.pdf

Detailed Design

  1. use StampLock instead of ReentrantReadWriteLock
  2. Batch create tablet
  3. Only once EditLog write for unique Id generator
  4. dynamic partition generating for load or insert

Scheduling

specific implementation steps and approximate scheduling.