Bug #107366 | Contribution by Tencent: Invalid JSON value, Error_code: 3903 | ||
---|---|---|---|
Submitted: | 23 May 2022 1:53 | Modified: | 3 Jan 2023 13:09 |
Reporter: | zhang simon (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 8.0.18 and prior, 8.0.29, 8.0.30, 8.0.31, 8.0.32 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | replication json |
[23 May 2022 1:53]
zhang simon
[23 May 2022 7:20]
MySQL Verification Team
Hello zhang simon, Thank you for the report and test case. regards, Umesh
[24 May 2022 7:02]
Steven Duan
REPLICATION ERROR WITH HASH_SCAN ROW SEARCH ALGORITHM FOR FUNCTIONAL INDEXES (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bugfix-107366-REPLICATION-ERROR-WITH-HASH_SC.patch (application/octet-stream, text), 3.81 KiB.
[24 May 2022 7:05]
Steven Duan
In the last comment, we submitted a patch to fix this bug. Description ----------- HASH_SCAN builds a hash of changes, scans the target table or index, and applies any matching change for current entry. In the build phase, it uses only the before-image, and skips any after-image to avoid loose ends. However, previous implementation (since WL#1075) computed generated columns for the skipped after-image, thus causing replication error in some cases. Analysis -------- Rows_log_event::unpack_current_row() is used to unpack or skip a row event. In the latter case, computing generated columns is meaningless and sometimes harmful. Fix --- Never compute any generated columns for only-seek calls.
[24 May 2022 7:54]
zhang simon
update Synopsis
[24 May 2022 7:54]
zhang simon
update Synopsis
[24 May 2022 7:54]
zhang simon
update Synopsis
[24 May 2022 7:54]
zhang simon
update Synopsis
[24 May 2022 7:54]
zhang simon
update Synopsis
[24 May 2022 7:54]
zhang simon
update Synopsis
[3 Jan 2023 13:09]
Jon Stephens
Documented fix as follows in the MySQL 8.0.33 changelog: A hash scan builds a hash of changes, scans the target table or index, and applies any matching change for the current entry. In the build phase, it uses only the before image, and skips any after image. Problems arose in some cases because generated columns were computed for the (skipped) after image, leading to replication errors. This is fixed by not computing generated columns any longer for seek-only calls such as hash scans. Our thanks to dc huang for the contribution. Closed.