aboutsummaryrefslogtreecommitdiff
path: root/src/zen/zen.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-09-13 16:13:30 -0400
committerGitHub <[email protected]>2023-09-13 22:13:30 +0200
commitb2cef5900b6e251bed4bc0a02161fd90646d37f0 (patch)
treee9085a92e9499bca55dfda9b63779be94218409f /src/zen/zen.cpp
parentscan oplog object for fields (#397) (diff)
downloadarchived-zen-b2cef5900b6e251bed4bc0a02161fd90646d37f0.tar.xz
archived-zen-b2cef5900b6e251bed4bc0a02161fd90646d37f0.zip
job queue and async oplog-import/export (#395)
- Feature: New http endpoint for background jobs `/admin/jobs/status` which will return a response listing the currently active background jobs and their status - Feature: New http endpoint for background jobs information `/admin/jobs/status/{jobid}` which will return a response detailing status, pending messages and progress status - GET will return a response detailing status, pending messages and progress status - DELETE will mark the job for cancelling and return without waiting for completion - If status returned is "Complete" or "Aborted" the jobid will be removed from the server and can not be queried again - Feature: New zen command `jobs` to list, get info about and cancel background jobs - If no options are given it will display a list of active background jobs - `--jobid` accepts an id (returned from for example `oplog-export` with `--async`) and will return a response detailing status, pending messages and progress status for that job - `--cancel` can be added when `--jobid` is given which will request zenserver to cancel the background job - Feature: oplog import and export http rpc requests are now async operations that will run in the background - Feature: `oplog-export` and `oplog-import` now reports progress to the console as work progress by default - Feature: `oplog-export` and `oplog-import` can now be cancelled using Ctrl+C - Feature: `oplog-export` and `oplog-import` has a new option `--async` which will only trigger the work and report a background job id back
Diffstat (limited to 'src/zen/zen.cpp')
-rw-r--r--src/zen/zen.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/zen/zen.cpp b/src/zen/zen.cpp
index 0ed9226fc..5530b57b6 100644
--- a/src/zen/zen.cpp
+++ b/src/zen/zen.cpp
@@ -10,6 +10,7 @@
#include "cmds/copy.h"
#include "cmds/dedup.h"
#include "cmds/hash.h"
+#include "cmds/jobs.h"
#include "cmds/print.h"
#include "cmds/projectstore.h"
#include "cmds/rpcreplay.h"
@@ -224,6 +225,7 @@ main(int argc, char** argv)
ServeCommand ServeCmd;
SnapshotOplogCommand SnapshotOplogCmd;
StatusCommand StatusCmd;
+ JobCommand JobCmd;
TopCommand TopCmd;
UpCommand UpCmd;
AttachCommand AttachCmd;
@@ -272,6 +274,7 @@ main(int argc, char** argv)
{"scrub", &ScrubCmd, "Scrub zen storage (verify data integrity)"},
{"serve", &ServeCmd, "Serve files from a directory"},
{"status", &StatusCmd, "Show zen status"},
+ {"jobs", &JobCmd, "Show/cancel zen background jobs"},
{"top", &TopCmd, "Monitor zen server activity"},
{"up", &UpCmd, "Bring zen server up"},
{"attach", &AttachCmd, "Add a sponsor process to a running zen service"},