Job manager and the JOB statements¶
The long-term tasks run by the Storage Service are called jobs, such as COMPACT
, FLUSH
, and STATS
. These jobs can be time-consuming if the data amount in the graph space is large. The job manager helps you run, show, stop, and recover jobs.
Note
All job management commands can be executed only after selecting a graph space.
SUBMIT JOB COMPACT¶
The SUBMIT JOB COMPACT
statement triggers the long-term RocksDB compact
operation.
For more information about compact
configuration, see Storage Service configuration.
Example¶
nebula> SUBMIT JOB COMPACT;
+------------+
| New Job Id |
+------------+
| 40 |
+------------+
SUBMIT JOB FLUSH¶
The SUBMIT JOB FLUSH
statement writes the RocksDB memfile in the memory to the hard disk.
Example¶
nebula> SUBMIT JOB FLUSH;
+------------+
| New Job Id |
+------------+
| 96 |
+------------+
SUBMIT JOB STATS¶
The SUBMIT JOB STATS
statement starts a job that makes the statistics of the current graph space. Once this job succeeds, you can use the SHOW STATS
statement to list the statistics. For more information, see SHOW STATS.
Note
If the data stored in the graph space changes, in order to get the latest statistics, you have to run SUBMIT JOB STATS
again.
Example¶
nebula> SUBMIT JOB STATS;
+------------+
| New Job Id |
+------------+
| 34 |
+------------+
SHOW JOB¶
The Meta Service parses a SUBMIT JOB
request into multiple tasks and assigns them to the nebula-storaged processes. The SHOW JOB <job_id>
statement shows the information about a specific job and all its tasks in the current graph space.
job_id
is returned when you run the SUBMIT JOB
statement.
Example¶
nebula> SHOW JOB 34;
+----------------+-----------------+------------+----------------------------+----------------------------+
| Job Id(TaskId) | Command(Dest) | Status | Start Time | Stop Time |
+----------------+-----------------+------------+----------------------------+----------------------------+
| 34 | "STATS" | "FINISHED" | 2021-11-01T03:32:27.000000 | 2021-11-01T03:32:27.000000 |
| 0 | "192.168.8.111" | "FINISHED" | 2021-11-01T03:32:27.000000 | 2021-11-01T03:32:41.000000 |
+----------------+-----------------+------------+----------------------------+----------------------------+
The descriptions are as follows.
| Parameter | Description |
|------------------+-------------------------------------------------------------------------------------------------------------------|
| Job Id(TaskId)
| The first row shows the job ID and the other rows show the task IDs. |
| Command(Dest)
| The first row shows the command executed and the other rows show on which storaged processes the task is running. |
| Status
| Shows the status of the job or task. For more information, see Job status. |
| Start Time
| Shows a timestamp indicating the time when the job or task enters the RUNNING
phase. |
| Stop Time
| Shows a timestamp indicating the time when the job or task gets FINISHED
, FAILED
, or STOPPED
. |
Job status¶
The descriptions are as follows.
| Status | Description |
|----------+--------------------------------------------------------------------------------------------------------------------|
| QUEUE | The job or task is waiting in a queue. The Start Time
is empty in this phase. |
| RUNNING | The job or task is running. The Start Time
shows the beginning time of this phase. |
| FINISHED | The job or task is successfully finished. The Stop Time
shows the time when the job or task enters this phase. |
| FAILED | The job or task has failed. The Stop Time
shows the time when the job or task enters this phase. |
| STOPPED | The job or task is stopped without running. The Stop Time
shows the time when the job or task enters this phase. |
| REMOVED | The job or task is removed. |
The description of switching the status is described as follows.
Queue -- running -- finished -- removed
\ \ /
\ \ -- failed -- /
\ \ /
\ ---------- stopped -/
SHOW JOBS¶
The SHOW JOBS
statement lists all the unexpired jobs in the current graph space.
The default job expiration interval is one week. You can change it by modifying the job_expired_secs
parameter of the Meta Service. For how to modify job_expired_secs
, see Meta Service configuration.
Example¶
nebula> SHOW JOBS;
+--------+---------------------+------------+----------------------------+----------------------------+
| Job Id | Command | Status | Start Time | Stop Time |
+--------+---------------------+------------+----------------------------+----------------------------+
| 34 | "STATS" | "FINISHED" | 2021-11-01T03:32:27.000000 | 2021-11-01T03:32:27.000000 |
| 33 | "FLUSH" | "FINISHED" | 2021-11-01T03:32:15.000000 | 2021-11-01T03:32:15.000000 |
| 32 | "COMPACT" | "FINISHED" | 2021-11-01T03:32:06.000000 | 2021-11-01T03:32:06.000000 |
| 31 | "REBUILD_TAG_INDEX" | "FINISHED" | 2021-10-29T05:39:16.000000 | 2021-10-29T05:39:17.000000 |
| 10 | "COMPACT" | "FINISHED" | 2021-10-26T02:27:05.000000 | 2021-10-26T02:27:05.000000 |
+--------+---------------------+------------+----------------------------+----------------------------+
STOP JOB¶
The STOP JOB
statement stops jobs that are not finished in the current graph space.
Example¶
nebula> STOP JOB 22;
+---------------+
| Result |
+---------------+
| "Job stopped" |
+---------------+
RECOVER JOB¶
The RECOVER JOB
statement re-executes the failed jobs in the current graph space and returns the number of recovered jobs.
Example¶
nebula> RECOVER JOB;
+-------------------+
| Recovered job num |
+-------------------+
| 5 job recovered |
+-------------------+
FAQ¶
How to troubleshoot job problems?¶
The SUBMIT JOB
operations use the HTTP port. Please check if the HTTP ports on the machines where the Storage Service is running are working well. You can use the following command to debug.
curl "http://{storaged-ip}:19779/admin?space={space_name}&op=compact"