Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiFlash 组件的存储格式版本如何查看?
【TiDB Usage Environment】Production Environment / Testing / Poc
【TiDB Version】v6.2
【Reproduction Path】What operations were performed when the issue occurred
【Encountered Issue: Issue Phenomenon and Impact】
【Resource Configuration】
【Attachments: Screenshots / Logs / Monitoring】
background:
TiFlash introduces new storage format PageStorage V3 to improve stability and performance.
question:
In a deployed TiDB Cluster, how can we confirm which version of PageStorage TiFlash is using, v2 or v3? Are there any parameters or logs that print the version number?
I think it might be this, but the strange thing is that the value of 6.5 is 2
```
TiDB root@10.18.13.224:test> show config where name like ‘%format_version%’;
±--------±-------------------±-------------------------------------------------±------+
| Type | Instance | Name | Value |
±--------±-------------------±-------------------------------------------------±------+
| tiflash | 10.18.13.226:3930 | raftstore-proxy.raft-engine.format-version | 2 |
The answer is incorrect, just ignore it :upside_down_face:
You can check in Grafana monitoring to see if there are still tables using the old data version: Tiflash summary > Page storage > Storage Pool Run Mode
- Only V2: Number of tables using PageStorage V2 (including partition count)
- Only V3: Number of tables using PageStorage V3 (including partition count)
- Mix Mode: Number of tables migrating from V2 to V3 (including partition count)
Similar to this:

This is also possible, but how do you get this value? 
Subsequently,
From Grafana, we can see that they are all OnlyV3. For example, in the image below, it should indicate that 3 replicas are using PageStorage V3.
On the other hand, from the TiFlash log, we see the phrase [run mode is 2], so does this 2 represent V3? It’s a bit confusing.
[INFO] [Server.cpp:1093] ["Global PageStorage run mode is 2"] [thread_id=1]
In TiDB, global page storage is a mechanism used to store data shared across multiple TiDB instances. Running mode 2 indicates the use of the Distributed Global PageStorage mode. In this mode, TiDB shards the global page storage data across multiple nodes to achieve high availability and fault tolerance.
PageStorage V3 is the latest version of global page storage in TiDB. It adopts distributed storage and the TiKV storage engine, offering greater flexibility and scalability compared to PageStorage V2, but it also requires more system resources to support. PageStorage V2 uses RocksDB as the storage engine, while PageStorage V3 uses TiKV as the storage engine.
Although both concepts are related to global page storage, they are not the same concept.
Are there any other modes? For example, 1? 3? I couldn’t find the relevant documentation…
There are only two types: 1 and 2.
1 represents Standalone mode.
Standalone mode means that GPS operates as a separate storage engine, running independently outside the TiDB cluster. In this mode, GPS synchronizes data with the TiDB cluster through TiDB Binlog, and GPS itself does not participate in TiDB’s data processing and computation.
2 represents Embedded mode.
Embedded mode means that GPS operates as a module of TiKV, running together within the TiDB cluster. In this mode, GPS and TiKV share the same data and also share TiKV’s resource pool (such as CPU, memory, disk, etc.), which can improve the overall resource utilization of the cluster.
The operating mode can be specified through the “run-mode” configuration item in the [gps] section of the TiDB Server configuration file:
[gps]
run-mode = 2
However, it is not recommended to modify this parameter. It is best to use the default mode, which is the TiKV mode.
@ShawnYan I don’t know where @tidb菜鸟一只 got the information from, it looks like it was generated by chatgpt (but it’s actually incorrect).
Starting from version 6.2, TiFlash defaults to upgrading to PageStorage V3. Existing data will continue to use V2, while new data will be written to V3. Therefore, it is recommended to manually execute alter table xxx compact tiflash replica
on all tables containing TiFlash replicas after upgrading. Reference: https://docs.pingcap.com/zh/tidb/dev/tiflash-620-upgrade-guide#从-v5x-或-v60-升级至-v62
The corresponding configuration is that starting from version 6.2, the default format_version = 4
# includes PageStorage V3
Note that format_version
is a global configuration of the storage layer, and PageStorage is a module of the storage layer, so the version numbers do not correspond directly.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.