After enabling binlog in TiDB, is the write process the same as MySQL's two-phase commit?

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

Original topic: TiDB 开启binlog后,写入是否跟mysql一样是两阶段提交?

| username: TiDBer_C33

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Problem Phenomenon and Impact] In the official documentation, there is no description of the write process for binlog, so I want to learn more about it in the community.
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

| username: Jack-li | Original post link

Both are supported, but there are differences in their implementation because TiDB is a distributed database system, while MySQL is a traditional single-node or master-slave replication architecture database.

| username: forever | Original post link

TiDB also uses two-phase commit. You can refer to the source code analysis of TiDB binlog here:
TiDB Source Code Reading Series Article (24) TiDB Binlog Source Code Analysis | PingCAP

| username: cassblanca | Original post link

TiDB is a distributed transaction model based on the Raft consensus algorithm, which has certain differences from MySQL’s two-phase commit. However, both aim to solve consistency issues, and the end result is the same.

| username: DBAER | Original post link

It is also a two-phase commit

| username: TiDBer_QYr0vohO | Original post link

Yes, two-phase commit.

| username: TiDBer_fbU009vH | Original post link

Both are two-phase commits.

| username: TiDBer_1111 | Original post link

Both are two-phase commits, and there are specialized tools to parse binlogs.

| username: TiDBer_C33 | Original post link

Thank you all, got it :blush:

| username: wangkk2024 | Original post link

All of them are.

| username: xiaoqiao | Original post link

:+1:

| username: 友利奈绪 | Original post link

Both are two-phase commits :call_me_hand:

| username: 小于同学 | Original post link

TiDB is a distributed transaction model based on the Raft consensus algorithm, which has certain differences from MySQL’s two-phase commit. However, both aim to solve consistency issues, and the end result is the same.

| username: dba远航 | Original post link

It also uses two-phase commit.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.