-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs-only] add locking adr #2701
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As pointed out by @wkloucek I added some comments from my perspective as "WOPI operator".
To be noted the related cs3org/reva#1786 issue, which won't be entirely superseded by a CS3 Lock API.
|
||
**No locking is bad**, because: | ||
|
||
- merging changes from different versions is a pain, since there is no way to calculate differences for most of the files (eg. docx or xlsx files) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An additional item for this scenario (pure hypothetical I know, but for the sake of it):
- no locking breaks the WOPI specs, as the CS3 WOPI server won't be capable to honor the WOPI Lock related operations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, good point.
- locking always with timeout | ||
- Implement WebDAV locking using the CS3 API | ||
- Implement Locking in storage drivers | ||
- Change CS3 WOPI server to use CS3 API locking mechanism |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The semantic of the lock API would need to include the possibility to decorate the lock with some arbitrary metadata. Currently the CS3 WOPI server is stateless and stores some (JWT-encoded) information in the locks for its operations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't it use the general API to store metadata to files in CS3? Or do you mean that it is lock-specific metadata, ie. who locked (should be considered) or when the lock started, or how long? Even that could, if it is in an unique namespace, be stored through the general API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct indeed: the metadata is lock-specific, but locks and files are 1-to-1 so it is "syntactically equivalent" to use the general metadata API, say with a wopilock
xattr.
Yet, there's a semantic catch: as today a user can delete a lock file, with this assumption the user may delete the wopilock
xattr, making the lock totally useless from a WOPI perspective. So for the sake of a Lock API - which on top is expected to be atomic (where implementing cs3org/reva#1786 would help, if the lock is ultimately stored somewhere by the storageprovider) - the lock metadata should stay attached to the lock "object" for the whole lock's lifetime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the user must not have access to this xattr. Good point, we need a distinction between "user-editable" and system meta data.
The lock "object" I think is the file that is locked itself. And that operation does not really have to be atomic, only in the sense that if a lock is created, there must not be another lock exsting. That is a create-if-not-exists operation which in it has somehow to be atomic.
Description
add an ADR about locking
Related Issue
FixesEvaluate File Locking in the WOPI Server #2678, additional discussion needed