Skip to content

Commit 2b35345

Browse files
amotlseut
andcommitted
Troubleshooting: Fix SQL statements on page about "System Tables"
Co-authored-by: Sebastian Utz <[email protected]>
1 parent cc4f7b9 commit 2b35345

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

docs/admin/troubleshooting/system-tables.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ listed in the **sys.jobs** table while it's executed::
6565
Once you identified the dedicated job UUID, you can kill that job with the
6666
**KILL** command. A single job is split into several operations which run,
6767
depending on the query, on distributed nodes of your cluster. The table has
68-
also a system column **_node** indicating on which node CrateDB actually
68+
also a system column **node** indicating on which node CrateDB actually
6969
executes the operation::
7070

71-
cr> SELECT _node['name'], _node['hostname'], * FROM sys.operations;
72-
+---------------+------------------...+----+---------------...+---------+---------------+------------+
73-
| _node['name'] | _node['hostname'] | id | job_id | name | started | used_bytes |
74-
+---------------+------------------...+----+---------------...+---------+---------------+------------+
71+
cr> SELECT node['name'], node['id'], * FROM sys.operations;
72+
+---------------+----------...+----+---------------...+---------+---------------+------------+
73+
| node['name'] | node['id'] | id | job_id | name | started | used_bytes |
74+
+---------------+----------...+----+---------------...+---------+---------------+------------+
7575
...
76-
+---------------+------------------...+----+---------------...+---------+---------------+------------+
76+
+---------------+----------...+----+---------------...+---------+---------------+------------+
7777
SELECT ... in set (... sec)
7878

79-
Find out more about the **_node** system column in the next sections. If there
79+
Find out more about the **node** system column in the next sections. If there
8080
are no current jobs nor operations that are causing problems, check the
8181
recorded history of finished jobs and operations in the tables **sys.jobs_log**
8282
and **sys.operations_log**, respectively.
@@ -123,7 +123,7 @@ To list all nodes using more than 98 per cent of system memory, invoke::
123123

124124
The table also contains performance metrics like the load average, disk,
125125
memory, heap, or network throughput.
126-
The object has the same structure as the **_node** system column of
126+
The object has the same structure as the **node** system column of
127127
**sys.operations** from the previous section.
128128
This query lists all available attributes::
129129

@@ -200,12 +200,12 @@ the cluster.
200200
You can estimate the progress of that operation with the **recovery** object.
201201
Run this query to monitor the progress of the shard transfer::
202202

203-
cr> select _node['hostname'], id, recovery['stage'], recovery['size']['percent'], routing_state, state from sys.shards
203+
cr> select node['name'], id, recovery['stage'], recovery['size']['percent'], routing_state, state from sys.shards
204204
... where routing_state in ('RELOCATING','INITIALIZING') order by id;
205-
+-------------------+----+-------------------+-----------------------------+---------------+-------+
206-
| _node['hostname'] | id | recovery['stage'] | recovery['size']['percent'] | routing_state | state |
207-
+-------------------+----+-------------------+-----------------------------+---------------+-------+
208-
+-------------------+----+-------------------+-----------------------------+---------------+-------+
205+
+--------------+----+-------------------+-----------------------------+---------------+-------+
206+
| node['name'] | id | recovery['stage'] | recovery['size']['percent'] | routing_state | state |
207+
+--------------+----+-------------------+-----------------------------+---------------+-------+
208+
+--------------+----+-------------------+-----------------------------+---------------+-------+
209209
SELECT ... in set (... sec)
210210

211211
It lists pairs of rows, in which the first row denotes the destination shard
@@ -220,16 +220,16 @@ until the transfer is done. After that, the source row is deleted from
220220
**sys.shards** automatically.
221221

222222
To find out on which specific node a shard is stored, also use the object in
223-
the **_node** system column that is available for this table. For example,
223+
the **node** system column that is available for this table. For example,
224224
this query lists the hosts and tables with the highest number of rows inside
225225
a single shard::
226226

227-
cr> SELECT _node['hostname'], table_name, num_docs FROM sys.shards ORDER BY num_docs DESC LIMIT 3;
228-
+-------------------...+-----------...-+----------+
229-
| _node['hostname'] | table_name | num_docs |
230-
+-------------------...+------------...+----------+
227+
cr> SELECT node['name'], table_name, num_docs FROM sys.shards ORDER BY num_docs DESC LIMIT 3;
228+
+--------------...+-----------...-+----------+
229+
| node['name'] | table_name | num_docs |
230+
+--------------...+------------...+----------+
231231
...
232-
+-------------------...+------------...+----------+
232+
+--------------...+------------...+----------+
233233
SELECT ... in set (... sec)
234234

235235
.. SEEALSO::
@@ -261,17 +261,17 @@ table, which lists all shards in the cluster.
261261
- To find out about the different states of shards of a specific table, you can
262262
simply filter by ``table_schema`` and ``table_name``, e.g.::
263263

264-
cr> SELECT table_name, shard_id, node_id, explanations
264+
cr> SELECT table_name, shard_id, node_id, explanation
265265
... FROM sys.allocations
266266
... WHERE table_schema = 'doc' AND table_name = 'my_table'
267267
... ORDER BY current_state, shard_id;
268-
+------------+----------+---------+--------------+
269-
| table_name | shard_id | node_id | explanations |
270-
+------------+----------+---------+--------------+
271-
| doc | my_table | ... | ... |
272-
+------------+----------+---------+--------------+
268+
+------------+----------+---------+-------------+
269+
| table_name | shard_id | node_id | explanation |
270+
+------------+----------+---------+-------------+
271+
| doc | my_table | ... | ... |
272+
+------------+----------+---------+-------------+
273273
...
274-
+------------+----------+---------+--------------+
274+
+------------+----------+---------+-------------+
275275
SELECT ... in set (... sec)
276276

277277

0 commit comments

Comments
 (0)