sodonnel commented on code in PR #6127:
URL: https://github.com/apache/ozone/pull/6127#discussion_r1471348176
##########
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:
Are you seeing performance problems when the container is unhealthy, along
with a lot of log messages?
This lock is on a container, not "all containers at the same time", so do
you also have a very high volume of requests for the same block?
At the very least, we should not log under a lock, as logging can be slow,
but I would like to understand more about the problem before just removing the
lock. On first look, it does not seem like it should be a problem.
--
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]