`Slow_query_ratio` keeps failing after a temporary `long_query_time = 0`

オープン 初心者向け
#1,296 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
mariadb, php

調査の方向性

lib/Database/RuleSet/Mysql.php:167 から始めます。この場所では、ライフタイムの Slow_queries / Questions 比率が計算されています。Uptime_since_flush_status を含む利用可能な MariaDB のステータス値を追跡し、一時的な long_query_time = 0 でその動作を再現します。完了条件は、診断ウィンドウの後にスロークエリの比率が回復し、MariaDB の再起動を必要としないことです。また、リセットシナリオをカバーする回帰テストを含めます。

索引モデルが issue の本文から書いたものです。

説明

1. to develop bug
How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Reported in #1294. Confirmed in the code on master, not reproduced on a live instance.

Steps to reproduce
  1. On MariaDB, set long_query_time = 0 at runtime to capture queries for a diagnosis.
  2. Set it back to the previous value.
  3. Open Administration settings → Server info → Database.
Expected behaviour

The Slow_query_ratio check recovers once long_query_time is back to normal.

Actual behaviour

The check keeps failing until MariaDB restarts. The rule divides lifetime counters (Slow_queries / Questions, lib/Database/RuleSet/Mysql.php:167), so every query from the diagnostic window stays counted as slow. The uptime gate doesn't help, because uptime keeps growing. A rate, or values since Uptime_since_flush_status, would avoid this.

Assisted by ClaudeCode:claude-opus-5-5

主要言語
JavaScript
スター
134
フォーク
71
平均マージ
18時間 56分
マージ済み PR(30日)
33

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextcloud/serverinfo のほかの issue

nextcloud/serverinfo の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。