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

MH-13244 Improve concurrency of OAIPMH republication #581

Conversation

KatrinIhler
Copy link
Member

Remove the snapshot after removing the episode ACL and move the whole step to the AssetManagerUpdatedEventHandler so that the likelihood that two OAIPMH distribution jobs run concurrently for the same mediapackage (which can result in a lost update) is minimized. (See MH-13233.)

@KatrinIhler KatrinIhler force-pushed the t/MH-13244-oaipmh-republication-concurrency-problem branch from 33a90ea to b1b158a Compare November 21, 2018 10:41
@staubesv
Copy link
Contributor

staubesv commented Dec 6, 2018

Hi @KatrinIhler

I've just had a look at this pull request. Here some comments:

  • The issue title is not really describing what this change does. While I know that OAI-PMH is the reason for the change, this change is not directly related to OAI-PMH and has the potential to improve other things. @lkiesow In case Opencast is configured to do ACL merging of event and series ACLs, this patch seems quite a must, doesn't it?

  • Personally, I would recommend not to apply this change to r/4.x (implies 5.x and 6.x). It seems quite risky for a maintenance release to me.

Anyway, looking forwards to see this in production ;-)

@lkiesow
Copy link
Member

lkiesow commented Dec 6, 2018

Personally, I would recommend not to apply this change to r/4.x (implies 5.x and 6.x). It seems quite risky for a maintenance release to me.

From what it seems like, there will not even be another 4.x release. 4.x EOL is in four days and no release is planned at the moment.

Re ACL: I'll take a look at it…

@staubesv
Copy link
Contributor

staubesv commented Dec 7, 2018

@lkiesow What I mean is that if the series ACL and the event ACL are to be both considered (ACL merging), you certainly don't want the episode ACL to be removed when updating the series ACL.

@lkiesow
Copy link
Member

lkiesow commented Dec 7, 2018

@staubesv, the override parameter existed before. That hasn't changed.
It's just that there might have been a possible concurrency side-effect.
Hence, the title and description make sense.

@KatrinIhler KatrinIhler force-pushed the t/MH-13244-oaipmh-republication-concurrency-problem branch from b1b158a to 34e2b42 Compare December 12, 2018 15:26
@KatrinIhler KatrinIhler changed the base branch from r/4.x to r/5.x December 12, 2018 15:26
@KatrinIhler
Copy link
Member Author

@staubesv Rebased the PR, ready for review again!

@@ -882,11 +883,13 @@ protected MetadataList deserializeMetadataList(String json) throws ParseExceptio
@Produces({ "application/json", "application/v1.0.0+json" })
@RestQuery(name = "updateseriesacl", description = "Updates a series' access policy.", returnDescription = "", pathParameters = {
@RestParameter(name = "seriesId", description = "The series id", isRequired = true, type = STRING) }, restParameters = {
@RestParameter(name = "acl", isRequired = true, description = "Access policy", type = STRING) }, reponses = {
@RestParameter(name = "acl", isRequired = true, description = "Access policy", type = STRING),
@RestParameter(name = "override", isRequired = false, defaultValue = "false", description = "If true the series ACL will take precedence over any existing episode ACL", type = STRING)}, reponses = {
Copy link
Contributor

@staubesv staubesv Dec 12, 2018

Choose a reason for hiding this comment

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

I hate to say it, but this is a change to the External API which we should not do without introducing a new minor version of the External API.

Can you somehow split this out of this PR and ensure that the External API will still behave the same as before?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I don't think this changes anything - if the override parameter isn't used here, it defaults to false, which is the same behavior as before since the override happened not in the series service but in the ACLService which isn't used by the External API.

Copy link
Contributor

Choose a reason for hiding this comment

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

It does introduce the form parameter "override" to the request PUT /api/series/{series_id}/acl which is an API change. Without introducing a new version of the External API, there would then be different versions of 1.1.0, for example: One 1.1.0 that does not support this parameter, and one 1.1.0 that does.
But that implies that a client cannot determine whether the parameter override is supported based on the version of the External API as returned by /api/versions.
Besides that, you should update the specificaiton of the External API (https://docs.opencast.org/develop/developer/api/series-api/#put-apiseriesseries_idacl).

I suggest to remove the new argument and just default "override" to whatever makes it behave the same as before.

Later, we can introduce the parameter "override" in version 1.2.0 of the External API. For now, a JIRA issue ("Add parameter override to PUT /api/series/{series_id}/acl") should do.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, I'm gonna update this PR accordingly.

@KatrinIhler KatrinIhler force-pushed the t/MH-13244-oaipmh-republication-concurrency-problem branch from 34e2b42 to ed7c045 Compare January 7, 2019 17:24
Remove the snapshot after removing the episode ACL so that the
likelyhood that two OAIPMH distribution jobs run concurrently for
the same mediapackage (which can result in a lost update) is minimized.
@KatrinIhler KatrinIhler force-pushed the t/MH-13244-oaipmh-republication-concurrency-problem branch from ed7c045 to ac37bfa Compare January 7, 2019 17:31
@KatrinIhler
Copy link
Member Author

@staubesv I removed the part affecting the external API. Once this is merged I can create a separate PR for develop that reintroduces this (or is there a fixed point in time when the External API is updated?)

@staubesv
Copy link
Contributor

staubesv commented Jan 8, 2019

@KatrinIhler Thanks! There is not really a fixed point for the introduction of new minor versions of the External API. As a minor version implies added functionality, the only restriction is that the patch needs to go to develop. While a new version is in progress on develop, everybody else can take the chance to add backwards-compatible changes to that version if required.

KatrinIhler referenced this pull request in KatrinIhler/opencast Jan 9, 2019
KatrinIhler referenced this pull request in KatrinIhler/opencast Jan 9, 2019
@gregorydlogan gregorydlogan merged commit ac37bfa into opencast:r/5.x Jan 16, 2019
@gregorydlogan gregorydlogan self-assigned this Jan 16, 2019
@@ -51,6 +51,7 @@
private final Boolean optOut;
private final String element;
private final String elementType;
private final Boolean overrideEpisodeAcl;
Copy link
Member

Choose a reason for hiding this comment

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

This, unfortunately, broke sending any series related messages in develop.
The issue is fixed by pull request #659.
Please avoid using any Objects except Strings in these message items.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for noticing, I'll try to keep this in mind for the future.

@KatrinIhler KatrinIhler deleted the t/MH-13244-oaipmh-republication-concurrency-problem branch February 7, 2019 13:12
KatrinIhler referenced this pull request in KatrinIhler/opencast Feb 18, 2019
KatrinIhler referenced this pull request in KatrinIhler/opencast Feb 19, 2019
KatrinIhler referenced this pull request in KatrinIhler/opencast Feb 19, 2019
KatrinIhler referenced this pull request in KatrinIhler/opencast Feb 28, 2019
KatrinIhler referenced this pull request in KatrinIhler/opencast Feb 28, 2019
KatrinIhler referenced this pull request in KatrinIhler/opencast Mar 4, 2019
KatrinIhler referenced this pull request in KatrinIhler/opencast Mar 5, 2019
TurRil pushed a commit to TurRil/opencast that referenced this pull request Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants