Bug #102970 | trx reserves record-lock for failed insert statement | ||
---|---|---|---|
Submitted: | 15 Mar 2021 6:22 | Modified: | 15 Mar 2021 7:28 |
Reporter: | Brian Yue (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | MySQL8.0.22, 8.0.23 | OS: | Any (rhel-7.4) |
Assigned to: | CPU Architecture: | Any (intel x86-64) |
[15 Mar 2021 6:22]
Brian Yue
[15 Mar 2021 7:28]
MySQL Verification Team
Hello Brian Yue, Thank you for the report and feedback. regards, Umesh
[16 Mar 2021 11:15]
Jakub Lopuszanski
I believe this is not a bug. The client which performed the failed INSERT has observed that the conflicting record existed in the database during its transaction (let's call the it T1). If we don't lock this record, another, concurrent transaction (let's call it T2) could delete the record, and commit, before T1. Then T1 could commit. Thus you'd get a serialization history in which T2 which deleted the record, happens-before T1 which saw the record.