whbing commented on code in PR #6127:
URL: https://github.com/apache/ozone/pull/6127#discussion_r1471408463
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java:
##########
@@ -749,14 +749,10 @@ ContainerCommandResponseProto handleReadChunk(
@VisibleForTesting
void checkContainerIsHealthy(KeyValueContainer kvContainer, BlockID blockID,
Type cmd) {
- kvContainer.readLock();
- try {
- if (kvContainer.getContainerData().getState() == State.UNHEALTHY) {
- LOG.warn("{} request {} for UNHEALTHY container {} replica", cmd,
- blockID, kvContainer.getContainerData().getContainerID());
- }
- } finally {
- kvContainer.readUnlock();
+ // No kvContainer.readLock() for performance optimization
+ if (kvContainer.getContainerData().getState() == State.UNHEALTHY) {
Review Comment:
https://github.com/apache/ozone/blob/bd1cf6844a083515f8927c5df9b7b2642e3cf183/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingTask.java#L139-L143
`BlockDeletingTask#handleDeleteTask` will hold
`KeyValueContainer.writeLock()`, and sometimes it takes a long time, as follow
logs:
```java
2024-01-04 16:30:16,752 [BlockDeletingService#8] INFO
org.apache.hadoop.ozone.container.keyvalue.statemachine.background.BlockDeletingTask:
Max lock hold time (1000 ms) reached after 1390 ms. Completed 1 transactions,
deleted 0 blocks. In container: 5455053. Releasing lock and resuming deletion
later.
2024-01-04 17:01:16,897 [BlockDeletingService#1] INFO
org.apache.hadoop.ozone.container.keyvalue.statemachine.background.BlockDeletingTask:
Max lock hold time (1000 ms) reached after 1292 ms. Completed 1 transactions,
deleted 0 blocks. In container: 5458979. Releasing lock and resuming deletion
later.
```
This will result in a long waiting when the data in this container is read.
--
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]