Skip to content

Commit

Permalink
[Refactor](admin-stmt) rename some admin-show statestmt (#29492)
Browse files Browse the repository at this point in the history
The `ADMIN SHOW` statement can not be executed with high version of mysql 8.x jdbc driver.
So I rename these statement, remove the `ADMIN` keywords.

1. ADMIN SHOW CONFIG -> SHOW CONFIG
2. ADMIN SHOW REPLICA -> SHOW REPLICA
3. ADMIN DIAGNOSE TABLET -> SHOW TABLET DIAGNOSIS
4. ADMIN SHOW TABLET -> SHOW TABLET

for compatibility, the old statements are still supported, but not recommend to use.
They will be removed in later version
  • Loading branch information
morningman authored Jan 10, 2024
1 parent 32af31f commit afceb6f
Show file tree
Hide file tree
Showing 50 changed files with 231 additions and 186 deletions.
14 changes: 7 additions & 7 deletions docs/en/docs/admin-manual/config/fe-config-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The location of the `fe_custom.conf` file can be configured in `fe.conf` through
**1.** For the purpose of simplifying the architecture, modifying the configuration through the mysql protocol will only modify the data in the local FE memory, and will not synchronize the changes to all FEs.
For Config items that only take effect on the Master FE, the modification request will be automatically forwarded to the Master FE.

**2.** Note that the option ```forward_to_master``` will affect the display results of ```admin show frontend config```, if ```forward_to_master=true```, ```admin show frontend config``` shows the Config of Master FE (Even if you are connecting to a Follower FE currently), this may cause you to be unable to see the modification of the local FE configuration; if you expect show config of the FE you're connecting, then execute the command ```set forward_to_master=false```.
**2.** Note that the option ```forward_to_master``` will affect the display results of ```show frontend config```, if ```forward_to_master=true```, ```show frontend config``` shows the Config of Master FE (Even if you are connecting to a Follower FE currently), this may cause you to be unable to see the modification of the local FE configuration; if you expect show config of the FE you're connecting, then execute the command ```set forward_to_master=false```.


## View configuration items
Expand All @@ -58,7 +58,7 @@ There are two ways to view the configuration items of FE:

After the FE is started, you can view the configuration items of the FE in the MySQL client with the following command:

`ADMIN SHOW FRONTEND CONFIG;`
`SHOW FRONTEND CONFIG;`

The meanings of the columns in the results are as follows:

Expand All @@ -83,7 +83,7 @@ There are two ways to configure FE configuration items:

`ADMIN SET FRONTEND CONFIG (" fe_config_name "=" fe_config_value ");`

Not all configuration items support dynamic configuration. You can check whether the dynamic configuration is supported by the `IsMutable` column in the` ADMIN SHOW FRONTEND CONFIG; `command result.
Not all configuration items support dynamic configuration. You can check whether the dynamic configuration is supported by the `IsMutable` column in the` SHOW FRONTEND CONFIG; `command result.

If the configuration item of `MasterOnly` is modified, the command will be directly forwarded to the Master FE and only the corresponding configuration item in the Master FE will be modified.

Expand All @@ -101,15 +101,15 @@ There are two ways to configure FE configuration items:

1. Modify `async_pending_load_task_pool_size`

Through `ADMIN SHOW FRONTEND CONFIG;` you can see that this configuration item cannot be dynamically configured (`IsMutable` is false). You need to add in `fe.conf`:
Through `SHOW FRONTEND CONFIG;` you can see that this configuration item cannot be dynamically configured (`IsMutable` is false). You need to add in `fe.conf`:

`async_pending_load_task_pool_size = 20`

Then restart the FE process to take effect the configuration.

2. Modify `dynamic_partition_enable`

Through `ADMIN SHOW FRONTEND CONFIG;` you can see that the configuration item can be dynamically configured (`IsMutable` is true). And it is the unique configuration of Master FE. Then first we can connect to any FE and execute the following command to modify the configuration:
Through `SHOW FRONTEND CONFIG;` you can see that the configuration item can be dynamically configured (`IsMutable` is true). And it is the unique configuration of Master FE. Then first we can connect to any FE and execute the following command to modify the configuration:

```
ADMIN SET FRONTEND CONFIG ("dynamic_partition_enable" = "true"); `
Expand All @@ -119,14 +119,14 @@ There are two ways to configure FE configuration items:
```
set forward_to_master = true;
ADMIN SHOW FRONTEND CONFIG;
SHOW FRONTEND CONFIG;
```
After modification in the above manner, if the Master FE restarts or a Master election is performed, the configuration will be invalid. You can add the configuration item directly in `fe.conf` and restart the FE to make the configuration item permanent.
3. Modify `max_distribution_pruner_recursion_depth`
Through `ADMIN SHOW FRONTEND CONFIG;` you can see that the configuration item can be dynamically configured (`IsMutable` is true). It is not unique to Master FE.
Through `SHOW FRONTEND CONFIG;` you can see that the configuration item can be dynamically configured (`IsMutable` is true). It is not unique to Master FE.
Similarly, we can modify the configuration by dynamically modifying the configuration command. Because this configuration is not unique to the Master FE, user need to connect to different FEs separately to modify the configuration dynamically, so that all FEs use the modified configuration values.
Expand Down
14 changes: 7 additions & 7 deletions docs/en/docs/admin-manual/config/fe-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ There are two ways to view the configuration items of FE:

2. View by command

After the FE is started, you can view the configuration items of the FE in the MySQL client with the following command,Concrete language law reference [ADMIN-SHOW-CONFIG](../../sql-manual/sql-reference/Database-Administration-Statements/ADMIN-SHOW-CONFIG.md):
After the FE is started, you can view the configuration items of the FE in the MySQL client with the following command,Concrete language law reference [SHOW-CONFIG](../../sql-manual/sql-reference/Database-Administration-Statements/SHOW-CONFIG.md):

`ADMIN SHOW FRONTEND CONFIG;`
`SHOW FRONTEND CONFIG;`

The meanings of the columns in the results are as follows:

Expand All @@ -75,7 +75,7 @@ There are two ways to configure FE configuration items:

`ADMIN SET FRONTEND CONFIG (" fe_config_name "=" fe_config_value ");`

Not all configuration items support dynamic configuration. You can check whether the dynamic configuration is supported by the `IsMutable` column in the` ADMIN SHOW FRONTEND CONFIG; `command result.
Not all configuration items support dynamic configuration. You can check whether the dynamic configuration is supported by the `IsMutable` column in the` SHOW FRONTEND CONFIG; `command result.

If the configuration item of `MasterOnly` is modified, the command will be directly forwarded to the Master FE and only the corresponding configuration item in the Master FE will be modified.

Expand All @@ -93,15 +93,15 @@ There are two ways to configure FE configuration items:

1. Modify `async_pending_load_task_pool_size`

Through `ADMIN SHOW FRONTEND CONFIG;` you can see that this configuration item cannot be dynamically configured (`IsMutable` is false). You need to add in `fe.conf`:
Through `SHOW FRONTEND CONFIG;` you can see that this configuration item cannot be dynamically configured (`IsMutable` is false). You need to add in `fe.conf`:

`async_pending_load_task_pool_size = 20`

Then restart the FE process to take effect the configuration.

2. Modify `dynamic_partition_enable`

Through `ADMIN SHOW FRONTEND CONFIG;` you can see that the configuration item can be dynamically configured (`IsMutable` is true). And it is the unique configuration of Master FE. Then first we can connect to any FE and execute the following command to modify the configuration:
Through `SHOW FRONTEND CONFIG;` you can see that the configuration item can be dynamically configured (`IsMutable` is true). And it is the unique configuration of Master FE. Then first we can connect to any FE and execute the following command to modify the configuration:

```
ADMIN SET FRONTEND CONFIG ("dynamic_partition_enable" = "true"); `
Expand All @@ -111,14 +111,14 @@ There are two ways to configure FE configuration items:
```
set forward_to_master = true;
ADMIN SHOW FRONTEND CONFIG;
SHOW FRONTEND CONFIG;
```
After modification in the above manner, if the Master FE restarts or a Master election is performed, the configuration will be invalid. You can add the configuration item directly in `fe.conf` and restart the FE to make the configuration item permanent.
3. Modify `max_distribution_pruner_recursion_depth`
Through `ADMIN SHOW FRONTEND CONFIG;` you can see that the configuration item can be dynamically configured (`IsMutable` is true). It is not unique to Master FE.
Through `SHOW FRONTEND CONFIG;` you can see that the configuration item can be dynamically configured (`IsMutable` is true). It is not unique to Master FE.
Similarly, we can modify the configuration by dynamically modifying the configuration command. Because this configuration is not unique to the Master FE, user need to connect to different FEs separately to modify the configuration dynamically, so that all FEs use the modified configuration values.
Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/admin-manual/data-admin/delete-recover.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ In some very special circumstances, such as code bugs, or human misoperation, et
ADMIN SET FRONTEND CONFIG ("recover_with_empty_tablet" = "true");
```
* Note: You can first check whether the current version supports this parameter through the `ADMIN SHOW FRONTEND CONFIG;` command.
* Note: You can first check whether the current version supports this parameter through the `SHOW FRONTEND CONFIG;` command.
3. A few minutes after the setup is complete, you should see the following log in the Master FE log `fe.log`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ Tablet state view mainly looks at the state of the tablet, as well as the state

Users can view the status of a copy of a specified table or partition through the following commands and filter the status through a WHERE statement. If you look at table tbl1, the state on partitions P1 and P2 is a copy of OK:

`ADMIN SHOW REPLICA STATUS FROM tbl1 PARTITION (p1, p2) WHERE STATUS = "OK";`
`SHOW REPLICA STATUS FROM tbl1 PARTITION (p1, p2) WHERE STATUS = "OK";`

```
+----------+-----------+-----------+---------+-------------------+--------------------+------------------+------------+------------+-------+--------+--------+
Expand All @@ -315,9 +315,9 @@ Tablet state view mainly looks at the state of the tablet, as well as the state
+----------+-----------+-----------+---------+-------------------+--------------------+------------------+------------+------------+-------+--------+--------+
```
The status of all copies is shown here. Where `IsBad` is listed as `true`, the copy is damaged. The `Status` column displays other states. Specific status description, you can see help through `HELP ADMIN SHOW REPLICA STATUS`.
The status of all copies is shown here. Where `IsBad` is listed as `true`, the copy is damaged. The `Status` column displays other states. Specific status description, you can see help through `HELP SHOW REPLICA STATUS`.
` The ADMIN SHOW REPLICA STATUS `command is mainly used to view the health status of copies. Users can also view additional information about copies of a specified table by using the following commands:
` The SHOW REPLICA STATUS `command is mainly used to view the health status of copies. Users can also view additional information about copies of a specified table by using the following commands:
`SHOW TABLETS FROM tbl1;`
Expand All @@ -337,7 +337,7 @@ Tablet state view mainly looks at the state of the tablet, as well as the state
In addition, users can check the distribution of replicas in a specified table or partition by following commands.
`ADMIN SHOW REPLICA DISTRIBUTION FROM tbl1;`
`SHOW REPLICA DISTRIBUTION FROM tbl1;`
```
+-----------+------------+-------+---------+
Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/advanced/alter-table/schema-change.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ SHOW ALTER TABLE COLUMN\G;
Schema Change can only be started when the table data is complete and unbalanced. If some data shard copies of the table are incomplete, or if some copies are undergoing an equalization operation, the submission is rejected.
    
Whether the data shard copy is complete can be checked with the following command:
```ADMIN SHOW REPLICA STATUS FROM tbl WHERE STATUS != "OK";```
```SHOW REPLICA STATUS FROM tbl WHERE STATUS != "OK";```
If a result is returned, there is a problem with the copy. These problems are usually fixed automatically by the system. You can also use the following commands to repair this table first:
```ADMIN REPAIR TABLE tbl1;```
Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/advanced/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Note that the comment must start with /*+ and can only follow the SELECT.

Forward to Master to view the start time and last heartbeat information.

4. `SHOW TABLET;`/`ADMIN SHOW REPLICA DISTRIBUTION;`/`ADMIN SHOW REPLICA STATUS;`
4. `SHOW TABLET;`/`SHOW REPLICA DISTRIBUTION;`/`SHOW REPLICA STATUS;`

Forward to Master to view the tablet information stored in the Master FE metadata. Under normal circumstances, the tablet information in different FE metadata should be consistent. When a problem occurs, this method can be used to compare the difference between the current FE and Master FE metadata.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ Whether to close Doris's automatic Colocation replica repair. The default is fal

Whether to turn off automatic Colocation replica balancing for Doris. The default is false, i.e. not closed. This parameter only affects the replica balance of the Collocation table, but does not affect the common table.

User can set these configurations at runtime. See `HELP ADMIN SHOW CONFIG;` and `HELP ADMIN SET CONFIG;`.
User can set these configurations at runtime. See `HELP SHOW CONFIG;` and `HELP ADMIN SET CONFIG;`.

* disable\_colocate\_join

Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/query-acceleration/statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ The following FE configuration options are typically not a major concern:

When ANALYZE is executed, statistics data is written to the internal table `__internal_schema.column_statistics`. FE checks the tablet status of this table before executing ANALYZE. If there are unavailable tablets, the task is rejected. Please check the BE cluster status if this error occurs.

Users can use `SHOW BACKENDS\G` to verify the BE (Backend) status. If the BE status is normal, you can use the command `ADMIN SHOW REPLICA STATUS FROM __internal_schema.[tbl_in_this_db]` to check the tablet status within this database, ensuring that the tablet status is also normal.
Users can use `SHOW BACKENDS\G` to verify the BE (Backend) status. If the BE status is normal, you can use the command `SHOW REPLICA STATUS FROM __internal_schema.[tbl_in_this_db]` to check the tablet status within this database, ensuring that the tablet status is also normal.

### 4.2 Failure of ANALYZE on Large Tables

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ADMIN REPAIR TABLE table_name[ PARTITION (p1,...)]

illustrate:

1. This statement only means to let the system try to repair the shard copy of the specified table or partition with high priority, and does not guarantee that the repair can be successful. Users can view the repair status through the ADMIN SHOW REPLICA STATUS command.
1. This statement only means to let the system try to repair the shard copy of the specified table or partition with high priority, and does not guarantee that the repair can be successful. Users can view the repair status through the SHOW REPLICA STATUS command.
2. The default timeout is 14400 seconds (4 hours). A timeout means that the system will no longer repair shard copies of the specified table or partition with high priority. Need to re-use this command to set

### Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ADMIN SET CONFIG
### Description

This statement is used to set the configuration items of the cluster (currently only the configuration items of FE are supported).
The settable configuration items can be viewed through the ADMIN SHOW FRONTEND CONFIG; command.
The settable configuration items can be viewed through the SHOW FRONTEND CONFIG; command.

grammar:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
{
"title": "ADMIN-SHOW-CONFIG",
"title": "SHOW-CONFIG",
"language": "en"
}
---
Expand All @@ -24,11 +24,11 @@ specific language governing permissions and limitations
under the License.
-->

## ADMIN-SHOW-CONFIG
## SHOW-CONFIG

### Name

ADMIN SHOW CONFIG
SHOW CONFIG

### Description

Expand All @@ -37,7 +37,7 @@ This statement is used to display the configuration of the current cluster (curr
grammar:

```sql
ADMIN SHOW FRONTEND CONFIG [LIKE "pattern"];
SHOW FRONTEND CONFIG [LIKE "pattern"];
````

The columns in the results have the following meanings:
Expand All @@ -54,13 +54,13 @@ The columns in the results have the following meanings:
1. View the configuration of the current FE node

```sql
ADMIN SHOW FRONTEND CONFIG;
SHOW FRONTEND CONFIG;
```

2. Use the like predicate to search the configuration of the current Fe node

````
mysql> ADMIN SHOW FRONTEND CONFIG LIKE '%check_java_version%';
mysql> SHOW FRONTEND CONFIG LIKE '%check_java_version%';
+--------------------+-------+---------+---------- -+------------+---------+
| Key | Value | Type | IsMutable | MasterOnly | Comment |
+--------------------+-------+---------+---------- -+------------+---------+
Expand All @@ -71,7 +71,7 @@ The columns in the results have the following meanings:

### Keywords

ADMIN, SHOW, CONFIG, ADMIN SHOW
SHOW, CONFIG

### Best Practice

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
{
"title": "ADMIN-SHOW-REPLICA-DISTRIBUTION",
"title": "SHOW-REPLICA-DISTRIBUTION",
"language": "en"
}
---
Expand All @@ -24,11 +24,11 @@ specific language governing permissions and limitations
under the License.
-->

## ADMIN-SHOW-REPLICA-DISTRIBUTION
## SHOW-REPLICA-DISTRIBUTION

### Name

ADMIN SHOW REPLICA DISTRIBUTION
SHOW REPLICA DISTRIBUTION

### Description

Expand All @@ -37,7 +37,7 @@ This statement is used to display the distribution status of a table or partitio
grammar:

```sql
ADMIN SHOW REPLICA DISTRIBUTION FROM [db_name.]tbl_name [PARTITION (p1, ...)];
SHOW REPLICA DISTRIBUTION FROM [db_name.]tbl_name [PARTITION (p1, ...)];
````

illustrate:
Expand All @@ -49,18 +49,18 @@ illustrate:
1. View the replica distribution of the table

```sql
ADMIN SHOW REPLICA DISTRIBUTION FROM tbl1;
SHOW REPLICA DISTRIBUTION FROM tbl1;
````
2. View the replica distribution of the partitions of the table
```sql
ADMIN SHOW REPLICA DISTRIBUTION FROM db1.tbl1 PARTITION(p1, p2);
SHOW REPLICA DISTRIBUTION FROM db1.tbl1 PARTITION(p1, p2);
````

### Keywords

ADMIN, SHOW, REPLICA, DISTRIBUTION, ADMIN SHOW
ADMIN, SHOW, REPLICA, DISTRIBUTION

### Best Practice

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
{
"title": "ADMIN-SHOW-REPLICA-STATUS",
"title": "SHOW-REPLICA-STATUS",
"language": "en"
}
---
Expand All @@ -24,11 +24,11 @@ specific language governing permissions and limitations
under the License.
-->

## ADMIN-SHOW-REPLICA-STATUS
## SHOW-REPLICA-STATUS

### Name

ADMIN SHOW REPLICA STATUS
SHOW REPLICA STATUS

### Description

Expand All @@ -37,7 +37,7 @@ This statement is used to display replica status information for a table or part
grammar:

```sql
ADMIN SHOW REPLICA STATUS FROM [db_name.]tbl_name [PARTITION (p1, ...)]
SHOW REPLICA STATUS FROM [db_name.]tbl_name [PARTITION (p1, ...)]
[where_clause];
````

Expand All @@ -58,26 +58,26 @@ illustrate
1. View the status of all replicas of the table

```sql
ADMIN SHOW REPLICA STATUS FROM db1.tbl1;
SHOW REPLICA STATUS FROM db1.tbl1;
````
2. View a copy of a table with a partition status of VERSION_ERROR
```sql
ADMIN SHOW REPLICA STATUS FROM tbl1 PARTITION (p1, p2)
SHOW REPLICA STATUS FROM tbl1 PARTITION (p1, p2)
WHERE STATUS = "VERSION_ERROR";
````

3. View all unhealthy replicas of the table

```sql
ADMIN SHOW REPLICA STATUS FROM tbl1
SHOW REPLICA STATUS FROM tbl1
WHERE STATUS != "OK";
````
### Keywords
ADMIN, SHOW, REPLICA, STATUS, ADMIN SHOW
SHOW, REPLICA, STATUS
### Best Practice
Loading

0 comments on commit afceb6f

Please sign in to comment.