maria:bb-10.8-danielblack-MDEV-25282-Auto-shutdown-on-idle-when-socket-activated

Last commit made on 2021-12-15
Get this branch:
git clone -b bb-10.8-danielblack-MDEV-25282-Auto-shutdown-on-idle-when-socket-activated https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.8-danielblack-MDEV-25282-Auto-shutdown-on-idle-when-socket-activated
Repository:
lp:maria

Recent commits

3242434... by Daniel Black

MDEV-25282 Auto-shutdown on idle when socket-activated

Adds max_idle_execution system variable that corresponds
to the time in seconds under which the mariadbd executable will
run in an idle state (since last query) with no connections.

Under systemd socket activation this variable will get a 10 minute
default value, otherwise 0, representing no timeout. This will
enable a service to be activated on connection and fall back to
a shutdown state after 10 minutes of no queries. The systemd
socket activation can restart the service on the next connection
transparently.

The maxmium max_idle_execution is given by the following
factors given its dependance on the OS system calls.

Windows WaitForMultipleObjects takes a DWORD (unsigned)
measure in milliseconds. Poll takes a signed int milliseconds,
and negative values are treated as infinite so we can't overflow.
Select, the fall back if poll isn't there, takes a seconds value
in a timeval.time_t structure. As such the interface maximiums are:
Windows: UINT_MAX / 1000
Poll: INT_MAX / 1000
Select: UINT_MAX (or higher)

As even the smallest value here, INT_MAX(32) / 1000 is ~25 days,
sufficient for the typical use case, its used in all environment for
simplicity of documentation and test cases.

A (non-exposed) global variable of server_last_activity is updated
on accepted connections (when max_idle_execution !=0)
and when the connection count (standard or extra) is down
to <= 1 to keep the number of updates on a single variable
low.

When the main accept loop times out on the max_idle_execution
seconds, and then the server_last_activity is checked along
with if current connection count (standard + extra) is 0
(in case a recently started connection hasn't finished
a query).

To make this neater, in non-Windows main accept loop moved
code to handle_new_socket_connection that encompases accepting
a connection and the timeout mechanism has been separated too.

Changed when looping though possible connections, loop until
the end of the connection list and hereby assume two connection can
occur on the same poll/select call and both will be accepted.

The interactive_timeout and wait_timeout inherit the
max_idle_execution time (if set) compared to their previous defaults.

Thanks Sergei for the review.

4434fb4... by Marko Mäkelä

Merge 10.7 into 10.8

92a4e76... by Marko Mäkelä

Merge 10.6 into 10.7

b1d647a... by mkaruza <email address hidden>

MDEV-27001 Galera crashes when converting table to partition

SQL statments could have table entries added in lexer. This entries
should not invalidate `next_global` member.

Reviewed-by: Jan Lindström <email address hidden>

660cfe4... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer

- Addressing the format issue in deferred_dblwr() and changed the
function comment.

18c335a... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-27111 atomic.rename_table test case fails

  InnoDB fails to identify the deferred tablespace after recovery.
Problem is that InnoDB fails to rename the tablespace present
in recovered tablespace. Fix is that InnoDB should try to rename the
recovered tablespace when tablespace is being deferred

be5990d... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-27014 InnoDB fails to restore page 0 from the doublewrite buffer

  This patch reverts the commit cab8f4b552d234c8642f87fae28ecb098392c381.
InnoDB fails to restore page0 from doublewrite buffer when the
tablespace is being deferred. In that case, InnoDB doesn't find
INIT_PAGE redo log record for page0 and it leads to failure.
InnoDB should recovery page0 from doublewrite buffer for the
deferred tablespace before applying the redo log records.

Added deferred_dblwr() to restore page0 of deferred tablespace
from doublewrite buffer

ea94895... by Sergei Krivonos <email address hidden>

MDEV-27206: [ERROR] Duplicated key: cause, Assertion `is_uniq_key' failed with optimizer trace

ccdf571... by Marko Mäkelä

Merge 10.7 into 10.8

979b23d... by Marko Mäkelä

Add forgotten changes to the parent commit