Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
ports:
# Useful to connect a local MySQL client / GUI
- 127.0.0.1:13306:3306
command: --max-connections=1000 --max-allowed-packet=512M
command: --max-connections=1000 --max-allowed-packet=512M --innodb_snapshot_isolation=OFF
volumes:
- /var/lib/mysql
domjudge:
Expand Down
7 changes: 7 additions & 0 deletions webapp/src/Controller/Jury/JuryMiscController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ public function __construct(
#[Route(path: '', name: 'jury_index')]
public function indexAction(ConfigurationService $config): Response
{
if ($this->isGranted('ROLE_ADMIN')) {
$innodbSnapshotIsolation = $this->em->getConnection()->query('SHOW VARIABLES LIKE "innodb_snapshot_isolation"')->fetchAssociative();
if ($innodbSnapshotIsolation && $innodbSnapshotIsolation['Value'] === 'ON') {
$this->addFlash('danger', 'InnoDB snapshot isolation is enabled. Set --innodb_snapshot_isolation=OFF in your MariaDB configuration. See https://github.com/DOMjudge/domjudge/issues/2848 for more information.');
}
}

return $this->render('jury/index.html.twig', [
'adminer_enabled' => $config->get('adminer_enabled'),
'CCS_SPEC_API_URL' => GI::CCS_SPEC_API_URL,
Expand Down
13 changes: 12 additions & 1 deletion webapp/src/Service/CheckConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,16 @@ public function checkMysqlSettings(): ConfigCheckItem
$r = $this->em->getConnection()->fetchAllAssociative(
'SHOW variables WHERE Variable_name IN
("innodb_log_file_size", "max_connections", "max_allowed_packet",
"tx_isolation", "transaction_isolation")'
"tx_isolation", "transaction_isolation", "innodb_snapshot_isolation")'
);

$vars = [];
foreach ($r as $row) {
$vars[$row['Variable_name']] = $row['Value'];
}
if (!isset($vars['innodb_snapshot_isolation'])) {
$vars['innodb_snapshot_isolation'] = false;
}
# MySQL 8 has "transaction_isolation" instead of "tx_isolation".
if (isset($vars['transaction_isolation'])) {
$vars['tx_isolation'] = $vars['transaction_isolation'];
Expand Down Expand Up @@ -251,6 +255,13 @@ public function checkMysqlSettings(): ConfigCheckItem
$desc .= sprintf("max_allowed_packet is set to %s.\n", Utils::printsize((int)$vars['max_allowed_packet']));
}

if ($vars['innodb_snapshot_isolation'] === 'ON') {
$result = 'E';
$desc .= 'InnoDB snapshot isolation is enabled. Set --innodb_snapshot_isolation=OFF in your MariaDB configuration. See https://github.com/DOMjudge/domjudge/issues/2848 for more information.';
} else {
$desc .= "InnoDB snapshot isolation is disabled.\n";
}

$this->stopwatch->stop(__FUNCTION__);
return new ConfigCheckItem(
caption: 'MySQL settings',
Expand Down
Loading