sodonnel commented on code in PR #6127:
URL: https://github.com/apache/ozone/pull/6127#discussion_r1472542310
##########
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:
I realized after I wrote the above, the the synchronization on the getter is
probably not an issue. The problem root cause is the write lock being held for
a long time by the delete thread. It would still be best to avoid the
synchronization too if we can just remove the call entirely. The log message
doesn't add much value compare to the cost of it via serialization.
--
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]