adoroszlai opened a new pull request #1730:
URL: https://github.com/apache/ozone/pull/1730


   ## What changes were proposed in this pull request?
   
   Container export performs compaction while holding only read lock.  We need 
to acquire write lock to prevent concurrent export changing the files while 
others are packing the same files into tar archive.
   
   This should fix intermittent exception which causes some of the 
`TestDecommissionAndMaintenance` failures:
   
   ```
   java.lang.IllegalArgumentException: refCount: [1]
        at 
com.google.common.base.Preconditions.checkArgument(Preconditions.java:203)
        at 
org.apache.hadoop.ozone.container.common.utils.ContainerCache.removeDB(ContainerCache.java:203)
        at 
org.apache.hadoop.ozone.container.keyvalue.helpers.BlockUtils.removeDB(BlockUtils.java:138)
        at 
org.apache.hadoop.ozone.container.keyvalue.KeyValueContainer.exportContainerData(KeyValueContainer.java:533)
        at 
org.apache.hadoop.ozone.container.keyvalue.KeyValueHandler.exportContainer(KeyValueHandler.java:939)
        at 
org.apache.hadoop.ozone.container.ozoneimpl.ContainerController.exportContainer(ContainerController.java:145)
        at 
org.apache.hadoop.ozone.container.replication.OnDemandContainerReplicationSource.copyData(OnDemandContainerReplicationSource.java:59)
        at 
org.apache.hadoop.ozone.container.replication.GrpcReplicationService.download(GrpcReplicationService.java:56)
   ...
   [grpc-default-executor-9] ERROR replication.GrpcReplicationClient 
(GrpcReplicationClient.java:onError(161)) - Download of container 4 was 
unsuccessful
   ```
   
   https://issues.apache.org/jira/browse/HDDS-4619
   
   ## How was this patch tested?
   
   * added unit test: https://github.com/adoroszlai/hadoop-ozone/runs/1599885042
   * ran `TestDecommissionAndMaintenance` 10x: 
https://github.com/adoroszlai/hadoop-ozone/runs/1599907254


----------------------------------------------------------------
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