How to View the Data Distribution of the 7 Levels in the LSMT Structure in TiKV

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 如何可以看到TIKV中LSMT结构7层数据分布

| username: residentevil

[TiDB Usage Environment] Production
[TiDB Version] 7.1.0
[Encountered Problem: Problem Phenomenon and Impact] The native MySQL rocksdb engine can obtain the data distribution of each layer of LSMT through show engine rocksdb status. How can this be obtained in TiDB?

| username: zhanggame1 | Original post link

Check if there are any related commands with tikv-ctl ldb --help.

| username: h5n1 | Original post link

Monitor tikv detail → rocksdb → number files at each level

| username: residentevil | Original post link

Thank you very much, awesome :+1:

| username: residentevil | Original post link

I’ll search for this command, thank you very much. Another question: if two out of three TiKV replicas fail, is there a recovery solution (besides cluster-level backup and recovery)? I see that if PD has only one replica left or no replicas, it can be recovered using the PDRECOVER tool.

| username: redgame | Original post link

The official solution is to exclude the two…

| username: residentevil | Original post link

I didn’t understand what you meant.

| username: h5n1 | Original post link

After version 6.1, use online unsafe recovery when 2 out of 3 TiKV replicas are down.

| username: 有猫万事足 | Original post link

Look at this, @h5n1 has extensive experience in this type of fault recovery.

| username: residentevil | Original post link

Thank you very much.