CDLUC3 / mrt-doc

Documentation and Information regarding the Merritt repository
8 stars 4 forks source link

Merritt SWORD more strict about REST request types #473

Closed sfisher closed 7 months ago

sfisher commented 4 years ago

Describe the bug Dryad sends two types of REST requests to Merritt-sword. We send POST requests (insert) for new datasets and PUT requests (update) for version updates. This is verified from reading our code and seeing where we make requests. We do use different types of requests against Merritt-Sword.

It would be nice if SWORD rejected PUT requests where it cannot find the previous object that it should update.

This may depend on whether PUT requests are ever used for anything besides updates in sword.

To Reproduce

  1. Put Merritt into a state where it cannot determine whether a local id (DOI) already exists.
  2. Do a PUT request to an existing dataset with a DOI to Merritt sword.
  3. Merritt-Sword creates a new object in the Merritt system rather than returning an error or adding a version to the already-existing object. It results in objects being split into multiple objects in Merritt and requiring manual cleanup to fix the objects.

Expected behavior If updates come in where the object being updated cannot be determined then they are rejected.

Note: This may not be possible if PUT requests are also used for upserts (insert and update), but I do not believe we use upserts in Dryad when communicating to Merritt-Sword, but IDK if they may be used elsewhere or if they are a part of a spec for it.

Additional context

This may not be a general solution to all the problems, but might prevent problems with submissions coming in from the SWORD interface.

If this is an easy change, it may save manual cleanup time from versions split across objects by rejecting them. Cleanup is much easier for failed submissions (just resubmit when the system is working) rather than doing manual data analysis and cleanup.

dloy commented 4 years ago

Ingest

Sword

Ingest

Ingest uses a profile containing the owner for a the collection in the submission. Using this owner with the submitted local identifier ingest sends a request to inventory to get confirmation whether a previous ingest command had created an ark for an already existing object.

Some issues for Sword to detect previous submission

Possible solution

elopatin-uc3 commented 4 years ago

See also #464