Applicable scenarios
This article is applicable to the scenario where DDL error reports that the disk is full. It analyzes whether the remaining space of each node is sufficient based on the write amplification coefficient of different versions of the OceanBase database and the size of the source table.
Currently, OceanBase database V4.0.0.0 and later versions are supported. When using obdiag, you need to configure the cluster information in the ~/.obdiag/config.yml file according to your choice, or configure the cluster information through the --config option in the command.
Attention
Due to the timeliness of internal data, only current data is supported for analysis.
There is a difference in the write amplification factor between versions before and after OceanBase database V4.2.3.0. The amplification factor before V4.2.3.0 is 5.5, and the amplification factor after V4.2.3.0 is 1.5.
Can import environment variables
Variable name |
Is it required |
Data type |
Default value |
Description |
|---|---|---|---|---|
| table_name | yes | string | "" | table name |
| tenant_name | yes | string | 10 | tenant name |
| action_type | No | string | add_index | Behavior category, currently only supports indexing scenarios |
| index_name | is | string | "" | The index name.
ExplanationSince obdiag V4.2.0, it supports configuring multiple indexes. Multiple indexes are separated by English commas ( |
| database_name | Yes | string | "" | Database name |
Usage example
An example of specifying environment variables is as follows:
*Single index
obdiag rca run --scene=ddl_disk_full --env tenant_name=test1 --env table_name=t555 --env action_type=add_index --env index_name=k1 --env database_name=xxxx
```* Multiple indexes
```shell
obdiag rca run --scene=ddl_disk_full --env tenant_name=test1 --env table_name=t555 --env action_type=add_index --env index_name=idx1,idx2,idx3 --env database_name=xxxx
Example of results
From the output, it can be found that the nodes have insufficient space problems, which are -4.32 TB and -4.31 TB respectively. Based on this, the corresponding nodes can be expanded.
+----------------------------------------------------------------------------------------------------------+
| record |
+------+---------------------------------------------------------------------------------------------------+
| step | info |
+------+---------------------------------------------------------------------------------------------------+
| 1 | table_id is 510175 |
| 2 | tenant_id is 1002 |
| 3 | on xxx.xxx.xxx.xxx:xxxx tablet_size: 4545356170733 as 4.13 TB |
| 4 | on xxx.xxx.xxx.xxx:xxxx tablet_size: 4541074892527 as 4.13 TB |
| 5 | estimated_size is [{'svr_ip': 'xxx.xxx.xxx.xxx', 'svr_port': xxxx, 'estimated_data_size': |
| | Decimal('4545356170733')}, {'svr_ip': 'xxx.xxx.xxx.xxx', 'svr_port': xxxx, 'estimated_data_size': |
| | Decimal('4541074892527')}] |
| 6 | index_name is idx_user_tx |
| 7 | action_type is add_index |
| 8 | index_table_id is 512088 |
| 9 | main_table_sum_of_data_length is 336 |
| 10 | index_table_sum_of_data_length is 80 |
| 11 | estimated_index_size without magnification 1082227659698B as 1007.90 GB from: |
| | index_table_sum_of_data_length(80)/main_table_sum_of_data_length(336) * |
| | estimated_data_size(4545356170733) |
| 12 | magnification is 5.5 |
| 13 | estimated_index_size with magnification is 5952252128339B as 5.41 TB |
| 14 | On target_server_ip is xxx.xxx.xxx.xxx, target_server_port is xxxx, estimiated_index_size is |
| | 5952252128339B as 5.41 TB |
| 15 | estimated_index_size without magnification 1081208307744B as 1006.95 GB from: |
| | index_table_sum_of_data_length(80)/main_table_sum_of_data_length(336) * |
| | estimated_data_size(4541074892527) |
| 16 | magnification is 5.5 |
| 17 | estimated_index_size with magnification is 5946645692592B as 5.41 TB |
| 18 | On target_server_ip is xxx.xxx.xxx.xxx, target_server_port is xxxx, estimiated_index_size is |
| | 5946645692592B as 5.41 TB |
| 19 | On target_serveris xxx.xxx.xxx.xxx:xxxx |
| 20 | target_server_estimated_size is 5952252128339B as 5.41 TB |
| 21 | target_server_total_size is 3221225472000B as 2.93 TB |
| 22 | target_server_used_size is 1696442875904B as 1.54 TB |
| 23 | data_disk_usage_limit_percentage is 90 |
| 24 | available_disk_space is 1202660048896B as 1.09 TB |
| 25 | available_disk_space - target_server_estimated_size is -4749592079443B as -4.32 TB |
| 26 | On target_serveris xxx.xxx.xxx.xxx:xxxx |
| 27 | target_server_estimated_size is 5946645692592B as 5.41 TB |
| 28 | target_server_total_size is 3221225472000B as 2.93 TB |
| 29 | target_server_used_size is 1695073435648B as 1.54 TB |
| 30 | data_disk_usage_limit_percentage is 90 |
| 31 | available_disk_space is 1204029489152B as 1.10 TB |
| 32 | available_disk_space - target_server_estimated_size is -4742616203440B as -4.31 TB |
+------+---------------------------------------------------------------------------------------------------+
