If a user confirmed a booking or transaction on the database system, but it failed and it falls over to the replica, what if the transaction is lost?

This is an overall system design and DBMS question:

If the user books a ticket or an item on a website, how do we solve the issue of confirming a ticket is sold to the user, but the main Database System breaks down, and the secondary DMBS doesn’t have that information yet?

Is the most common solution just to not commit the transaction until both the master and slave DBMS has confirmed?