maria:bb-10.11-mdev31577

Last commit made on 2023-06-29
Get this branch:
git clone -b bb-10.11-mdev31577 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.11-mdev31577
Repository:
lp:maria

Recent commits

f46402e... by Sergey Petrunia

MDEV-31577: Make ANALYZE FORMAT=JSON print innodb stats

First implementation.

ANALYZE FORMAT=JSON_EXT now has table.r_engine_stats which has the
engine statistics. Only non-zero members are printed.

Internally: EXPLAIN data structure Explain_table_acccess now has a
pointer to the handler object. It will read the stats when producing
JSON output.
(TODO: are we ready to commit to the "EXPLAIN data structure requires
that tables used in the query still exist when output is printed") ?

aea9a05... by Monty <email address hidden>

Updated query_response_time plugin

This is to update the plugin to be compatible with Percona's
query_response_time plugin, with some additions.
Some of the tests are taken from Percona server.

- Added plugins QUERY_RESPONSE_TIME_READ, QUERY_RESPONSE_TIME_WRITE and
  QUERY_RESPONSE_TIME_READ_WRITE.
- Added option session_stats.

Notes:
- All modules are dependent on QUERY_RESPONSE_READ_TIME. This must always
  be enabled if any of the other modules are used.
  This will be auto-enabled in the near future.
- Accounting are done per statement. Stored functions are regarded
  as part of the original statement.
- For stored procedures the accounting are done per statement executed
  in the stored procedure. CALL will not be accounted because of this.
- FLUSH commands will not be accounted for. This is to ensure that
  FLUSH QUERY_RESPONSE_TIME is not part of the statistics.
  (This helps when testing with mtr and otherwise)

80f1f1f... by Monty <email address hidden>

MDEV-31558 Add InnoDB engine information to the slow query log

The new statistics is enabled by adding the "innodb" option to
--log-slow-verbosity

Example output:

 # Pages_accessed: 184 Pages_read: 95 Pages_updated: 0 Undo_rows_read: 1
 # Pages_read_time: 17.0204 Engine_time: 248.1297

Page_read_time is time doing physical reads inside a storage engine.
(Writes cannot be tracked as these are usually done in the background).
Engine_time is the time spent inside the storage engine for the full duration
of the read/write/update calls. It uses the same code as 'analyze statement'
for calculating the time spent.

The engine statistics is done with a generic interface that should be
easy for any engine to use. It can also easily be extended to provide
even more statistics.

Currently only InnoDB has counters for Pages_% and Undo_% status.
Engine_time works for all engines.

Implementation details:

class ha_handler_stats holds all engine stats.
This class is included in handler and THD classes.
While a query is running, all statistics is updated in
the handler. In close_thread_tables() the statistics is
added to the THD.

handler::handler_stats is a pointer to where statistics should
be collected. This is set to point to handler::active_handler_stats
if stats are requested. If not, it is set to 0.
handler_stats has also an element, 'active' to that is 1 if stats
are requested. This is to allow engines to avoid doing any 'if's
while updating the statistics.

Cloned or partition tables have the pointer set to the base table if
status are requested.

There is a small performance impact when using --log-slow-verbosity=innodb:
- All engine calls in 'select' will be timed.
- IO calls for InnoDB reads will be timed.
- Incrementation of counters are done on local variables and accesses
  are inline, so these should have very little impact.
- Statistics has to be reset for each statement for the THD and each
  used handler. This is only 40 bytes, which should be neglectable.
- For partition tables we have to loop over all partitions to update
  the handler_status as part of table_init(). Can be optimized in the
  future to only do this is log-slow-verbosity changes. For this to work
  we have to update handler_status for all opened partitions and
  also for all partitions opened in the future.

Other things:
- LOG_SLOW_VERBOSITY_INNODB renamed to #define LOG_SLOW_VERBOSITY_ENGINE
- Some of the new files in the test suite comes from Percona server, which
  has similar status information.
- Do not update buf_pool.stat.n_page_gets for optimistic page access

1c2876b... by Monty <email address hidden>

Simple cleanups (no logic changes)

3eab227... by Monty <email address hidden>

Added option sql_error_warnings to sql_error_log plugin

582d0cf... by Monty <email address hidden>

Added not_as_root.inc to some test scripts that fails if run as root

c70f35f... by Monty <email address hidden>

Disable flush_logs_not_windows.test of run as root (causes failure)

29ec07a... by Monty <email address hidden>

Update BUILD scripts

- Remove -Wimplicit-fallthrough=2 for gcc versions < 6
- Don't do git submodule update one fresh git clones
  This fixes an issue when using git 1.0 that gives
  errors on empty submodule directories

56bcb2b... by Marko Mäkelä

Merge mariadb-10.11.4 into 10.11

5d7b957... by Marko Mäkelä

Merge 10.10 into 10.11