slfan1989 commented on PR #4367:
URL: https://github.com/apache/hadoop/pull/4367#issuecomment-1152828770
@Hexiaoqiao @ZanderXu @tomscut
I still have some doubts about this.
1. I still hope ZanderXu Can provide deadlock exception stack error
information, I will continue to try to reproduce this problem in this part.
2. I read the code of testSynchronousEviction carefully, this code uses the
special storage strategy LAZY_PERSIST, This strategy will asynchronously flush
memory blocks to disk. LazyWriter takes care of this work.
Part of the code is as follows
```
private boolean saveNextReplica() {
RamDiskReplica block = null;
FsVolumeReference targetReference;
FsVolumeImpl targetVolume;
ReplicaInfo replicaInfo;
boolean succeeded = false;
try {
block = ramDiskReplicaTracker.dequeueNextReplicaToPersist();
if (block != null) {
try (AutoCloseableLock lock =
lockManager.writeLock(LockLevel.BLOCK_POOl,
block.getBlockPoolId())) {
replicaInfo = volumeMap.get(block.getBlockPoolId(),
block.getBlockId());
.....
```
If ZanderXu's judgment is correct, will this code also deadlock?
3.I always have a question, why we first add blockpool readlock, and then
add volume write lock, how is the order of this lock derived?
4.I checked lockManager.writeLock(LockLevel.BLOCK_POOl,
block.getBlockPoolId()), and I found that when adding volume, the writeLock of
BLOCK_POOl is also used, so will it also deadlock?
> in conclusion
I don't think this is a deadlock. Is it because createRow got the read lock,
which caused evictBlocks to get the write lock for a long time, and then
exceeded the waiting time of the junit test, which eventually led to an error.
I think to solve this problem completely, we also need to look at the
processing logic of LazyWriter. It should not be enough to just modify
evictBlocks.
--
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]