← Back to team overview

maria-developers team mailing list archive

Re: Questions regarding closing partitions in MDEV-11084

 

Hi, Mattias, guys!

While investigating the crash, i'd like to discuss that

it seems to close partitions whenever it
is not used in a statement (i.e. require it to be reopened in the next
statement that would use another partition

Yes, it does that, handling statements with the specified 'PARTITION' option. The patch supposed to solve the problem when there are too many partitions opened,
so i think it must close the unused partitions sometime.
No, it doesn't have to happen that often. I planned to check the table_open_cache variable before the forced close. But decided not to do that initially - as it simplified testing, and i thought if someone uses the PARTITION option, he would stick to using this partition
anyway. And  i forgot about that issue.


Best regards.
HF



13.04.2018 19:07, Mattias Jonsson wrote:
Hi MariaDB Devs,

I tried to evaluate spider engine and found an issue where it crashes,
most likely due to MDEV-11084 (Stacktrace and reproducible test case
attached).

That also leads me to wonder about the performance for partitioned
tables after MDEV-11084, when it seems to close partitions whenever it
is not used in a statement (i.e. require it to be reopened in the next
statement that would use another partition, effectively not using the
open table cache).

I cannot see anything mentioned in the final commit message hinting on
that it closes partitions not used in the current query, but in the
previous patches it was mentioned without any reason.

Why does it close the already opened partitions?
https://github.com/MariaDB/server/blob/10.3/sql/ha_partition.cc#L8365

I would not mind opening the partitions only when they are to be used
(even though there are engines that need to be tested more), but
closing them makes no sense to me performance wise. Also notice that
the partitions first will be put back into the open table cache and
then on the next query the non-used partitions will be closed and the
needed ones be (re)-opened.

Regards
Mattias Jonsson




Follow ups