HDDS-5785. containerCreationLock is a severe bottleneck when there are many containers to create #2679
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/HDDS-5785
With this striped lock, the contension is dropped to a low state. The average create container time is dropped from 60s to 1s in the same test.
---ts=2021-09-26 11:48:12;thread_name=ChunkWriter-101-0;id=ec;is_daemon=true;priority=5;TCCL=sun.misc.Launcher$AppClassLoader@6659c656---[1401.227154ms] org.apache.hadoop.ozone.container.keyvalue.KeyValueHandler:handleCreateContainer()+---[0.001033ms] org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos$ContainerCommandRequestProto:hasCreateContainer() #252
+---[7.8E-4ms] com.google.common.base.Preconditions:checkArgument() #261
+---[0.001397ms] org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos$ContainerCommandRequestProto:getContainerID() #263
+---[0.003679ms] org.apache.hadoop.ozone.container.common.impl.ChunkLayOutVersion:getConfiguredVersion() #266
+---[0.001038ms] org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos$ContainerCommandRequestProto:getPipelineID() #268
+---[9.06E-4ms] org.apache.hadoop.ozone.container.keyvalue.KeyValueHandler:getDatanodeId() #269
+---[0.00287ms] org.apache.hadoop.ozone.container.keyvalue.KeyValueContainerData:() #269
+---[0.002747ms] org.apache.hadoop.ozone.container.keyvalue.KeyValueContainer:() #272
+---[0.0041ms] com.google.common.util.concurrent.Striped:get() #277
+---[0.001554ms] org.apache.hadoop.ozone.container.common.impl.ContainerSet:getContainer() #280
+---[1401.138626ms] org.apache.hadoop.ozone.container.keyvalue.KeyValueContainer:create() #281
+---[0.008657ms] org.apache.hadoop.ozone.container.common.impl.ContainerSet:addContainer() #282
+---[0.024103ms] org.apache.hadoop.ozone.container.keyvalue.KeyValueHandler:sendICR() #297
`---[0.002756ms] org.apache.hadoop.hdds.scm.protocolPB.ContainerCommandResponseBuilders:getSuccessResponse() #302