morrySnow commented on code in PR #1980: URL: https://github.com/apache/doris-website/pull/1980#discussion_r1946263970
########## docs/sql-manual/sql-statements/table-and-view/data-and-status-management/SHOW-REPLICA-DISTRIBUTION.md: ########## @@ -28,35 +28,106 @@ under the License. ## Description -This statement is used to display the distribution status of a table or partition replica +This statement is used to display the replica status information for a table or partition. -grammar: +## Syntax ```sql -SHOW REPLICA DISTRIBUTION FROM [db_name.]tbl_name [PARTITION (p1, ...)]; +SHOW REPLICA STATUS FROM [ <database_name>.]<table_name> [partition_list] +[where_clause] Review Comment: ```suggestion SHOW REPLICA STATUS FROM [ <database_name>.]<table_name> [<partition_list>] [<where_clause>] ``` ########## docs/sql-manual/sql-statements/table-and-view/data-and-status-management/SHOW-REPLICA-DISTRIBUTION.md: ########## @@ -28,35 +28,106 @@ under the License. ## Description -This statement is used to display the distribution status of a table or partition replica +This statement is used to display the replica status information for a table or partition. -grammar: +## Syntax ```sql -SHOW REPLICA DISTRIBUTION FROM [db_name.]tbl_name [PARTITION (p1, ...)]; +SHOW REPLICA STATUS FROM [ <database_name>.]<table_name> [partition_list] +[where_clause] ``` +Where: -illustrate: +```sql +partition_list + : PARTITION (<partition_name1>[ , parition_name2 ][ ... ]) +``` + +Where: + +```sql +where_clause +: WHERE <output_column_name = value> Review Comment: ```suggestion : WHERE <output_column_name> = <value> ``` ########## docs/sql-manual/sql-statements/table-and-view/data-and-status-management/ADMIN-SET-REPLICA-VERSION.md: ########## @@ -0,0 +1,96 @@ +--- +{ + "title": "ADMIN SET REPLICA VERSION", + "language": "en" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + + + +## Description + +This statement is used to manually set the version, last successful version, and last failed version of a specified replica. It is primarily used for recovering replicas from an abnormal state when an issue occurs in the system. + +## Syntax + +```sql +ADMIN SET REPLICA VERSION PROPERTIES ("<key>"="<value>" [,...]) +``` + +## Required Parameters + +**1. `<tablet_id>`** + +The ID of the tablet whose replica version needs to be modified. + +**2. `<backend_id>`** + +The ID of the BE node where the replica is located. + + +## Optional Parameters + +**1. `<version>`** + +Sets the version of the replica. + +**2. `<last_success_version>`** + +Sets the last successful version of the replica. + +**3. `<last_failed_version>`** + +Sets the last failed version of the replica. Review Comment: 这些都属于 key value? 如果是的话。应该写成 ``` ** 1. "<key>"="<value>" > 然后在这里介绍 key 的取值都能是什么,可以用一个表格来展示 ``` ########## docs/sql-manual/sql-statements/table-and-view/data-and-status-management/SHOW-REPLICA-STATUS.md: ########## @@ -24,56 +24,133 @@ specific language governing permissions and limitations under the License. --> - - ## Description -This statement is used to display replica status information for a table or partition. +This statement is used to display the replica status information for a table or partition. -grammar: +## Syntax ```sql -SHOW REPLICA STATUS FROM [db_name.]tbl_name [PARTITION (p1, ...)] -[where_clause]; +SHOW REPLICA STATUS FROM [ <database_name>.]<table_name> [partition_list] +[where_clause] ``` +Where: -illustrate - -1. where_clause: - WHERE STATUS [!]= "replica_status" - -2. replica_status: - OK: replica is healthy - DEAD: The Backend where the replica is located is unavailable - VERSION_ERROR: replica data version is missing - SCHEMA_ERROR: The schema hash of the replica is incorrect - MISSING: replica does not exist - -## Example - -1. View the status of all replicas of the table - - ```sql - SHOW REPLICA STATUS FROM db1.tbl1; - ``` - -2. View a copy of a table with a partition status of VERSION_ERROR - - ```sql - SHOW REPLICA STATUS FROM tbl1 PARTITION (p1, p2) - WHERE STATUS = "VERSION_ERROR"; - ``` - -3. View all unhealthy replicas of the table - - ```sql - SHOW REPLICA STATUS FROM tbl1 - WHERE STATUS != "OK"; - ``` +```sql +partition_list + : PARTITION (<partition_name1>[ , parition_name2 ][ ... ]) +``` -## Keywords +Where: - SHOW, REPLICA, STATUS +```sql +where_clause +: WHERE <output_column_name = value> Review Comment: 一样的问题 ########## docs/sql-manual/sql-statements/table-and-view/data-and-status-management/ADMIN-SET-REPLICA-STATUS.md: ########## @@ -0,0 +1,94 @@ +--- +{ + "title": "ADMIN SET REPLICA STATUS", + "language": "en" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + + +## Description + +This statement is used to set the status of a specified replica. Currently, it is only used for manually setting certain replica statuses to `BAD`, `DROP`, or `OK`, allowing the system to automatically repair these replicas. + +## Syntax + +```sql +ADMIN SET REPLICA STATUS +PROPERTIES ("<tablet_id>"="<value1>","<backend_id>"="<value2>","<status>"="<value3>") Review Comment: 我理解 tablet_id,backend_id,status 这个是 key,应该就是这个字符串,不是变量? ```suggestion PROPERTIES ("tablet_id"="<tablet_id>","backend_id"="<backend_id>","status"="<status>") ``` ########## docs/sql-manual/sql-statements/table-and-view/data-and-status-management/SHOW-REPLICA-STATUS.md: ########## @@ -24,56 +24,133 @@ specific language governing permissions and limitations under the License. --> - - ## Description -This statement is used to display replica status information for a table or partition. +This statement is used to display the replica status information for a table or partition. -grammar: +## Syntax ```sql -SHOW REPLICA STATUS FROM [db_name.]tbl_name [PARTITION (p1, ...)] -[where_clause]; +SHOW REPLICA STATUS FROM [ <database_name>.]<table_name> [partition_list] Review Comment: 和上一个语法类似 ########## docs/sql-manual/sql-statements/table-and-view/data-and-status-management/SHOW-REPLICA-DISTRIBUTION.md: ########## @@ -28,35 +28,106 @@ under the License. ## Description -This statement is used to display the distribution status of a table or partition replica +This statement is used to display the replica status information for a table or partition. -grammar: +## Syntax ```sql -SHOW REPLICA DISTRIBUTION FROM [db_name.]tbl_name [PARTITION (p1, ...)]; +SHOW REPLICA STATUS FROM [ <database_name>.]<table_name> [partition_list] +[where_clause] ``` +Where: -illustrate: +```sql +partition_list + : PARTITION (<partition_name1>[ , parition_name2 ][ ... ]) Review Comment: ```suggestion : PARTITION (<partition_name>[ , ... ]) ``` ########## docs/sql-manual/sql-statements/table-and-view/data-and-status-management/SHOW-REPLICA-STATUS.md: ########## @@ -24,56 +24,133 @@ specific language governing permissions and limitations under the License. --> - - ## Description -This statement is used to display replica status information for a table or partition. +This statement is used to display the replica status information for a table or partition. -grammar: +## Syntax ```sql -SHOW REPLICA STATUS FROM [db_name.]tbl_name [PARTITION (p1, ...)] -[where_clause]; +SHOW REPLICA STATUS FROM [ <database_name>.]<table_name> [partition_list] +[where_clause] ``` +Where: -illustrate - -1. where_clause: - WHERE STATUS [!]= "replica_status" - -2. replica_status: - OK: replica is healthy - DEAD: The Backend where the replica is located is unavailable - VERSION_ERROR: replica data version is missing - SCHEMA_ERROR: The schema hash of the replica is incorrect - MISSING: replica does not exist - -## Example - -1. View the status of all replicas of the table - - ```sql - SHOW REPLICA STATUS FROM db1.tbl1; - ``` - -2. View a copy of a table with a partition status of VERSION_ERROR - - ```sql - SHOW REPLICA STATUS FROM tbl1 PARTITION (p1, p2) - WHERE STATUS = "VERSION_ERROR"; - ``` - -3. View all unhealthy replicas of the table - - ```sql - SHOW REPLICA STATUS FROM tbl1 - WHERE STATUS != "OK"; - ``` +```sql +partition_list + : PARTITION (<partition_name1>[ , parition_name2 ][ ... ]) Review Comment: 一样的问题 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org