Why are there so many questions submitted in the second phase? why are they used in many places?

as a rookie, recently, when I learned about distributed consistency-related solutions, I found a very painful problem. Many places say that 2pc and 3PC are used, but there are still many problems with two-phase commit. Since this is the case, why do many places say two-phase commit as a solution when it comes to distributed transactions to ensure data consistency?
and after learning about 2pc, I feel that 2pc seems to be in vain.
I don"t understand. Can the solution of so many problems be used as a production environment?

The internal and external XA of

mysql is 2PC.
2pc is simpler than both raft and Paxos.
so it's up to you to make your own decisions based on input and output.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36e3b-4108e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36e3b-4108e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?