Closed jordanhendricks closed 7 years ago
Adding this functionality will also make joyent/node-manta#319 simpler to solve.
CR at https://cr.joyent.us/#/c/2417/.
Testing Notes As part of the testing for #319, I ran the test suite both on a Manta with MPU enabled as well as one without MPU enabled. The output of the tests are in #319.
I also ran manual mmpu
commands against a Manta without MPU enabled. Here is the output of those manual tests:
# create-mpu
$ bin/mmpu create ~~/stor/foo
mmpu create: error: multipart upload is not supported for this Manta deployment
# upload-part
$ bin/mmpu upload 359d0a6c-0bbd-6b49-d976-9a589f999fc4 0 -f package.json
mmpu upload: error: multipart upload is not supported for this Manta deployment
# get-mpu
$ bin/mmpu get 359d0a6c-0bbd-6b49-d976-9a589f999fc4
mmpu get: error: multipart upload is not supported for this Manta deployment
# abort
$ bin/mmpu abort 359d0a6c-0bbd-6b49-d976-9a589f999fc4
mmpu abort: error: multipart upload is not supported for this Manta deployment
# commit
$ bin/mmpu commit 359d0a6c-0bbd-6b49-d976-9a589f999fc4
mmpu commit: error: multipart upload is not supported for this Manta deployment
Other commands in the mmpu
CLI do not print this error message, as they are not implemented with MPU-related methods in the client library. We may want to create another issue to update mmpu
for this purpose. For reference, here is the output of those commands:
# list-mpu
$ bin/mmpu list
mmpu list: error:
# list-parts
$ bin/mmpu parts 359d0a6c-0bbd-6b49-d976-9a589f999fc4
mmpu parts: error:
Those blank errors look like #198.
If you use the client to try a multipart upload operation against a Manta that does not have MPU enabled, it reports a ResourceNotFoundError:
The client can easily detect if the Manta it is connecting to has multipart upload enabled by querying for the /:account/uploads directory. If that directory does not exist, then MPU is not enabled. In this case, we should report a crisp error to the client indicating this is the case.
We should be able to preserve the statusCode of the error, but reporting a new type of error will break clients switching on the "ResourceNotFound" error code. This change will thus require a major version bump.