Skip to content

Commit f431c91

Browse files
authored
[Fix](doc) tablet operation statment (#1972)
ADMIN-COPY-TABLET,ADMIN-CHECK-TABLET,SHOW-TABLET-STORAGE-FORMAT,SHOW-TABLET-DIAGNOSIS ## Versions - [x] dev - [x] 3.0 - [x] 2.1 - [x] 2.0 ## Languages - [x] Chinese - [x] English ## Docs Checklist - [ ] Checked by AI - [ ] Test Cases Built
1 parent 4eedbdd commit f431c91

File tree

45 files changed

+2305
-1461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2305
-1461
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
{
3+
"title": "ADMIN CHECK TABLET",
4+
"language": "en"
5+
}
6+
---
7+
8+
<!--
9+
Licensed to the Apache Software Foundation (ASF) under one
10+
or more contributor license agreements. See the NOTICE file
11+
distributed with this work for additional information
12+
regarding copyright ownership. The ASF licenses this file
13+
to you under the Apache License, Version 2.0 (the
14+
"License"); you may not use this file except in compliance
15+
with the License. You may obtain a copy of the License at
16+
17+
http://www.apache.org/licenses/LICENSE-2.0
18+
19+
Unless required by applicable law or agreed to in writing,
20+
software distributed under the License is distributed on an
21+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22+
KIND, either express or implied. See the License for the
23+
specific language governing permissions and limitations
24+
under the License.
25+
-->
26+
27+
## Description
28+
29+
This statement is used to perform the specified check operation on a set of tablets.
30+
31+
## Syntax
32+
33+
```sql
34+
ADMIN CHECK TABLET ( <tablet_id> [,...] ) PROPERTIES("type" = "<type_value>")
35+
```
36+
37+
## Required Parameters
38+
39+
**1. `<tablet_id>`**
40+
41+
The ID of the tablet on which the specified check operation will be performed.
42+
43+
44+
## Optional Parameters
45+
46+
**1. `<type_value>`**
47+
48+
Currently, only consistency is supported.
49+
50+
- consistency:
51+
52+
Checks the replica data consistency of the tablet. This command is asynchronous, meaning that after sending it, Doris will start executing the consistency check job for the corresponding tablet.
53+
54+
## Return Value
55+
56+
The final result of the statement will be reflected in the InconsistentNum column of the result from `SHOW PROC "/cluster_health/tablet_health";`.
57+
58+
| Column | DataType | Note |
59+
|-----------------|----------|--------------------------------------|
60+
| InconsistentNum | Int | Number of tablets with inconsistency |
61+
62+
63+
## Access Control Requirements
64+
65+
The user executing this SQL command must have at least the following privileges:
66+
67+
| Privilege | Object | Notes |
68+
|:-----------|:---------|:---------------------------------------------------------------------------------------------------------------------------------|
69+
| Admin_priv | Database | Required to execute administrative operations on the database, including managing tables, partitions, and system-level commands. |
70+
71+
## Examples
72+
- Perform a replica data consistency check on a specified set of tablets
73+
74+
```sql
75+
admin check tablet (10000, 10001) PROPERTIES("type" = "consistency");
76+
```
77+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
{
3+
"title": "ADMIN COPY TABLET",
4+
"language": "en"
5+
}
6+
---
7+
8+
<!--
9+
Licensed to the Apache Software Foundation (ASF) under one
10+
or more contributor license agreements. See the NOTICE file
11+
distributed with this work for additional information
12+
regarding copyright ownership. The ASF licenses this file
13+
to you under the Apache License, Version 2.0 (the
14+
"License"); you may not use this file except in compliance
15+
with the License. You may obtain a copy of the License at
16+
17+
http://www.apache.org/licenses/LICENSE-2.0
18+
19+
Unless required by applicable law or agreed to in writing,
20+
software distributed under the License is distributed on an
21+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22+
KIND, either express or implied. See the License for the
23+
specific language governing permissions and limitations
24+
under the License.
25+
-->
26+
27+
## Description
28+
29+
This statement is used to make a snapshot for the specified tablet, mainly used to load the tablet locally to reproduce
30+
the problem.
31+
32+
## Syntax
33+
34+
```sql
35+
ADMIN COPY TABLET <tablet_id> PROPERTIES ("<key>"="<value>" [,...]).
36+
```
37+
38+
## Required Parameters
39+
40+
**1. `<tablet_id>`**
41+
42+
The ID of the tablet to be copied.
43+
44+
## Optional Parameters
45+
46+
```sql
47+
[ PROPERTIES ("<key>"="<value>" [, ... ]) ]
48+
```
49+
50+
The PROPERTIES clause allows specifying additional parameters:
51+
52+
**1. `<backend_id>`**
53+
54+
Specifies the id of the BE node where the replica is located. If not specified, a replica is randomly selected.
55+
56+
**2. `<version>`**
57+
58+
Specifies the version of the snapshot. The version must be less than or equal to the largest version of the replica. If
59+
not specified, the largest version is used.
60+
61+
**3. `<expiration_minutes>`**
62+
63+
Snapshot retention time. The default is 1 hour. It will automatically clean up after a timeout. Unit minutes.
64+
65+
## Return Value
66+
67+
| Column | DataType | Note |
68+
|-------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
69+
| TabletId | string | The ID of the tablet for which the snapshot was created. |
70+
| BackendId | string | The ID of the BE node where the snapshot is stored. |
71+
| Ip | string | The IP address of the BE node storing the snapshot. |
72+
| Path | string | The storage path where the snapshot is saved on the BE node. |
73+
| ExpirationMinutes | string | The duration (in minutes) after which the snapshot will be automatically deleted. |
74+
| CreateTableStmt | string | The table creation statement for the table corresponding to the tablet. This statement is not the original table-building statement, but a simplified table-building statement for later loading the tablet locally. |
75+
76+
## Access Control Requirements
77+
78+
The user executing this SQL command must have at least the following privileges:
79+
80+
| Privilege | Object | Notes |
81+
|:-----------|:---------|:---------------------------------------------------------------------------------------------------------------------------------|
82+
| Admin_priv | Database | Required to execute administrative operations on the database, including managing tables, partitions, and system-level commands. |
83+
84+
## Examples
85+
86+
- Take a snapshot of the replica on the specified BE node
87+
88+
```sql
89+
ADMIN COPY TABLET 10020 PROPERTIES("backend_id" = "10003");
90+
```
91+
92+
```text
93+
TabletId: 10020
94+
BackendId: 10003
95+
Ip: 192.168.10.1
96+
Path: /path/to/be/storage/snapshot/20220830101353.2.3600
97+
ExpirationMinutes: 60
98+
CreateTableStmt: CREATE TABLE `tbl1` (
99+
`k1` int(11) NULL,
100+
`k2` int(11) NULL
101+
) ENGINE=OLAP
102+
DUPLICATE KEY(`k1`, `k2`)
103+
DISTRIBUTED BY HASH(k1) BUCKETS 1
104+
PROPERTIES (
105+
"replication_num" = "1",
106+
"version_info" = "2"
107+
);
108+
```
109+
110+
- Take a snapshot of the specified version of the replica on the specified BE node
111+
112+
```sql
113+
ADMIN COPY TABLET 10010 PROPERTIES("backend_id" = "10003", "version" = "10");
114+
```
115+
116+
```text
117+
TabletId: 10010
118+
BackendId: 10003
119+
Ip: 192.168.10.1
120+
Path: /path/to/be/storage/snapshot/20220830101353.2.3600
121+
ExpirationMinutes: 60
122+
CreateTableStmt: CREATE TABLE `tbl1` (
123+
`k1` int(11) NULL,
124+
`k2` int(11) NULL
125+
) ENGINE=OLAP
126+
DUPLICATE KEY(`k1`, `k2`)
127+
DISTRIBUTED BY HASH(k1) BUCKETS 1
128+
PROPERTIES (
129+
"replication_num" = "1",
130+
"version_info" = "2"
131+
);
132+
```

docs/sql-manual/sql-statements/table-and-view/data-and-status-management/CHECK-TABLET.md

-63
This file was deleted.

docs/sql-manual/sql-statements/table-and-view/data-and-status-management/COPY-TABLET.md

-98
This file was deleted.

0 commit comments

Comments
 (0)