-
Notifications
You must be signed in to change notification settings - Fork 709
reference/system-databases: add 3 cluster tables (2) #2212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| Field description: | ||
|
|
||
| * `TYPE`: Corresponds to the `TYPE` field in the [`information_schema.cluster_info`](/reference/system-databases/cluster-info.md) table. The optional values are `tidb`, `pd`, and `tikv`. | ||
| * `INSTANCE`: Corresponds to the `STATUS_ADDRESS` field in the [`information_schema.cluster_info`](/reference/system-databases/cluster-info.md) cluster information table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reafans I see that the Chinese version still uses STATUS_ADDRESS in cluster-load.md. Would you please check and update all necessary places for docs-cn?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have tested some place in sql-diagnosis and fixed some unreasonable detail recently. And i will check and update the Chinese version recently。
|
|
||
| # CLUSTER_LOAD | ||
|
|
||
| The `CLUSTER_LOAD` cluster load table provides the current load information of the server where each node of the TiDB cluster is located. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reafans Please help confirm whether it's instance or node here.
| The `CLUSTER_LOAD` cluster load table provides the current load information of the server where each node of the TiDB cluster is located. | |
| The `CLUSTER_LOAD` cluster load table provides the current load information of the server where each instance of the TiDB cluster is located. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is instance here.
|
|
||
| > **Note:** | ||
| > | ||
| > + All fields of the cluster log table are pushed down to the corresponding node for execution. So to reduce the overhead of using the cluster log table, specify as many conditions as possible. For example, the `select * from cluter_log where instance='tikv-1'` statement only executes the log search on the `tikv-1` node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The format of instance is
ip:port, which represent a TiDB or TiKV instance. - The node is not accurate, maybe host is better, it represents a physical node, which contains some instance, and its format like
ip. - A host only contains one instance in produciton environment mostly , and there are also some situations in which a host contains several instance. So use instance may be more accurate. All the node in this pr need be changed to instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All node is replaced in the recently added system table documents.
lilin90
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1 similar comment
| desc cluster_load; | ||
| ``` | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding sql to the results can also make it looks better with colors at the website.
| ``` | |
| ```sql |
| select * from cluster_load where device_type='cpu' and device_name='cpu'; | ||
| ``` | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ``` | |
| ```sql |
|
|
||
| You can query cluster logs on the `CLUSTER_LOG` cluster log table. By pushing down query conditions to each instance, the impact of the query on cluster performance is less than that of the `grep` command. | ||
|
|
||
| To get the logs of the TiDB cluster before v4.0, you need to log in to each instance to summarize logs. This cluster log table in 4.0 provides the global and time-ordered log search result, which makes it easier to track full-link events. For example, by searching logs according to the `region id`, you can query all logs in the life cycle of this Region; similarly, by searching the full link log through the slow log's `txn id`, you can query the flow and the number of keys scanned by this transaction at each instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| To get the logs of the TiDB cluster before v4.0, you need to log in to each instance to summarize logs. This cluster log table in 4.0 provides the global and time-ordered log search result, which makes it easier to track full-link events. For example, by searching logs according to the `region id`, you can query all logs in the life cycle of this Region; similarly, by searching the full link log through the slow log's `txn id`, you can query the flow and the number of keys scanned by this transaction at each instance. | |
| To get the logs of the TiDB cluster before v4.0, you need to log in to each instance to summarize logs. This cluster log table in 4.0 provides the global and time-ordered log search result, which makes it easier to track full-link events. For example, by searching logs according to the `region id`, you can query all logs in the life cycle of this Region. Similarly, by searching the full link log through the slow log's `txn id`, you can query the flow and the number of keys scanned by this transaction at each instance. |
| desc cluster_log; | ||
| ``` | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ``` | |
| ```sql |
| select * from `CLUSTER_LOG` where message like '%ddl%' and message like '%job%58%' and type='tidb' and time > '2020-03-27 15:39:00'; | ||
| ``` | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ``` | |
| ```sql |
| desc cluster_systeminfo; | ||
| ``` | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ``` | |
| ```sql |
| select * from CLUSTER_SYSTEMINFO where name like '%kernel.osrelease%' | ||
| ``` | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ``` | |
| ```sql |
reafans
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* reference/system-databases: add 3 cluster tables (2) * replace node with instance and address comments * change field name * add `sql` to results Co-authored-by: Lilian Lee <lilin@pingcap.com>
|
cherry pick to release-4.0 in PR #2359 |
* reference/system-databases: add 3 cluster tables (2) * replace node with instance and address comments * change field name * add `sql` to results Co-authored-by: Lilian Lee <lilin@pingcap.com> Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> Co-authored-by: Lilian Lee <lilin@pingcap.com>
What is changed, added or deleted? (Required)
Add the
cluster_load,cluster_systeminfoandcluster_logsystem tables.Which TiDB version(s) do your changes apply to? (Required)
If you select two or more versions from above, to trigger the bot to cherry-pick this PR to your desired release version branch(es), you must add corresponding labels such as needs-cherry-pick-4.0, needs-cherry-pick-3.1, needs-cherry-pick-3.0, and needs-cherry-pick-2.1.
What is the related PR or file link(s)?