-
Notifications
You must be signed in to change notification settings - Fork 484
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
PS-5562 : index_merge + partitioning + MyRocks crashes the server #3162
Conversation
8.0 version will have testcase because the optimizer hint to force /*+ INDEX_MERGE */ is introduced only in 8.0. This is not present in 5.7. To reproduce the crash, we need native partitioning + index_merge + only a subset of partitions should be used for query. Tried for two days before giving up. 8.0 version has simple testcase. |
bdb5c71
to
c01ad54
Compare
|
multi_con_read is result content mismatch. I hve recorded this as part of this commit. |
Problem: -------- With native paritioning and index_merge, the native partition handler is cloned. One important point missed when fixing PS-5206 is that both the original and clone share the parition_info object (m_part_info). It has bitmap of partitions read and used. The cloned handler, which has reference to the shared to partition_info object, resets the partition bitmap during creation. This causes problem during the actual index scan. Fix: ---- 1. Create context to identify if the native partition handler creation is from clone or brand new. 2. When it is clone, do not reset the partition bitmaps (i.e avoid calling m_part_info->set_partition_bitmaps()). This is the core fix. 3. Additionally, we fix the cloned object creation to use clone mem_root instead of TABLE->mem_root. Optimizer can destroy the cloned handler immediately after its use. (See QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT). So the memory used by cloned handler objects is freed immediately at end of query execution.
c01ad54
to
744f4e1
Compare
Problem:
With native paritioning and index_merge, the native partition handler
is cloned.
One important point missed when fixing PS-5206 is that both the original
and clone share the parition_info object (m_part_info). It has bitmap of
partitions read and used.
The cloned handler, which has reference to the shared to partition_info
object, resets the partition bitmap during creation. This causes problem
during the actual index scan.
Fix:
Create context to identify if the native partition handler creation is
from clone or brand new.
When it is clone, do not reset the partition bitmaps (i.e avoid calling
m_part_info->set_partition_bitmaps()). This is the core fix.
Additionally, we fix the cloned object creation to use clone mem_root
instead of TABLE*->mem_root. Optimizer can destroy the cloned handler
immediately after its use. (See QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT).