AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Ms sql deadlock graph print1/13/2024 And this is why a cycle is impossible: it would have to somehow get back from a later resource to an earlier resource, but all edges lead forward only. In general, if everybody follows a rule to acquire resources in the same order, the picture will always look like all the paths follow this order. This picture can be interpret as two paths leading from file A to file B. If we cut ABe’s transaction into two independent transactions, then the server would be allowed to behave as if the order was:īut this is not a deadlock cycle – note the direction of arrows, they do not form a cycle! □Īlso, this picture depicts a violation of assumption that Write access to file A should be exclusive, as we can see two arrows going out of file A, so we have a contradiction with our assumptions. Remember that to achieve the promised serializability server has to come up with a convincing lie about the order of all transactions. Perhaps it is instructive to first answer a lingering question: Why can’t one of them simply release the Read access right as soon as they are done reading the first file and before requesting the Write access right for next file? For example, why not let ABe release his Read access right to file A, so that BAsil can obtain the Write access right to file A, finish his work, releasing all held access rights and thus letting ABe continue without any further delays? This would surely eliminate the deadlock, so why not do this seemingly smart thing? The short answer is: that would effectively be undistinguishable from cutting a transaction into two smaller ones, which might have surprising results. In InnoDB Data Locking – Part 1 “Introduction” we’ve seen a simple example of scenario in which two people can not finish what they’ve started, because one is waiting for the other to release a resource which is currently in use by the other and vice-versa: ABe already had Read access to file A and requested Write access to file B, but had to wait for BAsil to first release his Read access rights for this file, however BAsil can not do that until he finishes what he planned, which was to obtain Write access to file A, currently in use by ABe. Summary of this post: In this post I’ll describe how deadlock detection works in InnoDB 8.0.18, and thus introduce following concepts :
0 Comments
Read More
Leave a Reply. |