Mysql data loss

found occasional data loss in mysql. This time I lost a record in the order table. I used laravel framework

.

generate order retention
user submit order-> Table 1 generate order-> user payment-> payment callback-> Table 1 status modification, insert the merchant"s collection record in Table 2 (get the order number from Table 1)

self-examination
1. The order table uses soft deletion, and the global search in the program does not find the statement to delete the order. Even if there is, soft deletion does not actually delete the data.
2. The records in Table 2 exist, indicating that the records in Table 1 still exist until the payment callback ends successfully. Moreover, the id is self-growing, and the middle 23 is followed by 25, except for * * 24, indicating that the record has been generated. It"s gone for no reason.
3. No one is operating the database at that point in time, so human erroneous deletion can be eliminated.

Apr.05,2022

from your current statement, I can only give you an idea: the added statement that is rolled back will also cause the ID to increase


if there is a binlog, see if binlog has found anything. If you can find this delete operation, compare the context to see under what circumstances

Menu