Skip to content

Commit

Permalink
Merge branch 'tickets/DM-36223' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
iagaponenko committed Sep 14, 2022
2 parents cb1e7ed + 5729035 commit 7284886
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/qmeta/QMetaMysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using namespace std;
namespace {

// Current version of QMeta schema
char const VERSION_STR[] = "7";
char const VERSION_STR[] = "8";

LOG_LOGGER _log = LOG_GET("lsst.qserv.qmeta.QMetaMysql");

Expand Down
6 changes: 6 additions & 0 deletions src/qmeta/schema/migrate-7-to-8.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Fix a bug that was introduced earlier. In the previous version of
-- the schema these columns were defined as 'INT' (32-bits) which was
-- causing Qserv to crash when result set sizes exceeded the limit.
ALTER TABLE `QInfo` MODIFY COLUMN `collectedBytes` BIGINT DEFAULT 0 COMMENT 'number of bytes collected from workers';
ALTER TABLE `QInfo` MODIFY COLUMN `collectedRows` BIGINT DEFAULT 0 COMMENT 'number of rows collected from workers';
ALTER TABLE `QInfo` MODIFY COLUMN `finalRows` BIGINT DEFAULT 0 COMMENT 'number of rows in the final result';
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ CREATE TABLE IF NOT EXISTS `QInfo` (
`resultLocation` TEXT NULL COMMENT 'Result destination - table name, file name, etc.',
`resultQuery` MEDIUMTEXT NULL COMMENT 'Query to be used by mysqlproxy to get final results.',
`chunkCount` INT NOT NULL COMMENT 'number of chunks needed by the query',
`collectedBytes` INT DEFAULT 0 COMMENT 'number of bytes collected from workers',
`collectedRows` INT DEFAULT 0 COMMENT 'number of rows collected from workers',
`finalRows` INT DEFAULT 0 COMMENT 'number of rows in the final result',
`collectedBytes` BIGINT DEFAULT 0 COMMENT 'number of bytes collected from workers',
`collectedRows` BIGINT DEFAULT 0 COMMENT 'number of rows collected from workers',
`finalRows` BIGINT DEFAULT 0 COMMENT 'number of rows in the final result',
PRIMARY KEY (`queryId`),
KEY `QInfo_czarId_index` (`czarId`),
KEY `QInfo_status_index` (`status`),
Expand Down Expand Up @@ -218,5 +218,5 @@ COMMENT = 'Table of messages generated during queries.';
-- Version 5 added QMessages table.
-- Version 6 added indexes to optimize queries made by the Qserv Web Dashboard.
-- Version 7 added final row count to QInfo.
INSERT INTO `QMetadata` (`metakey`, `value`) VALUES ('version', '7');

-- Version 8 replaced INT with BIGINT in the byte and row counter columns of QInfo.
INSERT INTO `QMetadata` (`metakey`, `value`) VALUES ('version', '8');
5 changes: 3 additions & 2 deletions src/replica/HttpQservMonitorModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,9 @@ json HttpQservMonitorModule::_pastUserQueries(Connection::Ptr& conn, string cons
::parseFieldIntoJson<string>(__func__, row, "resultLocation", resultRow, "");
::parseFieldIntoJson<string>(__func__, row, "resultQuery", resultRow, "");
::parseFieldIntoJson<long>(__func__, row, "chunkCount", resultRow, 0);
::parseFieldIntoJson<long>(__func__, row, "resultBytes", resultRow, 0);
::parseFieldIntoJson<long>(__func__, row, "resultRows", resultRow, 0);
::parseFieldIntoJson<uint64_t>(__func__, row, "collectedBytes", resultRow, 0);
::parseFieldIntoJson<uint64_t>(__func__, row, "collectedRows", resultRow, 0);
::parseFieldIntoJson<uint64_t>(__func__, row, "finalRows", resultRow, 0);
resultRow["messages"] = json::array();
result.push_back(resultRow);
}
Expand Down
8 changes: 5 additions & 3 deletions src/www/qserv/js/StatusUserQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ function(CSSLoader,
<th class="sticky">Type</th>
<th class="sticky" style="text-align:right;">Chunks</th>
<th class="sticky" style="text-align:right;">Ch/min</th>
<th class="sticky" style="text-align:right;">&sum;&nbsp;Bytes</th>
<th class="sticky" style="text-align:right;">&sum;&nbsp;Rows</th>
<th class="sticky" style="text-align:right;">Rows</th>
<th class="sticky" style="text-align:right;">Bytes</th>
<th class="sticky" style="text-align:right;">QID</th>
<th class="sticky" style="text-align:center;"><i class="bi bi-clipboard-fill"></i></th>
<th class="sticky" style="text-align:center;"><i class="bi bi-info-circle-fill"></i></th>
Expand Down Expand Up @@ -426,8 +427,9 @@ function(CSSLoader,
<td><pre>` + query.qType + `</pre></td>
<th style="text-align:right;"><pre>${query.chunkCount}</pre></th>
<td style="text-align:right;" ><pre>${performance > 0 ? performance : ''}</pre></td>
<th style="text-align:right;"><pre>${query.resultRows}</pre></th>
<th style="text-align:right;"><pre>${query.resultBytes}</pre></th>
<th style="text-align:right;"><pre>${query.collectedBytes}</pre></th>
<th style="text-align:right;"><pre>${query.collectedRows}</pre></th>
<th style="text-align:right;"><pre>${query.finalRows}</pre></th>
<th style="text-align:right;"><pre>${query.queryId}</pre></th>
<td style="text-align:right; padding-top:0; padding-bottom:0">
<button class="btn btn-outline-dark btn-sm copy-query" style="height:20px; margin:0px;" title="${queryCopyTitle}"></button>
Expand Down

0 comments on commit 7284886

Please sign in to comment.