From 9e792fb0f1f60973acdb2fc7789fe723c07a2bed Mon Sep 17 00:00:00 2001 From: lsv Date: Mon, 8 Dec 2025 09:41:38 +0500 Subject: [PATCH] Highlighting the "autovacuum launcher" process in the presence of inactive replication slots. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлена подсветка процесса "autovacuum launcher" если нет активных слотов репликации. Цвет подсветки как для заблокированного процесса. --- frm/frmStatus.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/frm/frmStatus.cpp b/frm/frmStatus.cpp index a7e5ed3..529cc28 100644 --- a/frm/frmStatus.cpp +++ b/frm/frmStatus.cpp @@ -1922,7 +1922,8 @@ void frmStatus::OnRefreshStatusTimer(wxTimerEvent &event) // Clear the queries array content queries.Clear(); wxString blocked=wxT(""); - + int countsenders=0; + long pidAV=-1; wxArrayLong pids; wxDateTime tt; while (!dataSet1->Eof()) @@ -2024,15 +2025,21 @@ void frmStatus::OnRefreshStatusTimer(wxTimerEvent &event) { backend_xid= dataSet1->GetVal(wxT("backend_xid")); statusList->SetItem(row, colpos++, backend_xid); - if (!slinfo.IsEmpty()) statusList->SetItem(row, colpos++, dataSet1->GetVal(wxT("xmin_slot"))); + if (!slinfo.IsEmpty()) { + statusList->SetItem(row, colpos++, dataSet1->GetVal(wxT("xmin_slot"))); + countsenders++; + } else { wxString av_replica; if (iswalsend) av_replica= dataSet1->GetVal(wxT("av_replica")); if (av_replica.IsEmpty()) statusList->SetItem(row, colpos++, dataSet1->GetVal(wxT("backend_xmin"))); - else + else { statusList->SetItem(row, colpos++, av_replica); + pidAV=pid; + } + } } if (connection->BackendMinimumVersion(9, 6)) @@ -2142,6 +2149,17 @@ void frmStatus::OnRefreshStatusTimer(wxTimerEvent &event) delete dataSet1; if (viewMenu->IsChecked(MNU_HIGHLIGHTSTATUS)) { + if (countsenders == 0 && pidAV>0) { + // all walsender active='f' + for(long i = 0; i < pids.size(); i++) + { + if (pids[i]==pidAV) + statusList->SetItemBackgroundColour(i, + wxColour(settings->GetBlockedProcessColour())); + } + } + + // who blocking wxString numstr; wxString str; numstr=blocked.BeforeFirst(',',&str);