store: add locking around cas diskv #460
Comments
@jonboulle I'm willing to work on this after #362, #392, #393. Honestly I already have some patches but, opening a PR will mean a lot of rebasing between this and the other PRs. Just let me know what you'll prefer. Tnx! |
This patch adds locking like explained in rkt#460. To avoid deadlocks the diskv locks shouldn't be taken inside the db access (if needed).
This patch adds diskv stores locking like explained in rkt#460. To avoid deadlocks the diskv locks shouldn't be taken inside the db access code.
This patch adds diskv stores locking like explained in rkt#460. To avoid deadlocks the diskv locks shouldn't be taken inside the db access code.
This patch adds diskv stores locking like explained in rkt#460. To avoid deadlocks the diskv locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. In future also the tree store will be part of an image. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code.
This patch adds image and tree store locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code. The tree store is kept separate from the image for various reasons: * It can be composed by multiple images if the upper image has dependencies * It's rendered and removed separately from image. For this reason also the tree store locks are different from the image locks. The tree store locks should be taken before the image locks.
This patch adds image and tree store locking like explained in rkt#460. An image is composed by the ACI file in the blob store and it's imageManifest in the imageManifest store. This means that a lock on an image covers multiple elements. For this reason the keyLock functions are used to take a lock. To avoid deadlocks the image locks shouldn't be taken inside the db access code. The tree store is kept separate from the image for various reasons: * It can be composed by multiple images if the upper image has dependencies * It's rendered and removed separately from image. For this reason also the tree store locks are different from the image locks. The tree store locks should be taken before the image locks.
The proposed implementation (and also the tree store locking) has landed in #571. Testing all the possible locking combinations between multiple processes is quite difficult but should be useful to find a way to do reproducible tests and maybe add it to a test suite like #600. |
I believe this is implemented in #571 and #603. Is that so? @sgotti @jonboulle |
I think so but would be good to get an ack from sgotti. |
@jonboulle @iaguis Correct. Sorry but I forgot to close this! |
Thanks! Closing. |
As a reminder (I'll post patches when the various #392, #393 lands) there's the need for some locking around cas diskv stores. Now they are needed to avoid multiple processes writing the same image and image manifest to the store and also when (in future) a delete functions will be added to the store.
This is my proposal:
Some places where locking is needed:
Functions like GetACI (#395) can call multiple times the DB functions and the diskv functions (like GetImageManifest) so if we want to avoid any problem we should take a global lock. Not doing this means that during GetACI loop an image or image manifest could be added or removed. I don't think this is a problem as this is checked and the error is handled.
The text was updated successfully, but these errors were encountered: