Skip to content
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

Merged
merged 2 commits into from
Oct 29, 2021
Merged

[docs-only] add locking adr #2701

merged 2 commits into from
Oct 29, 2021

Conversation

wkloucek
Copy link
Contributor

@wkloucek wkloucek commented Oct 28, 2021

Description

add an ADR about locking

Related Issue

@update-docs
Copy link

update-docs bot commented Oct 28, 2021

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.

@wkloucek wkloucek changed the title add locking adr [docs-only] add locking adr Oct 28, 2021
Copy link
Contributor

@dragotin dragotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@pmaier1 pmaier1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@wkloucek
Copy link
Contributor Author

@pmaier1 @dragotin If we're coming to a quick decision I'm fine with updating it. If this is a longer discussion we can merge this and update the result later.

Copy link

@glpatcern glpatcern left a 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)

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

Copy link
Contributor

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

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.

Copy link
Contributor

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.

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.

Copy link
Contributor

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.

@wkloucek wkloucek merged commit 164d09a into master Oct 29, 2021
@delete-merged-branch delete-merged-branch bot deleted the adr_locking branch October 29, 2021 11:49
ownclouders pushed a commit that referenced this pull request Oct 29, 2021
Merge: 616bdc2 bb512b1
Author: Willy Kloucek <34452982+wkloucek@users.noreply.github.com>
Date:   Fri Oct 29 13:49:24 2021 +0200

    Merge pull request #2701 from owncloud/adr_locking

    [docs-only] add locking adr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants