[MDEV-15101] Stop ANALYZE TABLE from flushing table definition cache Created: 2018-01-28  Updated: 2022-10-04  Resolved: 2020-06-12

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Fix Version/s: 10.5.4

Type: Task Priority: Critical
Reporter: Valerii Kravchuk Assignee: Sergei Petrunia
Resolution: Fixed Votes: 7
Labels: percona, upstream

Issue Links:
Relates
relates to MDEV-17882 Cleanup refresh version Closed

 Description   

It is well known that in concurrent environment running ANALYZE TABLE could lead to situation when hundreds of threads are in state "Waiting for table flush".

Percona had resolved this problem recently so that ANALYZE TABLE stops flushing affected tables from the table definition cache, see https://bugs.launchpad.net/percona-server/+bug/1704195 , https://github.com/percona/percona-server/pull/1977 etc for more details.

This is a request to implement the same/similar approach in MariaDB, maybe even 10.1+, but at least 10.3+.



 Comments   
Comment by Sergei Petrunia [ 2019-01-11 ]

The patch in percona server is fairly small and should be applicable to MariaDB:
https://github.com/percona/percona-server/pull/1977/commits/cd7201514fee78aaf7d3eb2b28d2573c76f53b84

I don't quite understand these things yet:

  • if ANALYZE TABLE doesn't cause TABLE objects to be flushed, what will? Or,
    objects with old statistics values will remain in use indefinitely? (Or,
    InnoDB and TokuDB have a property that updated table statistics will start to
    be used anyway, and so flushing the table is redundant?
  • Interplay of this with ANALYZE TABLE commands that collect EITS stats.
Comment by Sergei Petrunia [ 2019-01-11 ]

The patch applies cleanly, testing it in bb-10.3-mdev15101 branch. Will still need to sort out the above questions.

Comment by Laurynas Biveinis [ 2019-01-12 ]

For the first question, those SEs have that property that updated table statistics will start to be used anyway. (Consider e.g. how InnoDB background stats operate which keep stats up to date without flushing anything)

Comment by Sergey Vojtovich [ 2020-03-31 ]

FWIW in MDEV-17882 I came across this issue from another angle. It is now blocking further progress of forementioned MDEV and there're chances that I'll get it fixed to be able to progress further.

Generated at Thu Feb 08 08:18:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.