kaijchen commented on code in PR #3811:
URL: https://github.com/apache/ozone/pull/3811#discussion_r993060584


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainer.java:
##########
@@ -851,7 +852,15 @@ public boolean scanData(DataTransferThrottler throttler, 
Canceler canceler) {
         new KeyValueContainerCheck(containerData.getMetadataPath(), config,
             containerId, containerData.getVolume());
 
-    return checker.fullCheck(throttler, canceler);
+    // Lock here avoids concurrent RW the block-data table by ongoing
+    // block deletion and the checker.
+    readLock();

Review Comment:
   Yes we have encountered this problem in our testing environment on  
c93d0ea6f9bd82529639ff622bbcdbd3a6f4c659. The BlockDeletingService is throttled 
by the lock, and reports warning like this 
   ```
   2022-10-12 14:42:08,632 [BlockDeletingService#4] WARN 
org.apache.hadoop.hdds.utils.BackgroundService: BlockDeletingService Background 
task execution took 3103753128975ns > 300000000000ns(timeout)
   ```



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

To unsubscribe, e-mail: [email protected]

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