Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.0, 12.3.3
-
Linux x86_64; official image
`mariadb@sha256:dd9b303aed4f4890ed09f766d8ca9ddfd176c0c6f6267feff53b3192ec65a979`;
server reports `12.3.3-MariaDB-ubu2404`, source revision
`83e909fc2a0dbc394b4b683fb3fa2d7dcf26cc5e`; 64-bit build with the source-defined
8 MiB InnoDB extent size. The separate default current buffer-pool size is 128 MiB.Linux x86_64; official image ` mariadb@sha256 :dd9b303aed4f4890ed09f766d8ca9ddfd176c0c6f6267feff53b3192ec65a979`; server reports `12.3.3-MariaDB-ubu2404`, source revision `83e909fc2a0dbc394b4b683fb3fa2d7dcf26cc5e`; 64-bit build with the source-defined 8 MiB InnoDB extent size. The separate default current buffer-pool size is 128 MiB.
-
Can result in unexpected behaviour
Description
When `RLIMIT_AS` is finite and lower than the default 8 TiB
`innodb_buffer_pool_size_max`, MariaDB caps the maximum buffer-pool size with a
bit mask. The mask clears the bits present in the extent value itself instead
of clearing all lower bits, so the published maximum need not be a multiple of
the extent size.
With an address-space limit of 5,000,000,000 bytes, the official release starts
but reports a maximum of 1,241,611,392 bytes, whose remainder modulo 8 MiB is
97,408. The same image without the finite limit reports an aligned value.
Steps to reproduce
set -eu
|
IMAGE='mariadb@sha256:dd9b303aed4f4890ed09f766d8ca9ddfd176c0c6f6267feff53b3192ec65a979'
|
CONTROL='mdev-rlimit-control'
|
TRIGGER='mdev-rlimit-trigger'
|
OWNER="edbf-report-mcfg04-$$"
|
|
|
owned_remove() {
|
NAME=$1
|
if docker inspect --format '{{ index .Config.Labels "io.encryptiondbfuzz.owner" }}' \
|
"$NAME" 2>/dev/null | grep -Fqx "$OWNER"; then
|
docker rm -f "$NAME" >/dev/null 2>&1 || true
|
fi
|
}
|
cleanup() {
|
owned_remove "$CONTROL"
|
owned_remove "$TRIGGER"
|
}
|
trap cleanup EXIT
|
|
|
run_common() {
|
NAME=$1
|
shift
|
docker run --detach --name "$NAME" \
|
--label "io.encryptiondbfuzz.owner=$OWNER" \
|
--network none --read-only --cap-drop ALL \
|
--security-opt no-new-privileges=true --pids-limit 160 \
|
--memory 768m --cpus 1 --user 999:999 \
|
--tmpfs /var/lib/mysql:rw,nosuid,nodev,size=512m,uid=999,gid=999 \
|
--tmpfs /run/mysqld:rw,nosuid,nodev,size=16m,uid=999,gid=999 \
|
--tmpfs /tmp:rw,nosuid,nodev,size=64m,uid=999,gid=999 \
|
--env MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 "$@"
|
}
|
|
|
wait_and_query() {
|
NAME=$1
|
READY=0
|
for I in $(seq 1 90); do
|
if docker exec --user 999:999 "$NAME" mariadb --protocol=socket \
|
--socket=/run/mysqld/mysqld.sock -uroot -NBe 'SELECT @@port' \
|
2>/dev/null | grep -qx 3306; then
|
READY=1
|
break
|
fi
|
sleep 1
|
done
|
test "$READY" -eq 1
|
docker exec --user 999:999 "$NAME" mariadb --protocol=socket \
|
--socket=/run/mysqld/mysqld.sock -uroot -NBe \
|
'SELECT @@innodb_buffer_pool_size_max,@@innodb_buffer_pool_size,
|
MOD(@@innodb_buffer_pool_size_max,8388608)'
|
}
|
|
|
run_common "$CONTROL" "$IMAGE"
|
echo 'control: max current remainder'
|
wait_and_query "$CONTROL"
|
owned_remove "$CONTROL"
|
|
|
run_common "$TRIGGER" --entrypoint /usr/bin/prlimit "$IMAGE" \
|
--as=5000000000:5000000000 -- docker-entrypoint.sh mariadbd
|
echo 'trigger: max current remainder'
|
wait_and_query "$TRIGGER"
|
Actual result
control: max current remainder
|
8796093022208 134217728 0
|
trigger: max current remainder
|
1241611392 134217728 97408
|
The trigger server was otherwise healthy. This release build does not execute
the Debug assertion that requires the maximum to be extent-aligned.
Expected result
The finite-limit cap should be rounded down with an extent-alignment mask such
as `~(extent_size - 1)`. `innodb_buffer_pool_size_max` should remain an exact
multiple of the configured extent size in both release and Debug builds.
Attachments
Issue Links
- is caused by
-
MDEV-39139 InnoDB fails to start up with small RLIMIT_AS
-
- Closed
-