-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(5.7) PS-7806: Column compression breaks async replication on PS #5161
Conversation
33380ab
to
f36687e
Compare
@@ -1353,6 +1355,7 @@ ha_innopart::open( | |||
if (m_ins_node_parts == NULL | |||
|| m_upd_node_parts == NULL | |||
|| m_blob_heap_parts == NULL | |||
|| m_compress_heap_parts == NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. This file is inconsistent in tabs and spaces usage.
https://jira.percona.com/browse/PS-7806 Work based on the original patch for 8.0 by Nitendra Bhosle. Problem: When the statement related to the partitioned table containing compressed BLOB columns is replicated, replica stops with error. e.g. DELETE FROM t1 WHERE d2 = 0.00000 ; Cause: Queries like mentioned delete are implemented in the following way: 1. Index scan is performed 2. For every matching row, the row is deleted 3. Query is rewritten, using all columns in WHERE clause. For partitioned tables, during the ordered scan, we read (and keep) the next record from every partition, and then do ordering of cached records, returning the first in order (logic in Partition_helper::handle_ordered_index_scan()). However, we use common prebuilt->compression_heap which is cleaned up before every row read. This causes that rows cached for particular partitions are freed and overwritten by next partition's row during rows read loop in Partition_helper::handle_ordered_index_scan(). Then the query is being binlogged, but blob pointer may be invalid, pointing to overwritten memory, so rewritten query contains wrong value for BLOB column. When received by replica, such row does not exists and replica stops. Solution: Implemented dedicated compression_heap for every partition, similarly to already existing blob_heap.
f36687e
to
601abac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
https://jira.percona.com/browse/PS-7806
Work based on the original patch for 8.0 by Nitendra Bhosle.
Problem:
When the statement related to the partitioned table containing compressed BLOB columns is replicated, replica stops with error. e.g. DELETE FROM t1 WHERE d2 = 0.00000 ;
Cause:
Queries like mentioned delete are implemented in the following way:
For partitioned tables, during the ordered scan, we read (and keep) the next record from every partition, and then do ordering of cached records, returning the first in order
(logic in Partition_helper::handle_ordered_index_scan()). However, we use common prebuilt->compression_heap which is cleaned up before every row read. This causes that rows cached for particular partitions are freed and overwritten by next partition's row during rows read loop in Partition_helper::handle_ordered_index_scan(). Then the query is being binlogged, but blob pointer may be invalid, pointing to overwritten memory, so rewritten query contains wrong value for BLOB column.
When received by replica, such row does not exists and replica stops.
Solution:
Implemented dedicated compression_heap for every partition, similarly to already existing blob_heap.
Note: no GCA, because we need PS-8879 fix for this.