Skip to content

Commit

Permalink
cli restart and resume
Browse files Browse the repository at this point in the history
  • Loading branch information
mmattel committed Nov 4, 2024
1 parent b9e0260 commit aff6af6
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 18 deletions.
54 changes: 44 additions & 10 deletions modules/ROOT/pages/deployment/services/s-list/postprocessing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,73 @@ The backoff behavior as mentioned in the `retry` outcome can be configured using

=== Resume Post-Processing

If post-processing fails in one step due to an unforeseen error, current uploads will not be retried automatically. A system administrator can instead run CLI commands to retry the failed upload which is a two step process. For details on the `storage-users` command see the xref:{s-path}/storage-users.adoc#manage-unfinished-uploads[Manage Unfinished Uploads] documentation.
[NOTE]
====
If not noted otherwise, `commands with the `restart` option can also use the `resume` option. This changes behaviour slightly.
* First list ongoing upload sessions:
* `restart` +
When restarting an upload, all steps for open items will be restarted, except if otherwise defined.
* `resume` +
When resuming an upload, processing will continue for unfinished items from their last completed step.
====

If post-processing fails in one step due to an unforeseen error, current uploads will not be resumed automatically. A system administrator can instead run CLI commands to resume the failed upload manually which is at minimum a two step process.

NOTE: For details on the `storage-users` command which provides many options see the xref:{s-path}/storage-users.adoc#manage-unfinished-uploads[Manage Unfinished Uploads] documentation.

Depending if you want to restart/resume all or defined failed uploads, different commands are used.

* First, list ongoing upload sessions to identify possibly failed ones. +
Note that there never can be a clear identification of a failed upload session due to various reasons causing them. You need to apply more critera like free space on disk, a failed service like antivirus etc. to declare an upload as failed.
+
[source,bash]
----
ocis storage-users uploads sessions
----

* If you want to restart *all* uploads, just rerun the command with the `--restart` flag:
{empty}

* *All failed uploads*
+
--
If you want to restart/resume all failed uploads, just rerun the command with the relevant flag. Note that this is the preferred command to handle failed processing steps:

[source,bash]
----
ocis storage-users uploads sessions --restart
ocis storage-users uploads sessions --resume
----
{empty}
--

* If you want to restart *only one* upload, use the postprocessing restart command with the ID selected:
* *Particular failed uploads* +
Use the `postprocessing` command to resume defined failed uploads. For postprocessing steps, the default is to resume . Note that at the moment, `resume` is an alias for `restart` to keep old functionality. `restart` is subject of change and will most likely be removed in a later version.

** *Defined by ID*
+
--
If you want to resume only a specific upload, use the postprocessing restart command with the ID selected:

[source,bash]
----
ocis postprocessing restart -u <uploadID>
ocis postprocessing resume -u <uploadID>
----
{empty}
--

Alternatively, instead of starting one specific upload, a system admin can also restart all uploads that are currently in a specific step.
** *Defined by step*
+
--
Alternatively, instead of restarting one specific upload, a system admin can also resume all uploads that are currently in a specific step.

Examples:

[source,bash]
----
ocis postprocessing restart # Restarts all uploads where postprocessing is finished, but upload is not finished.
ocis postprocessing restart -s "finished" # Equivalent to the above.
ocis postprocessing restart -s "virusscan" # Restart all uploads currently in virusscan step.
ocis postprocessing resume # Restarts all uploads where postprocessing is finished, but upload is not finished.
ocis postprocessing resume -s "finished" # Equivalent to the above.
ocis postprocessing resume -s "virusscan" # Restart all uploads currently in virusscan step.
----
--

== Storing

Expand Down
25 changes: 17 additions & 8 deletions modules/ROOT/pages/deployment/services/s-list/storage-users.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,30 @@ ocis storage-users uploads <command>
----
COMMANDS:
sessions Print a list of upload sessions
clean Clean up leftovers from expired uploads (deprecated, do not use it)
list Print a list of all incomplete uploads (deprecated, do not use it)
----
--

==== Sessions command

The `sessions` command is the entry point for listing, restarting and cleaning unfinished uploads.
The `sessions` command is the entry point for listing, restarting/resuming and cleaning unfinished uploads.

NOTE: There can never be a clear identification of a failed upload session due to various reasons causing them. You need to apply more critera like free space on disk, a failed service like antivirus etc. to declare an upload as failed.

[NOTE]
====
If not noted otherwise, `the `restart` option can also be replaced the `resume` option. This changes behaviour slightly.
* `restart` +
When restarting an upload, all steps for open items will be restarted, except if otherwise defined.
* `resume` +
When resuming an upload, processing will continue for unfinished items from their last completed step.
====

[source,bash]
----
ocis storage-users uploads sessions
----

Note, though possible, do not use the deprecated upload commands listed above. Their function has been embedded in the session command as command options.

[source,plaintext]
----
NAME:
Expand All @@ -100,6 +108,7 @@ OPTIONS:
--has-virus filter sessions by virus scan result (default: unset)
--json output as json (default: false)
--restart send restart event for all listed sessions (default: false)
--resume send resume event for all listed sessions (default: false)
--clean remove uploads (default: false)
--help, -h show help
----
Expand Down Expand Up @@ -165,7 +174,7 @@ ocis storage-users uploads sessions --expired=false --processing=false
|
|===

The sessions command can also clear and restart uploads. The output is the same as if run without the `--clean` or `--restart` flag. Note that it is recommended to run the command first without the `--clean` (`--processing`) flag to double check which uploads get cleaned (restarted).
The sessions command can also clear and restart/resume uploads. The output is the same as if run without the `--clean` or `--restart/--resume` option. Note that it is recommended to run the command first without the `--clean` (`--processing`) option to double check which uploads would get cleaned (restarted/resumed).

.Cleans all expired uploads regardless of processing and virus state.
[source,bash]
Expand All @@ -175,13 +184,13 @@ ocis storage-users uploads sessions \
--clean
----

.Restarts all uploads that are processing and are not virus infected
.Resume all uploads that are currently processing and are not virus infected
[source,bash]
----
ocis storage-users uploads sessions \
--processing=false \
--has-virus=false \
--restart
--resume
----

=== Manage Trash-Bin Items
Expand Down
8 changes: 8 additions & 0 deletions modules/ROOT/pages/maintenance/commands/changed-cli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@

See the link for a detailed description of the respective CLI command if available.

* xref:maintenance/commands/commands.adoc#manage-expired-uploads[Manage Expired Uploads] +
The `ocis storage-users uploads sessions --restart` command got an alternative `--resume` option. +
Resume can be used in the same way as `restart` with a slighly different behavior change.

* xref:maintenance/commands/commands.adoc#purge-expired-space-trash-bin-items[Purge Expired Space Trash-Bin Items] +
The `ocis storage-users uploads` got restructured. +
The deprecated `list` option is now removed, the `clean` option is now part of the `sessions command`.

* xref:maintenance/commands/commands.adoc#resume-post-processing[Resume Post-Processing] +
The `ocis postprocessing restart` command got an alternative `resume` option. +
Resume can be used in the same way as `restart` with a slighly different behavior change.

* xref:maintenance/commands/commands.adoc#reset-password-for-idm-users[Reset Password for IDM Users] +
The `ocis idm resetpassword` can now specify the user name via the `--user-name` (`-u`) flag.

Expand Down

0 comments on commit aff6af6

Please sign in to comment.