Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
decomposedfs: add locking support (#2460)
* decomposedfs: add locking support Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * add lock implementation, refactor error handling Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * introduce lock ctx Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * add locked error and status code mapping Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * read lockid from opaque into ctx for delete Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * decomposedfs: make delete respect lock Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * ocdav: simplify error code mapping Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * adjust to cs3 lock api update Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * utils: add and read plain opaque entries Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * fix delete lock Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * invalidate stat cache when setting lock Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * fix a few linter items Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * linter happyness Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * ocdav: implment unlock Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * lock caching and unlocking Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * read locks on folders Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * check lock on writes Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * always assume locktype write Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * ocis only supports exclusive locks Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * add precodition failed errtype * handle preconditionfailed in status conversion * omit empty xml tags in lockdiscovery * handle locked status on LOCK * document oc10 lock behaviour as comment * ocdav: handle errors for LOCK and UNLOCK * storage: change fs.Unlock signature * decomposedfs: refactor checkLock * add LookupReferenceForPath comment Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * gateway: ignore unimplemented add/denyGrant response Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * use http.StatusMethodNotAllowed for mkcol error case Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * make hound happy Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * ocdav: be more tolerant with the Lock-Token header Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * ocdav: allow setting infinity timeout Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * ocdav: use custem owner innerxml without href * update expected failures * ocdav: return conflict on missing intermediate target dir Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * decomposedfs: use checkLock() in the rest of cases Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * Do not choke when checking the lock of non-existent nodes * Linter fixes * Refactor: Move lock handling into the node domain * Also delete the lock file when deleting a node * Extract node lock-handling code into separate file, start writing tests * Add missing license header * Fix relocking already-locked nodes. Increase test coverage * Hounds be happy * Add unit tests for ReadLock and RefreshLock * Also cover readLocksIntoOpaque in the tests * Fix linter issue * Do not log full nodes, it's very expensive and not very helpful * Start adding grpc integration tests for locking * Fix setting the lock for file uploads * Allow for locking space-based resources * Make sure to log the error before it's getting overwritten * reuse xml.EscapeText directly Co-authored-by: David Christofas <[email protected]> * decomposedfs: use defer to close file when unlocking resource Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * ocdav: explain why some http states are commented Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * ocdav: use http header status constants Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * clarify add/deny grant log Signed-off-by: Jörn Friedrich Dreyer <[email protected]> * update expected failures Signed-off-by: Jörn Friedrich Dreyer <[email protected]> Co-authored-by: André Duffeck <[email protected]> Co-authored-by: David Christofas <[email protected]>
- Loading branch information